Falcon
Loading...
Searching...
No Matches

Public Types

typedef stride_iter< T * > column_iterator
typedef T * sample_iterator
Public Types inherited from IData< Data< T >, Base< T > >
using Base

Public Member Functions

 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.
 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.
 Data (const Parameters &parameters)
 Data constructor based on the parameters object.
void ClearData () override
 ClearData - clear the timestamps and the data (done in the columndatatype::Data).
Parameters parameters () const
double sample_rate () const
uint64_t sample_timestamp (size_t sample=0) const
 sample_timestamp - give the timestamp corresponding to a sample number
const std::vector< uint64_t > & sample_timestamps () const
 sample_timestamps - give all the timestamps in the packet
std::vector< uint64_t > & sample_timestamps ()
void set_sample_timestamp (size_t sample, uint64_t t)
 set_sample_timestamp - set one timestamp for a given sample number
void set_sample_timestamps (const std::vector< uint64_t > &t)
 set_sample_timestamps - set all timestamps for all sample
void SerializeFlatBuffer (flexbuffers::Builder &flex_builder) override
 FlatbufferDescription - This datatype add in the flexbuffer stream the timestamps and the type name.
void SerializeBinary (std::ostream &stream, Serialization::Format format=Serialization::Format::FULL) const override
 SerializeBinary - This datatype add in the binary stream the timestamps.
std::string_view serialized_type_name () const override
void SerializeYAML (YAML::Node &node, Serialization::Format format=Serialization::Format::FULL) const override
 SerializeYAML - This datatype add as a yaml node the timestamps.
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.
Public Member Functions inherited from IData< Data< T >, Base< T > >
virtual std::string datatype () const
virtual std::string dataname () const

Static Public Member Functions

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

Protected Attributes

double sample_rate_
std::vector< uint64_t > timestamps_

Constructor & Destructor Documentation

◆ Data() [1/3]

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

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

Parameters
columns_labelgive a label for each column in the data / set also the number of columns in the dataset
nsamplesgive the number of samples by column
sample_rate

◆ Data() [2/3]

template<typename T>
nsTimeSeries::Data< T >::Data ( size_t ncolumns,
size_t nsamples,
double sample_rate )
inline

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

◆ Data() [3/3]

template<typename T>
nsTimeSeries::Data< T >::Data ( const Parameters & parameters)
inline

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.

Member Function Documentation

◆ sample_timestamp()

template<typename T>
uint64_t nsTimeSeries::Data< T >::sample_timestamp ( size_t sample = 0) const
inline

sample_timestamp - give the timestamp corresponding to a sample number

Parameters
sample
Returns
one timestamp

◆ sample_timestamps()

template<typename T>
const std::vector< uint64_t > & nsTimeSeries::Data< T >::sample_timestamps ( ) const
inline

sample_timestamps - give all the timestamps in the packet

Returns
all timestamps

◆ SerializeBinary()

template<typename T>
void nsTimeSeries::Data< T >::SerializeBinary ( std::ostream & stream,
Serialization::Format format = Serialization::Format::FULL ) const
inlineoverride

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

◆ SerializeFlatBuffer()

template<typename T>
void nsTimeSeries::Data< T >::SerializeFlatBuffer ( flexbuffers::Builder & flex_builder)
inlineoverride

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

◆ SerializeYAML()

template<typename T>
void nsTimeSeries::Data< T >::SerializeYAML ( YAML::Node & node,
Serialization::Format format = Serialization::Format::FULL ) const
inlineoverride

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

◆ set_sample_timestamp()

template<typename T>
void nsTimeSeries::Data< T >::set_sample_timestamp ( size_t sample,
uint64_t t )
inline

set_sample_timestamp - set one timestamp for a given sample number

Parameters
sample
t

◆ set_sample_timestamps()

template<typename T>
void nsTimeSeries::Data< T >::set_sample_timestamps ( const std::vector< uint64_t > & t)
inline

set_sample_timestamps - set all timestamps for all sample

Parameters
t

◆ YAMLDescription()

template<typename T>
void nsTimeSeries::Data< T >::YAMLDescription ( YAML::Node & node,
Serialization::Format format = Serialization::Format::FULL ) const
inlineoverride

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

Parameters
node
format

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