|
DUDS
|
Distributed Update of Data from Something
|
Represents something with one or more sensors that are sampled through the same hardware. More...
#include <Device.hpp>
Classes | |
| class | DestructCounter |
| Used to assure the destructor function does not return before Sensor objects quit using member functions on this object on other threads. More... | |
Public Types | |
| typedef clocks::GenericClock< SVT, SQT, TVT, TQT > | Clock |
| The clock driver type used by the instruments of this device for time stamps. More... | |
| typedef std::shared_ptr< Clock > | ClockSptr |
| A shared pointer type to the clock type used by this device. More... | |
| typedef std::shared_ptr< const Measurement > | ConstMeasurementSptr |
| A shared pointer type to the const measurement type used by this device. More... | |
| typedef std::shared_ptr< const Sensor > | ConstSensorSptr |
| A shared pointer type to the const sensor type used by this device. More... | |
| typedef duds::data::GenericMeasurement< SVT, SQT, TVT, TQT > | Measurement |
| The measurement type provided by the instruments of this device. More... | |
| typedef std::shared_ptr< Measurement > | MeasurementSptr |
| A shared pointer type to the measurement type used by this device. More... | |
| typedef GenericSensor< SVT, SQT, TVT, TQT > | Sensor |
| The sensor type used by this device. More... | |
| typedef std::shared_ptr< Sensor > | SensorSptr |
| A shared pointer type to the sensor type used by this device. More... | |
| typedef std::weak_ptr< Sensor > | SensorWptr |
| A weak pointer type to the sensor type used by this device. More... | |
Public Member Functions | |
| ~GenericDevice () | |
| Modifies member Sensor objects so they no longer have a pointer back to this object, and waits for calls those objects may be making to sharedPtr() to complete. More... | |
| ConstMeasurementSptr | currentMeasurement (unsigned int sIdx=0) const |
| Returns the measurement object for the sensor at the given device specific index. More... | |
| unsigned int | numSensors () const |
| Returns the number of sensors provided by this device. More... | |
| virtual void | sample ()=0 |
| Samples the device and updates its sensor objects, but does not provide timestamps in the sensors' measurement objects. More... | |
| virtual void | sample (const ClockSptr &clock)=0 |
| Samples the device and updates its sensor objects, and provides a timestamp from the given clock device. More... | |
| const SensorSptr & | sensor (unsigned int sIdx=0) const |
| Returns the sensor object at the given device specific index. More... | |
| std::shared_ptr< GenericDevice< SVT, SQT, TVT, TQT > > | sharedPtr () |
| Returns a shared pointer to this device object; will be empty if this object's destructor is running. More... | |
Public Member Functions inherited from duds::Something | |
| virtual | ~Something ()=0 |
| std::string | getName () const |
| Returns the name for the current locale. More... | |
| const general::LanguageTaggedStringMap & | names () const |
| Returns the set of names for all locales and languages. More... | |
| bool | operator!= (const Something &s) const |
| Something objects are compared using the someId member. More... | |
| bool | operator< (const Something &s) const |
| Something objects are compared using the someId member. More... | |
| bool | operator<= (const Something &s) const |
| Something objects are compared using the someId member. More... | |
| bool | operator== (const Something &s) const |
| Something objects are compared using the someId member. More... | |
| bool | operator> (const Something &s) const |
| Something objects are compared using the someId member. More... | |
| bool | operator>= (const Something &s) const |
| Something objects are compared using the someId member. More... | |
| template<class DerivedClass > | |
| std::shared_ptr< DerivedClass > | sharedPtr () const |
| Returns a shared pointer to this object for a derived class. More... | |
| const boost::uuids::uuid & | uuid () const |
| Returns the object's unique identifier. More... | |
Protected Member Functions | |
| GenericDevice ()=default | |
| Derived classes should create Sensor objects and place them in sens either in the constructor or an initialization function. More... | |
| GenericDevice (const boost::uuids::uuid &id) | |
| Derived classes should create Sensor objects and place them in sens either in the constructor or an initialization function. More... | |
| void | setMeasurement (const ConstMeasurementSptr &store, int sIdx=0) const |
| Updates the current measurement of a member sensor. More... | |
| void | setMeasurement (ConstMeasurementSptr &&store, int sIdx=0) const |
| Updates the current measurement of a member sensor. More... | |
Protected Member Functions inherited from duds::Something | |
| Something ()=default | |
| Simple constructor. More... | |
| Something (const boost::uuids::uuid &id) | |
| Creates Something with the given UUID. More... | |
| void | setUuid (const boost::uuids::uuid &id) |
| Sets the UUID that is associated with this object. More... | |
Protected Attributes | |
| std::vector< SensorSptr > | sens |
| Contains Sensor objects to represent all the kinds of data this device can collect. More... | |
Protected Attributes inherited from duds::Something | |
| general::LanguageTaggedStringMap | ltnames |
| A name for this item intended for user presentation. More... | |
Private Attributes | |
| std::atomic< unsigned int > | destructWait = 0 |
| Used to assure the destructor function does not return before Sensor objects quit using member functions on this object on other threads. More... | |
Represents something with one or more sensors that are sampled through the same hardware.
This is intended to support sampling sensors and finding sensors.
| SVT | Sample value type |
| SQT | Sample quality type |
| TVT | Time value type |
| TQT | Time quality type |
Definition at line 34 of file Device.hpp.
| typedef clocks::GenericClock<SVT, SQT, TVT, TQT> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::Clock |
The clock driver type used by the instruments of this device for time stamps.
Definition at line 88 of file Device.hpp.
| typedef std::shared_ptr<Clock> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::ClockSptr |
A shared pointer type to the clock type used by this device.
Definition at line 92 of file Device.hpp.
| typedef std::shared_ptr<const Measurement> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::ConstMeasurementSptr |
A shared pointer type to the const measurement type used by this device.
Definition at line 83 of file Device.hpp.
| typedef std::shared_ptr<const Sensor> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::ConstSensorSptr |
A shared pointer type to the const sensor type used by this device.
Definition at line 67 of file Device.hpp.
| typedef duds::data::GenericMeasurement<SVT, SQT, TVT, TQT> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::Measurement |
The measurement type provided by the instruments of this device.
Definition at line 75 of file Device.hpp.
| typedef std::shared_ptr<Measurement> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::MeasurementSptr |
A shared pointer type to the measurement type used by this device.
Definition at line 79 of file Device.hpp.
| typedef GenericSensor<SVT, SQT, TVT, TQT> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::Sensor |
The sensor type used by this device.
Definition at line 59 of file Device.hpp.
| typedef std::shared_ptr<Sensor> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::SensorSptr |
A shared pointer type to the sensor type used by this device.
Definition at line 63 of file Device.hpp.
| typedef std::weak_ptr<Sensor> duds::hardware::devices::GenericDevice< SVT, SQT, TVT, TQT >::SensorWptr |
A weak pointer type to the sensor type used by this device.
Definition at line 71 of file Device.hpp.
|
protecteddefault |
Derived classes should create Sensor objects and place them in sens either in the constructor or an initialization function.
|
inlineprotected |
Derived classes should create Sensor objects and place them in sens either in the constructor or an initialization function.
| id | The UUID for this device. |
Definition at line 126 of file Device.hpp.
|
inline |
Modifies member Sensor objects so they no longer have a pointer back to this object, and waits for calls those objects may be making to sharedPtr() to complete.
Definition at line 133 of file Device.hpp.
|
inline |
Returns the measurement object for the sensor at the given device specific index.
| sIdx | The sensor index. |
Definition at line 193 of file Device.hpp.
|
inline |
Returns the number of sensors provided by this device.
Definition at line 173 of file Device.hpp.
|
pure virtual |
Samples the device and updates its sensor objects, but does not provide timestamps in the sensors' measurement objects.
Implemented in duds::hardware::devices::clocks::GenericClock< SVT, SQT, TVT, TQT >, duds::hardware::devices::clocks::GenericPosixClock< SVT, SQT, TVT, TQT >, duds::hardware::devices::clocks::GenericLinuxClock< SVT, SQT, TVT, TQT >, and duds::hardware::devices::clocks::GenericCppClock< CLK, SVT, SQT, TVT, TQT >.
|
pure virtual |
Samples the device and updates its sensor objects, and provides a timestamp from the given clock device.
| clock | The clock that will provide a timestamp for the measurements taken by this device. |
|
inline |
Returns the sensor object at the given device specific index.
The retuned object may outlive this device.
| sIdx | The sensor index. |
Definition at line 182 of file Device.hpp.
|
inlineprotected |
Updates the current measurement of a member sensor.
| store | The new measurement object. |
| sIdx | The index of the sensor to update. |
Definition at line 105 of file Device.hpp.
Referenced by duds::hardware::devices::clocks::GenericCppClock< CLK, SVT, SQT, TVT, TQT >::sample(), and duds::hardware::devices::clocks::GenericLinuxClock< SVT, SQT, TVT, TQT >::sample().
|
inlineprotected |
Updates the current measurement of a member sensor.
| store | The new measurement object. |
| sIdx | The index of the sensor to update. |
Definition at line 113 of file Device.hpp.
|
inline |
Returns a shared pointer to this device object; will be empty if this object's destructor is running.
Definition at line 147 of file Device.hpp.
Referenced by duds::hardware::devices::GenericSensor< SVT, SQT, TVT, TQT >::device().
|
private |
Used to assure the destructor function does not return before Sensor objects quit using member functions on this object on other threads.
Definition at line 39 of file Device.hpp.
|
protected |
Contains Sensor objects to represent all the kinds of data this device can collect.
Each sensor must be placed in the vector at the index equal to Sensor::index().
Definition at line 99 of file Device.hpp.
Referenced by duds::hardware::devices::clocks::GenericLinuxClock< SVT, SQT, TVT, TQT >::setSample().