|
Open Model Railroad Network (OpenMRN)
|
#include <unistd.h>#include <type_traits>#include <functional>#include <sys/stat.h>#include "executor/Service.hxx"#include "executor/Timer.hxx"#include "utils/Buffer.hxx"#include "utils/Queue.hxx"#include "utils/LinkedObject.hxx"Go to the source code of this file.
Classes | |
| class | StateFlowBase |
| Base class for state machines. More... | |
| class | StateFlowBase::Action |
| Return type for a state flow callback. More... | |
| class | StateFlowBase::StateFlowTimer |
| Use this timer class to deliver the timeout notification to a stateflow. More... | |
| struct | StateFlowBase::StateFlowSelectHelper |
| Use this class to read from an fd using select() in a state flow. More... | |
| struct | StateFlowBase::StateFlowTimedSelectHelper |
| Use this class to read from an fd with select and timeout. More... | |
| class | StateFlowWithQueue |
| A state flow that has an incoming message queue, pends on that queue, and runs a flow for every message that comes in from that queue. More... | |
| class | FlowInterface< MessageType > |
| Abstract class for message recipients. More... | |
| class | FlowInterface< MessageType >::GenericHandler |
| class | UntypedStateFlow< QueueType > |
| State flow base class with queue but generic message type. More... | |
| class | TypedStateFlow< MessageType, Base > |
| Helper class in the StateFlow hierarchy. More... | |
| class | StateFlow< MessageType, QueueType > |
| State flow with a given typed input queue. More... | |
Macros | |
| #define | STATE(_fn) |
| Turns a function name into an argument to be supplied to functions expecting a state. | |
| #define | STATE_FLOW_STATE(_state) Action _state() |
| Declare a state callback in a StateFlow. | |
| #define | STATE_FLOW_START(_name, _message, _priorities) |
| Begin the definition of a StateFlow. | |
| #define | STATE_FLOW_START_WITH_TIMER(_name, _priorities) |
| Begin the definition of a StateFlow that includes timeouts. | |
| #define | STATE_FLOW_END() } |
| End the definition of a StateFlow. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Defines a type of state machine flow used within class Service.
Definition in file StateFlow.hxx.
| #define STATE | ( | _fn | ) |
Turns a function name into an argument to be supplied to functions expecting a state.
Usage: Action foo() { ... return wait_and_call(STATE(next_state)); } Action next_state() { ... }
This macro exists to avoid writing a lot of boilerplate to correctly with c++ syntax reference state functions.
| _fn | is the name of a state function on the current class. |
Definition at line 61 of file StateFlow.hxx.
| #define STATE_FLOW_END | ( | ) | } |
End the definition of a StateFlow.
Definition at line 145 of file StateFlow.hxx.
| #define STATE_FLOW_START | ( | _name, | |
| _message, | |||
| _priorities | |||
| ) |
Begin the definition of a StateFlow.
| _name | the class name of the StateFlow derived object |
| _message | is the type of message that this stateflow can receive. |
| _priorities | number of input queue priorities |
Definition at line 75 of file StateFlow.hxx.
| #define STATE_FLOW_START_WITH_TIMER | ( | _name, | |
| _priorities | |||
| ) |
Begin the definition of a StateFlow that includes timeouts.
| _name | the class name of the StateFlow derived object |
| _priorities | number of input queue priorities |
Definition at line 94 of file StateFlow.hxx.
| #define STATE_FLOW_STATE | ( | _state | ) | Action _state() |
Declare a state callback in a StateFlow.
| _state | the method name of the StateFlow state callback |
Definition at line 68 of file StateFlow.hxx.