Cutelyst  1.8.0
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
Cutelyst::DispatchType Class Referenceabstract
Inheritance diagram for Cutelyst::DispatchType:
Inheritance graph
[legend]

Public Types

enum  MatchType { NoMatch, PartialMatch, ExactMatch }
 

Public Member Functions

 DispatchType (QObject *parent=nullptr)
 
virtual ActionexpandAction (Context *c, Action *action) const
 
virtual bool inUse ()=0
 
virtual bool isLowPrecedence () const
 
virtual QByteArray list () const =0
 list the registered actions To be implemented by subclasses
 
virtual MatchType match (Context *c, const QString &path, const QStringList &args) const =0
 
virtual bool registerAction (Action *action)
 registerAction More...
 
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
 

Detailed Description

Definition at line 33 of file dispatchtype.h.

Member Enumeration Documentation

This enum is used to describe the kind of a match

Definition at line 38 of file dispatchtype.h.

Constructor & Destructor Documentation

Cutelyst::DispatchType::DispatchType ( QObject *  parent = nullptr)
explicit

Construct a DispatchType object

Member Function Documentation

virtual Action* Cutelyst::DispatchType::expandAction ( Context c,
Action action 
) const
virtual

Expand the action to a list of actions which is used in chained

Reimplemented in Cutelyst::DispatchTypeChained.

virtual bool Cutelyst::DispatchType::inUse ( )
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 bool Cutelyst::DispatchType::isLowPrecedence ( ) const
virtual

Returns true if the dispatch type has low precedence when the precedence is the same the Class name is used to sort them.

virtual MatchType Cutelyst::DispatchType::match ( Context c,
const QString &  path,
const QStringList &  args 
) const
pure virtual

Return true if the dispatchType matches the given path

Implemented in Cutelyst::DispatchTypeChained, and Cutelyst::DispatchTypePath.

virtual bool Cutelyst::DispatchType::registerAction ( Action action)
virtual
Parameters
action
Returns

Reimplemented in Cutelyst::DispatchTypeChained, and Cutelyst::DispatchTypePath.

void Cutelyst::DispatchType::setupMatchedAction ( Context c,
Action action 
) const
protected

Sets the matched action to the Context

virtual QString Cutelyst::DispatchType::uriForAction ( Action action,
const QStringList &  captures 
) const
pure virtual

Returns an uri for an action

Implemented in Cutelyst::DispatchTypePath, and Cutelyst::DispatchTypeChained.