|
DUDS
|
Distributed Update of Data from Something
|
Queues mesurement signals for later processing. More...
#include <MeasurementSignalQueue.hpp>
Classes | |
| struct | SignalData |
| Stores the information from a new or old measurement signal. More... | |
Public Types | |
| typedef std::list< SignalData > | EventList |
| The list type used to store information from incoming signals. More... | |
| enum | EventType { NewMeasurement, OldMeasurement } |
| typedef GenericInstrument< SVT, SQT, TVT, TQT > | Instrument |
| typedef duds::data::GenericMeasurement< SVT, SQT, TVT, TQT > | Measurement |
Public Types inherited from duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT > | |
| typedef GenericInstrument< SVT, SQT, TVT, TQT > | Instrument |
| typedef duds::data::GenericMeasurement< SVT, SQT, TVT, TQT > | Measurement |
| typedef boost::signals2::signal< void(const std::shared_ptr< Instrument > &, const std::shared_ptr< const Measurement > &) > | MesurementSignal |
| The type used for event listeners that are told of measurments. More... | |
Public Member Functions | |
| GenericMeasurementSignalQueue ()=default | |
| GenericMeasurementSignalQueue (const GenericMeasurementSignalQueue &sq) | |
| GenericMeasurementSignalQueue (GenericMeasurementSignalQueue &&sq) | |
| void | clear () |
| Clear the signal data stored internally. More... | |
| EventList | copy () const |
| Returns a copy of the signal events stored internally. More... | |
| void | copy (EventList ©) const |
| Creates a copy of the ignal events stored internally. More... | |
| EventList | move () |
| Returns a move-constructed list of the signal events stored internally. More... | |
| void | move (EventList ©) |
| Move-assigns to a given list the signal events stored internally. More... | |
| GenericMeasurementSignalQueue & | operator= (const GenericMeasurementSignalQueue &sq) |
| GenericMeasurementSignalQueue & | operator= (GenericMeasurementSignalQueue &&sq) |
| SignalData | popBack () |
| Pop signal data from the end (newest side) of the internal list and return that data. More... | |
| SignalData | popFront () |
| Pop signal data from the front (oldest side) of the internal list and return that data. More... | |
| void | pushBack (const SignalData &sd) |
| Push signal data onto the end (newest side) of the internal list. More... | |
| void | pushFront (const SignalData &sd) |
| Push signal data onto the front (oldest side) of the internal list. More... | |
| void | swap (GenericMeasurementSignalQueue &sq) |
| Swaps the internal signal data list with another GenericMeasurementSignalQueue object. More... | |
Public Member Functions inherited from duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT > | |
| virtual | ~GenericMeasurementSignalSink () |
| Disconnects from all signals. More... | |
| bool | disconnectAll (const InstrumentSptr &inst) |
| Disconnects the group from both the new and old measurement signals from the given instrument. More... | |
| void | disconnectAll () |
| Disconnects the group from all signals. More... | |
| bool | disconnectNewMeasurement (const InstrumentSptr &inst) |
| Disconnects from the new measurement signal of the given instrument. More... | |
| bool | disconnectOldMeasurement (const InstrumentSptr &inst) |
| Disconnects from the old measurement signal of the given instrument. More... | |
| boost::signals2::connection | newMeasurementSource (const InstrumentSptr &inst, boost::signals2::connect_position at=boost::signals2::at_back) |
| Connect this object to the new measurement signal of the given instrument, or return the existing connection. More... | |
| boost::signals2::connection | newMeasurementSource (const typename MesurementSignal::group_type &group, const Instrument &inst, boost::signals2::connect_position at=boost::signals2::at_back) |
| boost::signals2::connection | oldMeasurementSource (const InstrumentSptr &inst, boost::signals2::connect_position at=boost::signals2::at_back) |
| boost::signals2::connection | oldMeasurementSource (const typename MesurementSignal::group_type &group, const Instrument &inst, boost::signals2::connect_position at=boost::signals2::at_back) |
| void | purgeDisconnections () |
| Removes any disconnected connection objects held by this object. More... | |
Protected Member Functions | |
| void | handleNewMeasure (const std::shared_ptr< Instrument > &i, const std::shared_ptr< const Measurement > &m) |
| Receives a new measurement signal and queues its information. More... | |
| void | handleOldMeasure (const std::shared_ptr< Instrument > &i, const std::shared_ptr< const Measurement > &m) |
| Receives an old measurement signal and queues its information. More... | |
Private Attributes | |
| duds::general::Spinlock | block |
| Used to allow only one thread access to events. More... | |
| EventList | events |
| Storage of signal data. More... | |
Additional Inherited Members | |
Protected Types inherited from duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT > | |
| typedef std::map< Instrument *, MeasurementConnections > | ConnectionMap |
| Reduce typing and limit line length; no other reason. More... | |
| typedef ConnectionMap | ConnectionMapIterator |
Protected Attributes inherited from duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT > | |
| ConnectionMap | conns |
| Stores connections keyed by Instrument pointer. More... | |
Queues mesurement signals for later processing.
The queue is thread-safe to allow queueing and dequeueing from multiple threads. It can be used to store signals from many threads and later process the signals on one thread. The advantages of such a setup are less thread synchronization and avoiding taking up time on the thread that sent the signal. The disadvantage is a greater latency to responding to the signal when ignoring the time taken to handle a signal.
| SVT | Sample value type |
| SQT | Sample quality type |
| TVT | Time value type |
| TQT | Time quality type |
| IS | The Instrument storage type. Should be either std::shared_ptr or std::weak_ptr. This will affect the lifespan of the Instrument objects. |
| ISArgs | Additional template parameters to IS other than the data type being stored. In most cases, this can be ommitted. |
Definition at line 48 of file MeasurementSignalQueue.hpp.
| typedef std::list<SignalData> duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::EventList |
The list type used to store information from incoming signals.
Definition at line 84 of file MeasurementSignalQueue.hpp.
| typedef GenericInstrument<SVT, SQT, TVT, TQT> duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::Instrument |
Definition at line 52 of file MeasurementSignalQueue.hpp.
| typedef duds::data::GenericMeasurement<SVT, SQT, TVT, TQT> duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::Measurement |
Definition at line 53 of file MeasurementSignalQueue.hpp.
| enum duds::hardware::GenericMeasurementSignalQueue::EventType |
| Enumerator | |
|---|---|
| NewMeasurement | |
| OldMeasurement | |
Definition at line 54 of file MeasurementSignalQueue.hpp.
|
default |
|
inline |
Definition at line 118 of file MeasurementSignalQueue.hpp.
|
inline |
Definition at line 122 of file MeasurementSignalQueue.hpp.
|
inline |
Clear the signal data stored internally.
Definition at line 236 of file MeasurementSignalQueue.hpp.
|
inline |
Returns a copy of the signal events stored internally.
Definition at line 155 of file MeasurementSignalQueue.hpp.
Referenced by duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::move().
|
inline |
Creates a copy of the ignal events stored internally.
| copy | The list that will hold a copy of the internal list. |
Definition at line 167 of file MeasurementSignalQueue.hpp.
|
inlineprotectedvirtual |
Receives a new measurement signal and queues its information.
Implements duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT >.
Definition at line 99 of file MeasurementSignalQueue.hpp.
|
inlineprotectedvirtual |
Receives an old measurement signal and queues its information.
Implements duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT >.
Definition at line 109 of file MeasurementSignalQueue.hpp.
|
inline |
Returns a move-constructed list of the signal events stored internally.
Definition at line 175 of file MeasurementSignalQueue.hpp.
|
inline |
Move-assigns to a given list the signal events stored internally.
Definition at line 187 of file MeasurementSignalQueue.hpp.
|
inline |
Definition at line 126 of file MeasurementSignalQueue.hpp.
|
inline |
Definition at line 134 of file MeasurementSignalQueue.hpp.
|
inline |
Pop signal data from the end (newest side) of the internal list and return that data.
Definition at line 211 of file MeasurementSignalQueue.hpp.
|
inline |
Pop signal data from the front (oldest side) of the internal list and return that data.
Definition at line 224 of file MeasurementSignalQueue.hpp.
|
inline |
Push signal data onto the end (newest side) of the internal list.
| sd | The information to push. |
Definition at line 195 of file MeasurementSignalQueue.hpp.
|
inline |
Push signal data onto the front (oldest side) of the internal list.
| sd | The information to push. |
Definition at line 203 of file MeasurementSignalQueue.hpp.
|
inline |
Swaps the internal signal data list with another GenericMeasurementSignalQueue object.
Definition at line 146 of file MeasurementSignalQueue.hpp.
Referenced by duds::hardware::swap().
|
mutableprivate |
Used to allow only one thread access to events.
The accesses are likely quick in most cases, so a spinlock is used instead of a mutex.
Definition at line 94 of file MeasurementSignalQueue.hpp.
Referenced by duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::GenericMeasurementSignalQueue(), duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::operator=(), and duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::swap().
|
private |
Storage of signal data.
Definition at line 89 of file MeasurementSignalQueue.hpp.
Referenced by duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::copy(), duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::GenericMeasurementSignalQueue(), duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::operator=(), and duds::hardware::GenericMeasurementSignalQueue< SVT, SQT, TVT, TQT, IS, ISArgs >::swap().