Cutelyst  2.14.2
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 (const 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
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectList & children () const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const
 
bool inherits (const char *className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType)
 
QThreadthread () const
 

Protected Member Functions

void setupMatchedAction (Context *c, Action *action) const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Friends

class Application
 
class Dispatcher
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Definition at line 31 of file dispatchtype.h.

Member Enumeration Documentation

This enum is used to describe the kind of a match

Definition at line 36 of file dispatchtype.h.

Constructor & Destructor Documentation

DispatchType::DispatchType ( QObject parent = nullptr)
explicit

Construct a DispatchType object

Definition at line 24 of file dispatchtype.cpp.

Member Function Documentation

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

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

Reimplemented in Cutelyst::DispatchTypeChained.

Definition at line 33 of file dispatchtype.cpp.

Referenced by Cutelyst::Dispatcher::expandAction().

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.

Referenced by Cutelyst::Dispatcher::setupActions().

bool 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.

Definition at line 53 of file dispatchtype.cpp.

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.

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

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

Definition at line 47 of file dispatchtype.cpp.

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

Sets the matched action to the Context

Definition at line 58 of file dispatchtype.cpp.

Referenced by Cutelyst::DispatchTypeChained::match(), and Cutelyst::DispatchTypePath::match().

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

Returns an uri for an action

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

Definition at line 40 of file dispatchtype.cpp.

Referenced by Cutelyst::Dispatcher::uriForAction().