Base class from which concrete pure producers derive.
More...
#include <node.h>
|
| producer (const std::string &name_r, const size_t outs) |
|
virtual size_t | outs () const |
| Returns the number of output pins.
|
|
virtual outpin< T > & | output (const size_t n) |
| Returns a reference to an outpin pin.
|
|
virtual const outpin< T > & | output (const size_t n) const |
| Returns a const reference to an outpin pin.
|
|
virtual outputs_t & | outputs () |
| Returns a reference to the container of output pins.
|
|
virtual const outputs_t & | outputs () const |
| Returns a const reference to the container of output pins.
|
|
virtual std::string | rename (const std::string &name_r) |
| Overrides named::rename.
|
|
virtual void | produce ()=0 |
| Producing function.
|
|
| 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.
|
|
| 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 void | connect (size_t p_pin, consumer< T > *consumer_p, size_t c_pin, const size_t max_length=0, const size_t max_weight=0) |
| Connect this producer to a consumer.
|
|
virtual void | disconnect (size_t pin) |
| Disconnect an outpin of this producer.
|
|
virtual void | sever () |
| Disconnect all pins.
|
|
virtual void | operator() () |
| The node's execution function.
|
|
|
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.
|
|
template<typename T>
class flow::producer< T >
Base class from which concrete pure producers derive.
Concrete transformers should derive from flow::transformer.
- Template Parameters
-
T | The type of data this node produces. |
- Parameters
-
name_r | The name to give this node. |
outs | Numbers of output pins. |
template<typename T>
virtual void flow::producer< T >::connect |
( |
size_t |
p_pin, |
|
|
consumer< T > * |
consumer_p, |
|
|
size_t |
c_pin, |
|
|
const size_t |
max_length = 0 , |
|
|
const size_t |
max_weight = 0 |
|
) |
| |
|
inlineprotectedvirtual |
Connect this producer to a consumer.
- Parameters
-
p_pin | The index of this node's output pin. |
consumer_p | Pointer to the consumer node to conenct to. |
c_pin | The index of the consumer node's input pin. |
max_length | The maximum length to give the pipe. Do not set or set to 0 for uncapped length. |
max_weight | The maximum weight to give the pipe. Do not set or set to 0 for uncapped weight. |
Disconnect an outpin of this producer.
- Parameters
-
pin | Index of the pin to disconnect. |
Returns a reference to an outpin pin.
- Parameters
-
n | The index of the output pin. |
Returns a const reference to an outpin pin.
- Parameters
-
n | The index of the output pin. |
template<typename T>
virtual std::string flow::producer< T >::rename |
( |
const std::string & |
name_r | ) |
|
|
inlinevirtual |
Producing function.
This function is called from the operator()() execution function. It is the function that the concrete classes of producing nodes implement. The body of this function should push packets on its outpins.
Implemented in flow::samples::generic::generator< T >.
The documentation for this class was generated from the following file: