The abstract state class. All states inherit from this class.
More...
#include <State.hpp>
|
| | State (States eState) |
| | Construct a new State object.
|
| |
| virtual | ~State ()=default |
| | Destroy the State object.
|
| |
| virtual States | TriggerEvent (Event eEvent)=0 |
| | Trigger an event in the state machine. Returns the next state.
|
| |
| virtual void | Run ()=0 |
| | Run the state machine. Returns the next state.
|
| |
| States | GetState () const |
| | Accessor for the State private member.
|
| |
| virtual std::string | ToString () const |
| | Accessor for the State private member. Returns the state as a string.
|
| |
| virtual bool | operator== (const State &other) const |
| | Checks to see if the current state is equal to the passed state.
|
| |
| virtual bool | operator!= (const State &other) const |
| | Checks to see if the current state is not equal to the passed state.
|
| |
|
| virtual void | Start () |
| | This method is called when the state is first started. It is used to initialize the state.
|
| |
| virtual void | Exit () |
| | This method is called when the state is exited. It is used to clean up the state.
|
| |
|
|
States | m_eState |
| |
|
std::string | m_szStateName |
| |
The abstract state class. All states inherit from this class.
- Author
- Eli Byrd (edbgk.nosp@m.k@ms.nosp@m.t.edu)
- Date
- 2024-01-18
◆ State()
| statemachine::State::State |
( |
States |
eState | ) |
|
|
inline |
Construct a new State object.
- Parameters
-
| eState | - The state to start in. |
- Author
- Eli Byrd (edbgk.nosp@m.k@ms.nosp@m.t.edu)
- Date
- 2024-01-18
146 {
147
148 m_eState = eState;
149
150
152
153
155 }
virtual void Start()
This method is called when the state is first started. It is used to initialize the state.
Definition State.hpp:124
std::string StateToString(States eState)
Converts a state object to a string.
Definition State.hpp:85
◆ ~State()
| virtual statemachine::State::~State |
( |
| ) |
|
|
virtualdefault |
◆ Start()
| virtual void statemachine::State::Start |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ Exit()
| virtual void statemachine::State::Exit |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ TriggerEvent()
| virtual States statemachine::State::TriggerEvent |
( |
Event |
eEvent | ) |
|
|
pure virtual |
◆ Run()
| virtual void statemachine::State::Run |
( |
| ) |
|
|
pure virtual |
◆ GetState()
| States statemachine::State::GetState |
( |
| ) |
const |
|
inline |
◆ ToString()
| virtual std::string statemachine::State::ToString |
( |
| ) |
const |
|
inlinevirtual |
Accessor for the State private member. Returns the state as a string.
- Returns
- std::string - The current state as a string.
- Author
- Eli Byrd (edbgk.nosp@m.k@ms.nosp@m.t.edu)
- Date
- 2024-01-17
202{ return m_szStateName; }
◆ operator==()
| virtual bool statemachine::State::operator== |
( |
const State & |
other | ) |
const |
|
inlinevirtual |
Checks to see if the current state is equal to the passed state.
- Parameters
-
| other | - The state to compare to. |
- Returns
- true - The states are equal.
-
false - The states are not equal.
- Author
- Eli Byrd (edbgk.nosp@m.k@ms.nosp@m.t.edu)
- Date
- 2024-01-17
214{
return ToString() == other.ToString(); }
virtual std::string ToString() const
Accessor for the State private member. Returns the state as a string.
Definition State.hpp:202
◆ operator!=()
| virtual bool statemachine::State::operator!= |
( |
const State & |
other | ) |
const |
|
inlinevirtual |
Checks to see if the current state is not equal to the passed state.
- Parameters
-
| other | - The state to compare to. |
- Returns
- true - The states are not equal.
-
false - The states are equal.
- Author
- Eli Byrd (edbgk.nosp@m.k@ms.nosp@m.t.edu)
- Date
- 2024-01-17
virtual bool operator==(const State &other) const
Checks to see if the current state is equal to the passed state.
Definition State.hpp:214
The documentation for this class was generated from the following file: