Template Class Data

Inheritance Relationships

Base Type

  • public IData< Data< T >, Base< T > >

Class Documentation

template<typename T>
class Data : public IData<Data<T>, Base<T>>

Public Types

typedef stride_iter<T*> column_iterator
typedef T *sample_iterator

Public Functions

inline Data(const std::vector<std::string> &labels, size_t nsamples, double sample_rate)

Data constructor with the label of the columns, the number of samples and the sample rate.

Parameters
  • columns_label – give a label for each column in the data / set also the number of columns in the dataset

  • nsamples – give the number of samples by column

  • sample_rate

inline Data(size_t ncolumns, size_t nsamples, double sample_rate)

Data constructor with only the number of columns, the number of samples and the sample rate.

The label of column is generated from the column number (“0”, “1”…,)

Parameters
  • ncolumns

  • nsamples

  • sample_rate

inline Data(const Parameters &parameters)

Data constructor based on the parameters object.

Parameters

parameters – - contains already the column labels either automatically generated based on the number of columns or set directly.

inline void ClearData() override

ClearData - clear the timestamps and the data (done in the columndatatype::Data)

inline Parameters parameters() const
inline double sample_rate() const
inline uint64_t sample_timestamp(size_t sample = 0) const

sample_timestamp - give the timestamp corresponding to a sample number

Parameters

sample

Returns

one timestamp

inline const std::vector<uint64_t> &sample_timestamps() const

sample_timestamps - give all the timestamps in the packet

Returns

all timestamps

inline std::vector<uint64_t> &sample_timestamps()
inline void set_sample_timestamp(size_t sample, uint64_t t)

set_sample_timestamp - set one timestamp for a given sample number

Parameters
  • sample

  • t

inline void set_sample_timestamps(const std::vector<uint64_t> &t)

set_sample_timestamps - set all timestamps for all sample

Parameters

t

inline void SerializeFlatBuffer(flexbuffers::Builder &flex_builder) override

FlatbufferDescription - This datatype add in the flexbuffer stream the timestamps and the type name.

Note

the columndata is already taking care of adding the data itself.

Parameters

flex_builder

inline void SerializeBinary(std::ostream &stream, Serialization::Format format = Serialization::Format::FULL) const override

SerializeBinary - This datatype add in the binary stream the timestamps.

Note

the columndata is taking care of adding the data in the stream.

Parameters
  • stream

  • format

inline void SerializeYAML(YAML::Node &node, Serialization::Format format = Serialization::Format::FULL) const override

SerializeYAML - This datatype add as a yaml node the timestamps.

Note

the columndata is taking care of adding the data in the upper node.

Parameters
  • node

  • format

inline void YAMLDescription(YAML::Node &node, Serialization::Format format = Serialization::Format::FULL) const override

YAMLDescription - this datatype add to the metadata describing the data format the timestamp format.

Parameters
  • node

  • format

Public Static Functions

static inline const std::string static_datatype()
static inline const std::string static_dataname()

Protected Attributes

double sample_rate_
std::vector<uint64_t> timestamps_