6 #include "component_p.h" 13 , d_ptr(new ComponentPrivate)
30 return Component::None;
68 if (d->proccessRoles) {
69 const auto beforeRoles = d->beforeRoles;
70 if (!std::ranges::all_of(beforeRoles,
82 const auto afterRoles = d->afterRoles;
83 if (!std::ranges::all_of(afterRoles,
105 int stackSize = stack.
size();
106 if (stackSize == 1) {
109 }
else if (stackSize > 1) {
115 qCCritical(CUTELYST_COMPONENT) <<
"Reached end of the stack!" << c->
req()->uri();
136 if (code->modifiers() & BeforeExecute) {
137 d->beforeRoles.push(code);
140 if (code->modifiers() & AroundExecute) {
141 d->aroundRoles.push(code);
144 if (code->modifiers() & AfterExecute) {
145 d->afterRoles.push(code);
149 d->proccessRoles =
true;
156 const auto roles = d->roles;
158 code->dispatcherReady(dispatch, controller);
163 #include "moc_component.cpp"
void setName(const QString &name)
virtual bool afterExecute(Context *c)
void setReverse(const QString &reverse)
virtual bool doExecute(Context *c)
QString reverse() const noexcept
The Cutelyst Component base class.
qsizetype size() const const
Cutelyst Controller base class.
QString name() const noexcept
virtual bool init(Application *application, const QVariantHash &args)
The Cutelyst namespace holds all public Cutelyst API.
virtual Modifiers modifiers() const
void applyRoles(const QStack< Component *> &roles)
void push_front(parameter_type value)
virtual ~Component() override
Component(QObject *parent=nullptr)
virtual bool dispatcherReady(const Dispatcher *dispatch, Controller *controller)
virtual bool aroundExecute(Context *c, QStack< Component *> stack)
The Cutelyst application.
virtual bool beforeExecute(Context *c)