5 #include "component_p.h" 12 , d_ptr(new ComponentPrivate)
21 Component::~Component()
28 return Component::None;
66 if (d->proccessRoles) {
67 const auto beforeRoles = d->beforeRoles;
69 if (!code->beforeExecute(c)) {
81 const auto afterRoles = d->afterRoles;
83 if (!code->afterExecute(c)) {
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)
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)