5#ifndef CUTELYST_CONTROLLER_H
6#define CUTELYST_CONTROLLER_H
8#include <Cutelyst/action.h>
9#include <Cutelyst/context.h>
10#include <Cutelyst/cutelyst_global.h>
11#include <Cutelyst/request.h>
12#include <Cutelyst/response.h>
17#define C_PATH(X, Y) Q_CLASSINFO(STR(X##_Path), STR(Y))
18#define C_NAMESPACE(value) Q_CLASSINFO("Namespace", value)
19#define C_ATTR(X, Y) Q_CLASSINFO(STR(X), STR(Y)) Q_INVOKABLE
21#define CActionFor(str) \
22 ([this]() -> Cutelyst::Action * { \
23 static thread_local Cutelyst::Action *action = Cutelyst::Controller::actionFor(str); \
29class ControllerPrivate;
144 virtual bool preFork(Application *app);
154 virtual bool postFork(Application *app);
163 ControllerPrivate *d_ptr;
167 friend class Application;
168 friend class Dispatcher;
This class represents a Cutelyst Action.
virtual bool preFork(Application *app)
Action * actionFor(const QString &name) const
ActionList actions() const
virtual bool postFork(Application *app)
bool operator==(const char *className)
bool _DISPATCH(Context *c)
Controller(QObject *parent=nullptr)
The Cutelyst namespace holds all public Cutelyst API.
QVector< Action * > ActionList
QObject * parent() const const