Design Pattern Examples
Overview of object-oriented design patterns
IStateBehavior Struct Referenceabstract

Represents a class that implements one state of the state machine. More...

#include <State_Class.h>

Collaboration diagram for IStateBehavior:
Collaboration graph

Public Types

using shared_ptr_t = std::shared_ptr< IStateBehavior >
 Alias to make using a shared pointer easier.
 

Public Member Functions

virtual ~IStateBehavior ()
 Virtual destructor as required for interfaces.
 
virtual CurrentState GoNext (IStateContext *context)=0
 

Detailed Description

Represents a class that implements one state of the state machine.

The context calls each state through this interface.

Technically, the StateContext_Class knows about the actual state classes because it has to instantiate them but this interface makes the code for calling the state classes much simpler.

Definition at line 102 of file State_Class.h.

Member Typedef Documentation

◆ shared_ptr_t

using shared_ptr_t = std::shared_ptr<IStateBehavior>

Alias to make using a shared pointer easier.

Definition at line 107 of file State_Class.h.

Constructor & Destructor Documentation

◆ ~IStateBehavior()

virtual ~IStateBehavior ( )
inlinevirtual

Virtual destructor as required for interfaces.

Definition at line 112 of file State_Class.h.

Member Function Documentation

◆ GoNext()

virtual CurrentState GoNext ( IStateContext context)
pure virtual

The documentation for this struct was generated from the following file: