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

Object that represents a node inlet. More...

#include <node.h>

Inheritance diagram for flow::inpin< T >:
Inheritance graph
Collaboration diagram for flow::inpin< T >:
Collaboration graph

Public Member Functions

 inpin (const std::string &name_r, std::condition_variable *transition_cv_p, std::mutex *transition_m_p)
virtual std::string rename (const std::string &name_r)
 Overrides named::rename.
virtual bool peek () const
 Check whether a packet is in the pipe.
virtual std::unique_ptr
< packet< T > > 
pop ()
 Extracts a packet from the pipe.
virtual void incoming ()
 Notifies this pin that a packet has been queued to the pipe.
- Public Member Functions inherited from flow::pin< T >
 pin (const std::string &name_r)
 pin (const pin< T > &o)
- 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.


class consumer< T >

Additional Inherited Members

- Protected Attributes inherited from flow::pin< T >
std::shared_ptr< std::pair
< pipe< T >, std::unique_ptr
< std::mutex > > > 
 Shared ownership of a pipe with the pin to which this pin is connected.

Detailed Description

template<typename T>
class flow::inpin< T >

Object that represents a node inlet.

Nodes that consume packets, i.e. transformers and consumers, have at least one inpin.

Constructor & Destructor Documentation

template<typename T>
flow::inpin< T >::inpin ( const std::string &  name_r,
std::condition_variable *  transition_cv_p,
std::mutex *  transition_m_p 


name_rThe name to give this node.
transition_cv_pPointer to the node's transition condition_variable.
transition_m_pPointer to the node's transition mutex.

Member Function Documentation

template<typename T>
virtual std::string flow::inpin< T >::rename ( const std::string &  name_r)

Overrides named::rename.

Ensures pipe is also renamed.

name_rNew name to give this inpin.

Reimplemented from flow::named.

template<typename T>
virtual bool flow::inpin< T >::peek ( ) const

Check whether a packet is in the pipe.

false if there is no pipe or the pipe is empty, true otherwise.
template<typename T>
virtual std::unique_ptr<packet<T> > flow::inpin< T >::pop ( )

Extracts a packet from the pipe.

The next packet to be consumed if the inpin is connected to a pipe and the pipe is not empty, empty pointer otherwise.
template<typename T>
virtual void flow::inpin< T >::incoming ( )

Notifies this pin that a packet has been queued to the pipe.

When a producing node has moved a packet to the pipe, that node's outpin will call this function on the connected inpin. If this inpin's owning node state is flow::started, it touches the state signal the node there is a packet to be consumed.

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