![]() |
cutelyst 4.8.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|
Abstract class to described a dispatch type. More...
#include <Cutelyst/DispatchType>

Public Types | |
| enum | MatchType { NoMatch , PartialMatch , ExactMatch } |
Public Member Functions | |
| DispatchType (QObject *parent=nullptr) | |
| virtual | ~DispatchType () |
| virtual Action * | expandAction (const Context *c, Action *action) const |
| virtual bool | inUse ()=0 |
| virtual bool | isLowPrecedence () const |
| virtual QByteArray | list () const =0 |
| virtual MatchType | match (Context *c, QStringView path, const QStringList &args) const =0 |
| virtual bool | registerAction (Action *action) |
| virtual QString | uriForAction (Action *action, const QStringList &captures) const =0 |
Protected Member Functions | |
| void | setupMatchedAction (Context *c, Action *action) const |
Friends | |
| class | Application |
| class | Dispatcher |
This abstract class can be used to describe a dispatch type.
Definition at line 24 of file dispatchtype.h.
This enum is used to describe the kind of a match
Definition at line 29 of file dispatchtype.h.
|
explicit |
Construct a new DispatchType object with the given parent.
Definition at line 11 of file dispatchtype.cpp.
|
virtual |
Destroys the DispatchType object.
Definition at line 16 of file dispatchtype.cpp.
Expand the action to a list of actions which is used in chained. The default implementation does nothing and returns a nullptr.
Reimplemented in Cutelyst::DispatchTypeChained.
Definition at line 20 of file dispatchtype.cpp.
|
pure virtual |
If false the dispatcher will be unregistered for performance reasons. This method can be used to prepare actions for dispatcher as in a Chain of Actions there is no garantee of registering order.
In the common case if the dispatcher has registered any action, or in some special case that it doesn't need actions it will return true.
Implemented in Cutelyst::DispatchTypeChained, and Cutelyst::DispatchTypePath.
|
virtual |
Returns true if the dispatch type has low precedence when the precedence is the same the Class name is used to sort them.
The default implementation return false.
Definition at line 40 of file dispatchtype.cpp.
|
pure virtual |
Lists the registered actions. Has to be implemented by subclasses.
Implemented in Cutelyst::DispatchTypeChained, and Cutelyst::DispatchTypePath.
|
pure virtual |
Returns the MatchType for the given path and args. Has to be implemented by subclasses.
Implemented in Cutelyst::DispatchTypeChained, and Cutelyst::DispatchTypePath.
|
virtual |
Register an action and return true on success. The default implementation does nothing and returns always true.
Reimplemented in Cutelyst::DispatchTypeChained, and Cutelyst::DispatchTypePath.
Definition at line 34 of file dispatchtype.cpp.
Sets the matched action to the Context c.
Definition at line 45 of file dispatchtype.cpp.
References Cutelyst::Context::action.
Referenced by Cutelyst::DispatchTypeChained::match(), and Cutelyst::DispatchTypePath::match().
|
pure virtual |
Returns an uri for an action with given captures. Has to be implemented by subclasses.
Implemented in Cutelyst::DispatchTypeChained, and Cutelyst::DispatchTypePath.
Definition at line 27 of file dispatchtype.cpp.
|
friend |
Definition at line 101 of file dispatchtype.h.
|
friend |
Definition at line 100 of file dispatchtype.h.