CuteHMI - Services (CuteHMI.Services.2)
|
Serviceable interface. More...
#include <cutehmi/services/Serviceable.hpp>
Public Types | |
typedef QHash< QState *, QString > | ServiceStatuses |
Public Member Functions | |
Serviceable ()=default | |
virtual std::unique_ptr< ServiceStatuses > | configureStarted (QState *active, const QState *idling, const QState *yielding)=0 |
Configure started state. More... | |
virtual std::unique_ptr< ServiceStatuses > | configureStarting (QState *starting)=0 |
Configure starting state. More... | |
virtual std::unique_ptr< ServiceStatuses > | configureStopping (QState *stopping)=0 |
Configure stopping state. More... | |
virtual std::unique_ptr< ServiceStatuses > | configureBroken (QState *broken)=0 |
Configure broken state. More... | |
virtual std::unique_ptr< ServiceStatuses > | configureRepairing (QState *repairing)=0 |
Configure repairing state. More... | |
virtual std::unique_ptr< ServiceStatuses > | configureEvacuating (QState *evacuating)=0 |
Configure evacuating state. More... | |
virtual std::unique_ptr< QAbstractTransition > | transitionToStarted () const =0 |
Transition to started state. More... | |
virtual std::unique_ptr< QAbstractTransition > | transitionToStopped () const =0 |
Transition to stopped state. More... | |
virtual std::unique_ptr< QAbstractTransition > | transitionToBroken () const =0 |
Transition to broken state. More... | |
virtual std::unique_ptr< QAbstractTransition > | transitionToYielding () const =0 |
Transition to yielding state. More... | |
virtual std::unique_ptr< QAbstractTransition > | transitionToIdling () const =0 |
Transition to idling state. More... | |
Protected Member Functions | |
virtual | ~Serviceable ()=default |
Serviceable (const Serviceable &other)=default | |
Serviceable & | operator= (const Serviceable &other)=default |
Serviceable interface.
By implementing this interface object is allowed to be embedded inside Service instance.
Implementing Serviceable interface involves configuring states and defining transitions. During configuration state interface can be extended by adding additional child states to the states passed by configuration functions.
Standard states and transitions are shown on the following state chart diagram.
Implementing object can utilize the state machine according to its needs by:
|
default |
|
protectedvirtualdefault |
|
protecteddefault |
|
pure virtual |
Configure broken state.
broken | state. |
nullptr
if default statuses should be used.
|
pure virtual |
Configure evacuating state.
evacuating | state. |
nullptr
if default statuses should be used.
|
pure virtual |
Configure repairing state.
repairing | state. |
nullptr
if default statuses should be used.
|
pure virtual |
Configure started state.
Started state is not directly accessible. Intead its child states shall be configured.
active | active state. |
idling | idling state. |
yielding | yielding state. |
nullptr
if default statuses should be used.
|
pure virtual |
Configure starting state.
starting | state. |
nullptr
if default statuses should be used.
|
pure virtual |
Configure stopping state.
stopping | state. |
nullptr
if default statuses should be used.
|
protecteddefault |
|
pure virtual |
Transition to broken state.
nullptr
. In such case service will never enter broken or repairing states.
|
pure virtual |
Transition to idling state.
nullptr
. In such case service will not enter idling state and will remain persistently active. This will make service impolite.
|
pure virtual |
Transition to started state.
nullptr
. In such case transition from starting to started state will be immediate.
|
pure virtual |
Transition to stopped state.
nullptr
. In such case transition from stopping to stopped state will be immediate.
|
pure virtual |
Transition to yielding state.
nullptr
. In such case service will skip yielding state and immediately become active. This will make service impolite.