6 #include "component_p.h" 13 , d_ptr(new ComponentPrivate)
23 Component::~Component()
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"
void setName(const QString &name)
virtual bool afterExecute(Context *c)
void setReverse(const QString &reverse)
virtual bool doExecute(Context *c)
The Cutelyst Component base class.
Cutelyst Controller base class
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)
Component(QObject *parent=nullptr)
virtual bool dispatcherReady(const Dispatcher *dispatch, Controller *controller)
virtual bool aroundExecute(Context *c, QStack< Component *> stack)
void push_front(T &&value)
The Cutelyst Application.
virtual bool beforeExecute(Context *c)