Class Data

Inheritance Relationships

Base Type

Class Documentation

class Data : public IData<Data, BaseType>

Public Functions

inline Data()
inline virtual ~Data()
inline virtual void ClearData()

ClearData class is called each time a data packet is claimed on the output port.

uint64_t serial_number() const
void set_serial_number(uint64_t n)
void set_source_timestamp()

set_source_timestamp set the timepoint based on the internal Falcon clock.

void set_source_timestamp(TimePoint t)

set_source_timestamp set a given timepoint.

Parameters

t

TimePoint source_timestamp() const

source_timestamp getter for the source_timestamp_. This timestamp is set by the internal Falcon clock.

Returns

TimePoint

template<typename DURATION = std::chrono::microseconds>
inline DURATION time_passed() const

Compute the duration since the timestamp has been set. The default unit is in microseconds but can be changed based on the template.

template<typename DURATION = std::chrono::microseconds>
inline DURATION time_since(TimePoint reference) const

Compute the duration since the given reference. The default unit is in microseconds but can be changed based on the template.

Parameters

reference – selected timepoint

uint64_t hardware_timestamp() const

hardware_timestamp timestamp given by the hardware. The unit depends on the hardware.

Returns

void set_hardware_timestamp(uint64_t t)
void CloneTimestamps(const Data &data)

CloneTimestamps - copy timestamps from one packet to the other.

Parameters

data

virtual void SerializeBinary(std::ostream &stream, Serialization::Format format) const

SerializeBinary - Serialize data specific for the data type in binary form according to the layout described in YAMLDescription. At this level, only serialize the source timestamp, hardware timestamp and serial number.

Parameters
  • stream – binary stream where to add the data

  • format – Compact or Full

virtual void SerializeYAML(YAML::Node &node, Serialization::Format format) const

SerializeYAML - Serialize data specific for the data type in yaml form according to the layout described in YAMLDescription. At this level, only serialize the source timestamp duration, hardware timestamp and serial number.

Parameters
  • node – yaml node where to add the data

  • format – compact or full

virtual void YAMLDescription(YAML::Node &node, Serialization::Format format) const

YAMLDescription - Add the datatype metadata (list of data with type and size) to the header used for yaml and binary serialization.

At this level add the source timestamp duration, hardware timestamp and serial number format description.

Parameters
  • node – - data node where to add a list of data element with the type and the size

  • format – compact or full

virtual void SerializeFlatBuffer(flexbuffers::Builder &flex_builder)

SerializeFlatBuffer - Serialize with a flexbuffer the data specific for each datatype.

At this level add the source timestamp duration, hardware timestamp and serial number format description.

Parameters

flex_builder – flexbuffer builder

Public Static Functions

static inline const std::string static_datatype()

datatype

Returns

name of the datatype

static inline const std::string static_dataname()

dataname

Returns

label for the data

Protected Attributes

TimePoint source_timestamp_
uint64_t hardware_timestamp_
uint64_t serial_number_