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_type & | consumption_time () |
Reference to the time of consumption. | |
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.
|
inline |
Constructor.
data | Data to be put in the packet. |
consumption_time | The time at which a consumer node should consume the data. Optional. |