|
Hedgehog
0.0.0
A library to generate hybrid pipeline workflow systems
|
State Interface for managing computation, need a corresponding AbstractStateManager to be embedded in a Hedgehog Graph. More...
#include "abstract_state.h"


Public Member Functions | |
| AbstractState () | |
| Default constructor, initialize the mutex (AbstractState::stateMutex_) and the ready list (AbstractState::readyList_) | |
| virtual | ~AbstractState ()=default |
| Default destructor. | |
| std::unique_ptr< std::queue< std::shared_ptr< StateOutput > > > const & | readyList () const |
| Ready list accessor. More... | |
| void | push (std::shared_ptr< StateOutput > const &elem) |
| Add an element to the ready list. More... | |
| std::shared_ptr< StateOutput > | frontAndPop () |
| Used by AbstractStateManager to get the ready list's front element. More... | |
| void | lock () |
| Lock the state. | |
| void | unlock () |
| Unlock the state. | |
Public Member Functions inherited from hh::behavior::Execute< StateInputs > | |
| virtual void | execute (std::shared_ptr< StateInputs >)=0 |
| Virtual declaration of execute function for a data of type Input. | |
Private Attributes | |
| std::unique_ptr< std::shared_mutex > | stateMutex_ = nullptr |
| State Mutex. | |
| std::unique_ptr< std::queue< std::shared_ptr< StateOutput > > > | readyList_ = nullptr |
| State Ready list. | |
State Interface for managing computation, need a corresponding AbstractStateManager to be embedded in a Hedgehog Graph.
An AbstractState is a tool used by Hedgehog when data synchronization is needed. When overloaded, data structures that are added to the class can manage the state of computation. AbstractState owns a mutex to guarantee safety, because it can be shared among multiple AbstractStateManager.
The default order of execution is:
| StateOutput | State output type |
| StateInputs | State input types |
Definition at line 58 of file abstract_state.h.
|
inline |
Used by AbstractStateManager to get the ready list's front element.
Definition at line 86 of file abstract_state.h.
|
inline |
Add an element to the ready list.
| elem | Element to add |
Definition at line 82 of file abstract_state.h.
|
inline |