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

Object that carries data from node to node through a pipe. More...

#include <packet.h>

Public Types

typedef
std::chrono::time_point
< std::chrono::high_resolution_clock > 
time_point_type
 Convenience typedef for time_point type used.
 

Public Member Functions

 packet (T data, const time_point_type &consumption_time=time_point_type())
 Constructor.
 
virtual size_t size () const
 Returns the number of bytes in this packet.
 
virtual T & data ()
 Reference to the data this packet is carrying.
 
virtual const T & data () const
 Reference to the data this packet is carrying.
 
virtual time_point_typeconsumption_time ()
 Reference to the time of consumption.
 

Detailed Description

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

Object that carries data from node to node through a pipe.

Associated with a packet is an optional time of consumption. A consumer node ought to wait before consuming the data in this packet if it arrives to the node early. If the packet arrives too late, the consumer node ought to discard it.

Constructor & Destructor Documentation

template<typename T >
flow::packet< T >::packet ( data,
const time_point_type consumption_time = time_point_type() 
)
inline

Constructor.

Parameters
dataData to be put in the packet.
consumption_timeThe time at which a consumer node should consume the data. Optional.

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