|
TuringSim
C++ framework to simulate abstract computing models
|
A simple explicit state pattern. More...
#include <state/simpleStatePattern.h>


Public Member Functions | |
| constexpr | SimpleStatePattern (const T &acceptedState) |
| Construct a simple configuration from the letter in parameter. More... | |
| constexpr | SimpleStatePattern (const SimpleStatePattern &other) |
| Copy a state pattern. More... | |
| constexpr | SimpleStatePattern (SimpleStatePattern &&other) |
| Move a state pattern. More... | |
| constexpr SimpleStatePattern & | operator= (const SimpleStatePattern &other) |
| Copy a state pattern. More... | |
| constexpr SimpleStatePattern & | operator= (SimpleStatePattern &&other) |
| Move a state pattern. More... | |
| virtual | ~SimpleStatePattern () override=default |
| Destructor. | |
| constexpr const T & | getState () const |
| get the accepting state More... | |
| virtual std::optional< MatcherType > | match (const T &state) const noexcept override |
| Test if a state matches. More... | |
| bool | operator< (const SimpleStatePattern< T > &other) const |
| Total ordering of SimpleStatePattern. More... | |
Public Member Functions inherited from TuringSim::State::StatePattern< T, std::monostate > | |
| constexpr | StatePattern ()=default |
| Default constructor. | |
| constexpr | StatePattern (const StatePattern &other)=default |
| Copy a state pattern. More... | |
| constexpr | StatePattern (StatePattern &&other)=default |
| Move a state pattern. More... | |
| constexpr StatePattern & | operator= (const StatePattern &other)=default |
| Copy a state pattern. More... | |
| constexpr StatePattern & | operator= (StatePattern &&other)=default |
| Move a state pattern. More... | |
| virtual | ~StatePattern ()=default |
| Destructor. | |
Additional Inherited Members | |
Public Types inherited from TuringSim::State::StatePattern< T, std::monostate > | |
| typedef T | StateType |
| The type of states matched. | |
| typedef std::monostate | MatcherType |
| The type returned when a state matches the pattern. | |
A simple explicit state pattern.
| T | The type of the state |
Such a pattern accept a single explicit state.
Definition at line 15 of file simpleStatePattern.h.
|
inlineconstexpr |
Construct a simple configuration from the letter in parameter.
| [in] | acceptedState | the only state to accept. |
Definition at line 27 of file simpleStatePattern.h.
|
inlineconstexpr |
Copy a state pattern.
| [in] | other | the state pattern to copy. |
Definition at line 35 of file simpleStatePattern.h.
|
inlineconstexpr |
Move a state pattern.
| [in,out] | other | the state pattern to move. |
Definition at line 43 of file simpleStatePattern.h.
|
inlineconstexpr |
get the accepting state
This function is useful for optimized containers. See TuringSim::Machine::SimpleTuringMachine and derived classes.
Definition at line 82 of file simpleStatePattern.h.

|
inlineoverridevirtualnoexcept |
Test if a state matches.
| [in] | state | The state to match. |
std::monostate is returned. Implements TuringSim::State::StatePattern< T, std::monostate >.
Definition at line 90 of file simpleStatePattern.h.

|
inline |
Total ordering of SimpleStatePattern.
| [in] | other | the other SimpleStatePattern to compare with. |
*this < other. Definition at line 101 of file simpleStatePattern.h.
|
inlineconstexpr |
Copy a state pattern.
| [in] | other | the state pattern to copy. |
*this. Definition at line 52 of file simpleStatePattern.h.
|
inlineconstexpr |
Move a state pattern.
| [in,out] | other | the state pattern to move. |
*this. Definition at line 64 of file simpleStatePattern.h.