7#include <Cutelyst/action.h>
8#include <Cutelyst/context.h>
9#include <Cutelyst/cutelyst_export.h>
10#include <Cutelyst/request.h>
11#include <Cutelyst/response.h>
16#define C_PATH(X, Y) Q_CLASSINFO(STR(X##_Path), STR(Y))
23#define C_NAMESPACE(value) Q_CLASSINFO("Namespace", value)
41#define C_ATTR(X, Y) Q_CLASSINFO(STR(X), STR(Y)) Q_INVOKABLE
46#define CActionFor(str) \
47 ([this]() -> Cutelyst::Action * { \
48 static thread_local Cutelyst::Action *action = Cutelyst::Controller::actionFor(str); \
54class ControllerPrivate;
76 [[nodiscard]]
QString ns()
const noexcept;
106 virtual bool preFork(Application *app);
116 virtual bool postFork(Application *app);
125 ControllerPrivate *d_ptr;
129 friend class Application;
130 friend class Dispatcher;
This class represents a Cutelyst Action.
virtual bool preFork(Application *app)
virtual bool postFork(Application *app)
bool operator==(const char *className)
QString ns() const noexcept
ActionList actions() const noexcept
bool _DISPATCH(Context *c)
Controller(QObject *parent=nullptr)
Action * actionFor(QStringView name) const
The Cutelyst namespace holds all public Cutelyst API.
QVector< Action * > ActionList
QObject * parent() const const