DUDS
Distributed Update of Data from Something
Measurement.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2017 Jeff Jackowski
9  */
10 #include <duds/data/Sample.hpp>
11 
12 namespace duds { namespace data {
13 
23 template <class SVT, class SQT, class TVT, class TQT>
36  TimeSample timestamp;
40  Sample measured;
41  GenericMeasurement() = default;
42  GenericMeasurement(const GenericMeasurement&) = default;
44  GenericMeasurement(const TimeSample &t, const Sample &s) :
45  timestamp(t), measured(s) { }
46  GenericMeasurement(TimeSample &&t, Sample &&s) :
47  timestamp(std::move(t)), measured(std::move(s)) { }
48 };
49 
55 typedef GenericMeasurement<
57  double,
59  float
61 
65 typedef std::shared_ptr<Measurement> MeasurementSptr;
66 
70 typedef std::shared_ptr<const Measurement> ConstMeasurementSptr;
71 
72 template <
73  class VT = GenericValue,
74  class QT = double,
75  class TT = duds::time::interstellar::NanoTime
76 >
80 };
81 
82 } }
boost::variant< std::string, duds::general::LanguageTaggedString, std::array< std::int32_t, 4 >, std::array< std::int64_t, 2 >, duds::data::int128_w, std::array< float, 4 >, std::array< double, 2 >, double, duds::data::Quantity, boost::recursive_wrapper< duds::data::QuantityNddArray >, duds::time::interstellar::Femtoseconds, duds::time::interstellar::Nanoseconds, duds::time::interstellar::FemtoTime, duds::time::interstellar::NanoTime, boost::uuids::uuid, boost::recursive_wrapper< duds::data::GenericValueTable >, std::shared_ptr< std::vector< char > >> GenericValue
A general value of a type can be serialized for transmission over a network and can be used with a re...
CompactSample< VT, QT > measured
Definition: Measurement.hpp:79
TimeSample timestamp
The time when measured was recorded.
Definition: Measurement.hpp:36
GenericSample< TVT, TQT > TimeSample
The type used to store the timestamp.
Definition: Measurement.hpp:32
GenericMeasurement(const TimeSample &t, const Sample &s)
Definition: Measurement.hpp:44
STL namespace.
move_impl move(unsigned int c, unsigned int r)
Display stream manipulator that moves the display cursor to the given location.
Sample measured
A sample from an instrument.
Definition: Measurement.hpp:40
GenericMeasurement< GenericValue, double, duds::time::interstellar::NanoTime, float > Measurement
A measurement type capable of holding a wide range of types for the sample value. ...
Definition: Measurement.hpp:60
CompactSample< TT, float > timestamp
Definition: Measurement.hpp:78
std::shared_ptr< const Measurement > ConstMeasurementSptr
A shared pointer to a const Measurement, a common GenericMeasurement type.
Definition: Measurement.hpp:70
GenericMeasurement(TimeSample &&t, Sample &&s)
Definition: Measurement.hpp:46
Stores a sample of something along with a timestamp stored as a sample from a clock.
Definition: Measurement.hpp:24
std::shared_ptr< Measurement > MeasurementSptr
A shared pointer to a Measurement, a common GenericMeasurement type.
Definition: Measurement.hpp:65
NanoClock::time_point NanoTime
A point in time in Interstellar Time stored in Nanoseconds.
GenericSample< SVT, SQT > Sample
The type used to store a sample from some instrument.
Definition: Measurement.hpp:28