Base class common to all nodes. More...
#include <node.h>
Public Member Functions | |
node (const std::string &name_r) | |
node (node &&node_rr) | |
Move constructor. | |
virtual state::type | state () const |
Returns the node's state. | |
virtual void | started () |
Indicates the node has been started. | |
virtual void | paused () |
Indicates the node has been paused. | |
virtual void | stopped () |
Indicates the node has been stopped. | |
virtual void | operator() ()=0 |
The node's execution function. | |
Public Member Functions inherited from flow::named | |
named (const std::string &name_r) | |
Constructor the takes a name. | |
named (named &&name_rr) | |
Move constructor. | |
named (const named &name_r) | |
Copy constructor. | |
virtual const std::string & | name () const |
A const reference to this object's name. | |
virtual std::string | rename (const std::string &name_r) |
Sets this object's name to a new name. | |
Protected Member Functions | |
virtual void | sever ()=0 |
Disconnect all pins. | |
Protected Attributes | |
std::condition_variable | d_transition_cv |
The condition variable to monitor the node's state. | |
std::mutex | d_transition_m |
The mutex to lock when waiting on d_transition_cv. | |
Friends | |
class | graph |
Base class common to all nodes.
|
inline |
Constructor.
name_r | The name to give this node. |
|
inlinevirtual |
Indicates the node has been started.
Concrete nodes can override this function to be notified of the state transition.
|
inlinevirtual |
Indicates the node has been paused.
Concrete nodes can override this function to be notified of the state transition.
|
inlinevirtual |
Indicates the node has been stopped.
Concrete nodes can override this function to be notified of the state transition.
Reimplemented in flow::samples::generic::ostreamer< T >, and flow::samples::generic::generator< T >.
|
pure virtual |
The node's execution function.
When the node is started, this function is called. It will exit when the node is stopped.
Implemented in flow::transformer< C, P >, flow::transformer< T, T >, flow::consumer< T >, flow::consumer< C >, flow::producer< T >, and flow::producer< P >.