6 #include "component_p.h"
13 , d_ptr(new ComponentPrivate)
30 return Component::None;
68 if (d->proccessRoles) {
69 const auto beforeRoles = d->beforeRoles;
71 if (!code->beforeExecute(c)) {
83 const auto afterRoles = d->afterRoles;
85 if (!code->afterExecute(c)) {
107 int stackSize = stack.
size();
108 if (stackSize == 1) {
111 }
else if (stackSize > 1) {
117 qCCritical(CUTELYST_COMPONENT) <<
"Reached end of the stack!" << c->
req()->uri();
138 if (code->modifiers() & BeforeExecute) {
139 d->beforeRoles.push(code);
142 if (code->modifiers() & AroundExecute) {
143 d->aroundRoles.push(code);
146 if (code->modifiers() & AfterExecute) {
147 d->afterRoles.push(code);
151 d->proccessRoles =
true;
158 const auto roles = d->roles;
160 code->dispatcherReady(dispatch, controller);
165 #include "moc_component.cpp"
The Cutelyst application.
The Cutelyst Component base class.
virtual Modifiers modifiers() const
virtual bool doExecute(Context *c)
void setReverse(const QString &reverse)
virtual bool init(Application *application, const QVariantHash &args)
virtual bool beforeExecute(Context *c)
virtual bool dispatcherReady(const Dispatcher *dispatch, Controller *controller)
Component(QObject *parent=nullptr)
virtual bool aroundExecute(Context *c, QStack< Component * > stack)
void applyRoles(const QStack< Component * > &roles)
QString reverse() const noexcept
QString name() const noexcept
void setName(const QString &name)
virtual ~Component() override
virtual bool afterExecute(Context *c)
Cutelyst Controller base class.
The Cutelyst namespace holds all public Cutelyst API.
void push_front(QList::parameter_type value)
qsizetype size() const const