DUDS
Distributed Update of Data from Something
duds::data::GenericSample< VT, QT > Struct Template Reference

A template for a sample from an insturment. More...

#include <Sample.hpp>

Public Types

typedef QT Quality
 
typedef VT Value
 

Public Member Functions

void clear ()
 Initializes the sample to hold no data. More...
 
bool isClear () const
 Returns true when this object contains no sample data. More...
 
CompactSample< VT, QT > makeCompactSample () const
 Produce a CompactSample using the data in this Sample. More...
 
 operator CompactSample< VT, QT > () const
 Produce a CompactSample using the data in this Sample. More...
 

Static Public Member Functions

static constexpr QT unspecified ()
 Returns the value used to represent an unspecified or unknown accuracy, precision, resolution, or error. More...
 

Public Attributes

QT accuracy
 The expected accuracy of the instrument under the conditions in which the sample was taken. More...
 
QT estError
 The estimated error of the observation. More...
 
boost::uuids::uuid origin
 The UUID for the source instrument of this sample. More...
 
QT precision
 The expected precision of the instrument under the conditions in which the sample was taken. More...
 
QT resolution
 The expected resolution of the instrument under the conditions in which the sample was taken. More...
 
VT value
 The value sampled from the insturment. More...
 

Detailed Description

template<class VT, class QT>
struct duds::data::GenericSample< VT, QT >

A template for a sample from an insturment.

Template Parameters
VTThe type used to store the value meausred by the insturment. In most cases, this should be either GenericValue for flexibility, or double for less memory usage. In the case of a time stamp rather than an interval, the value should be an integer to avoid loss of resolution the further the time is from time zero. GenericValue includes time types.
QTThe type used to store quality information about the sampled value. In the case of a time stamp, a double or float could be used. Units are be the same as in VT, unless VT is one of the duds::time::interstellar time types and QT is a floating point type, in which case the units are seconds. Unsigned intergers must not be used.
Author
Jeff Jackowski
Todo:
Should the unit field be for the quality fields, or should the quality fields be changed to Quantity objects?

Definition at line 81 of file Sample.hpp.

Member Typedef Documentation

◆ Quality

template<class VT, class QT>
typedef QT duds::data::GenericSample< VT, QT >::Quality

Definition at line 83 of file Sample.hpp.

◆ Value

template<class VT, class QT>
typedef VT duds::data::GenericSample< VT, QT >::Value

Definition at line 82 of file Sample.hpp.

Member Function Documentation

◆ clear()

template<class VT, class QT>
void duds::data::GenericSample< VT, QT >::clear ( )
inline

Initializes the sample to hold no data.

Postcondition
isClear() will return true.

Definition at line 143 of file Sample.hpp.

◆ isClear()

template<class VT, class QT>
bool duds::data::GenericSample< VT, QT >::isClear ( ) const
inline

Returns true when this object contains no sample data.

Not called isEmpty() because all fields will contain data, and it suggests the result will be true after calling clear().

Todo:
Reconsider the checked condition.

Definition at line 154 of file Sample.hpp.

◆ makeCompactSample()

template<class VT , class QT >
CompactSample< VT, QT > duds::data::GenericSample< VT, QT >::makeCompactSample ( ) const

Produce a CompactSample using the data in this Sample.

Definition at line 284 of file Sample.hpp.

◆ operator CompactSample< VT, QT >()

template<class VT, class QT>
duds::data::GenericSample< VT, QT >::operator CompactSample< VT, QT > ( ) const
inline

Produce a CompactSample using the data in this Sample.

Definition at line 136 of file Sample.hpp.

◆ unspecified()

template<class VT, class QT>
static constexpr QT duds::data::GenericSample< VT, QT >::unspecified ( )
inlinestatic

Returns the value used to represent an unspecified or unknown accuracy, precision, resolution, or error.

Definition at line 88 of file Sample.hpp.

Member Data Documentation

◆ accuracy

template<class VT, class QT>
QT duds::data::GenericSample< VT, QT >::accuracy

The expected accuracy of the instrument under the conditions in which the sample was taken.

This is how far from correct the value could be.

Definition at line 107 of file Sample.hpp.

Referenced by duds::hardware::devices::clocks::GenericCppClock< CLK, SVT, SQT, TVT, TQT >::sampleTime().

◆ estError

template<class VT, class QT>
QT duds::data::GenericSample< VT, QT >::estError

The estimated error of the observation.

This is primarily to support the estimated error field reported by adjtimex() on Linux, but may have application elsewhere.

Definition at line 120 of file Sample.hpp.

Referenced by duds::hardware::devices::clocks::GenericCppClock< CLK, SVT, SQT, TVT, TQT >::sampleTime().

◆ origin

template<class VT, class QT>
boost::uuids::uuid duds::data::GenericSample< VT, QT >::origin

The UUID for the source instrument of this sample.

If this is nil (all zero), the Sample will be considered clear of data by isClear().

Definition at line 96 of file Sample.hpp.

◆ precision

template<class VT, class QT>
QT duds::data::GenericSample< VT, QT >::precision

The expected precision of the instrument under the conditions in which the sample was taken.

This is how much the sample value may vary when the measured property is the same; think of it as consistency or repeatability.

Definition at line 114 of file Sample.hpp.

Referenced by duds::hardware::devices::clocks::GenericCppClock< CLK, SVT, SQT, TVT, TQT >::sampleTime().

◆ resolution

template<class VT, class QT>
QT duds::data::GenericSample< VT, QT >::resolution

The expected resolution of the instrument under the conditions in which the sample was taken.

This is the smallest increment the insturment can represent. Since the Sample object may store the value in different units than the instrument reports, this value is not determined by the types used in the Sample object.

Definition at line 128 of file Sample.hpp.

Referenced by duds::hardware::devices::clocks::GenericCppClock< CLK, SVT, SQT, TVT, TQT >::sampleTime().

◆ value

template<class VT, class QT>
VT duds::data::GenericSample< VT, QT >::value

The value sampled from the insturment.

This should normally be a Quantity type, or a GenericValue storing a Quantity object.

Definition at line 102 of file Sample.hpp.

Referenced by duds::hardware::devices::clocks::GenericCppClock< CLK, SVT, SQT, TVT, TQT >::sampleTime().


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