flow  3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
flow::samples::math::adder< T > Class Template Reference

Concrete transformer that uses operator+= to sum input packets. More...

#include <math.h>

Inheritance diagram for flow::samples::math::adder< T >:
Inheritance graph
[legend]
Collaboration diagram for flow::samples::math::adder< T >:
Collaboration graph
[legend]

Public Member Functions

 adder (size_t ins=2, const std::string &name_r="adder")
 Default constructor with two inputs.
 
virtual void ready (size_t n)
 Implementation of consumer::ready().
 
- Public Member Functions inherited from flow::transformer< T, T >
 transformer (const std::string &name_r, const size_t ins, const size_t outs)
 
virtual std::string rename (const std::string &name_r)
 Overrides named::rename.
 
- Public Member Functions inherited from flow::consumer< T >
 consumer (const std::string &name_r, const size_t ins)
 
virtual size_t ins () const
 Returns the number of input pins.
 
virtual inpin< T > & input (const size_t n)
 Returns a reference to an input pin.
 
virtual const inpin< T > & input (const size_t n) const
 Returns a const reference to an input pin.
 
virtual inputs_t & inputs ()
 Returns a reference to the container of input pins.
 
virtual const inputs_t & inputs () const
 Returns a const reference to the container of input pins.
 
- Public Member Functions inherited from flow::node
 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.
 
- 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.
 
- Public Member Functions inherited from flow::producer< T >
 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.
 

Additional Inherited Members

- Protected Member Functions inherited from flow::transformer< T, T >
virtual void sever ()
 Disconnect all pins.
 
virtual void operator() ()
 Implementation of node::operator()().
 
- Protected Attributes inherited from flow::node
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.
 

Detailed Description

template<typename T>
class flow::samples::math::adder< T >

Concrete transformer that uses operator+= to sum input packets.

Constructor & Destructor Documentation

template<typename T >
flow::samples::math::adder< T >::adder ( size_t  ins = 2,
const std::string &  name_r = "adder< T >" 
)
inline

Default constructor with two inputs.

Parameters
insThe number of inputs.
name_rThe name to give this node.

Member Function Documentation

template<typename T >
virtual void flow::samples::math::adder< T >::ready ( size_t  n)
inlinevirtual

Implementation of consumer::ready().

When at least one packet is ready at each inputs, one packet from each input is popped. They are then all summed and the sum is moved to the output.

Implements flow::transformer< T, T >.


The documentation for this class was generated from the following file: