Cutelyst  1.5.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Cutelyst::Component Class Reference

The Cutelyst Component base class. More...

#include <Cutelyst/Component>

Inheritance diagram for Cutelyst::Component:
Inheritance graph
[legend]

Public Types

enum  Modifier {
  None, OnlyExecute, BeforeExecute, AroundExecute,
  AfterExecute
}
 

Public Member Functions

 Component (QObject *parent=nullptr)
 
bool execute (Context *c)
 
virtual bool init (Application *application, const QVariantHash &args)
 
virtual Modifiers modifiers () const
 
QString name () const
 name More...
 
QString reverse () const
 name More...
 
void setName (const QString &name)
 
void setReverse (const QString &reverse)
 

Protected Member Functions

virtual bool afterExecute (Context *c)
 
void applyRoles (const QStack< Component * > &roles)
 
virtual bool aroundExecute (Context *c, QStack< Component * > stack)
 
virtual bool beforeExecute (Context *c)
 
virtual bool dispatcherReady (const Dispatcher *dispatch, Controller *controller)
 
virtual bool doExecute (Context *c)
 

Protected Attributes

ComponentPrivate * d_ptr
 

Friends

class Controller
 

Detailed Description

This is the base class of a Cutelyst component

Definition at line 40 of file component.h.

Member Function Documentation

virtual bool Cutelyst::Component::dispatcherReady ( const Dispatcher dispatch,
Controller controller 
)
protectedvirtual

Called by dispatcher once it's done preparing actions

Subclasses might want to implement this to cache special actions, such as special methods for REST actions

Reimplemented in Cutelyst::RoleACL.

virtual bool Cutelyst::Component::init ( Application application,
const QVariantHash &  args 
)
virtual

A Does class is always attached to an action, if this method returns false the application will fail to start. Often useful if the user misconfigured the settings

Reimplemented in Cutelyst::RenderView, and Cutelyst::RoleACL.

QString Cutelyst::Component::name ( ) const
Returns
Returns the sub name of this Component.
QString Cutelyst::Component::reverse ( ) const
inline
Returns
Returns the private name of this component.

Definition at line 111 of file component.h.