DUDS
Distributed Update of Data from Something
duds::hardware::GenericMeasurementSignalGroup< SVT, SQT, TVT, TQT > Class Template Reference

Distributes measurement signals from one or more instruments to one or more listeners. More...

#include <MeasurementSignalGroup.hpp>

Inheritance diagram for duds::hardware::GenericMeasurementSignalGroup< SVT, SQT, TVT, TQT >:
Collaboration diagram for duds::hardware::GenericMeasurementSignalGroup< SVT, SQT, TVT, TQT >:

Public Member Functions

virtual ~GenericMeasurementSignalGroup ()=default
 Disconnects from all signals. More...
 
- Public Member Functions inherited from duds::hardware::GenericMeasurementSignalSource< SVT, SQT, TVT, TQT >
boost::signals2::connection newMeasurementConnect (const typename MesurementSignal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to receive signals for new measurements. More...
 
boost::signals2::connection newMeasurementConnect (const typename MesurementSignal::group_type &group, const typename MesurementSignal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to receive signals for new measurements. More...
 
boost::signals2::connection newMeasurementConnectExtended (const typename MesurementSignal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to receive signals for new measurements. More...
 
boost::signals2::connection newMeasurementConnectExtended (const typename MesurementSignal::group_type &group, const typename MesurementSignal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to receive signals for new measurements. More...
 
void newMeasurementDisconnect (const typename MesurementSignal::group_type &group)
 Disconnect from the new measurement signal. More...
 
template<typename S >
void newMeasurementDisconnect (const S &slotFunc)
 Disconnect from the new measurement signal. More...
 
boost::signals2::connection oldMeasurementConnect (const typename MesurementSignal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to receive signals for old measurements. More...
 
boost::signals2::connection oldMeasurementConnect (const typename MesurementSignal::group_type &group, const typename MesurementSignal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to receive signals for old measurements. More...
 
boost::signals2::connection oldMeasurementConnectExtended (const typename MesurementSignal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to receive signals for old measurements. More...
 
boost::signals2::connection oldMeasurementConnectExtended (const typename MesurementSignal::group_type &group, const typename MesurementSignal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to receive signals for old measurements. More...
 
void oldMeasurementDisconnect (const typename MesurementSignal::group_type &group)
 Disconnect from the old measurement signal. More...
 
template<typename S >
void oldMeasurementDisconnect (const S &slotFunc)
 Disconnect from the old measurement signal. 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 resends it on this object's corresponding signal. More...
 
void handleOldMeasure (const std::shared_ptr< Instrument > &i, const std::shared_ptr< const Measurement > &m)
 Receives an old measurement signal and resends it on this object's corresponding signal. More...
 
- Protected Member Functions inherited from duds::hardware::GenericMeasurementSignalSource< SVT, SQT, TVT, TQT >
 GenericMeasurementSignalSource ()=default
 This class is intened to be used as a base class. More...
 
 GenericMeasurementSignalSource (const GenericMeasurementSignalSource &)=default
 This class is intened to be used as a base class. More...
 

Additional Inherited Members

- Public Types inherited from duds::hardware::GenericMeasurementSignalSource< 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 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...
 
- Protected Types inherited from duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT >
typedef std::map< Instrument *, MeasurementConnectionsConnectionMap
 Reduce typing and limit line length; no other reason. More...
 
typedef ConnectionMap ConnectionMapIterator
 
- Protected Attributes inherited from duds::hardware::GenericMeasurementSignalSource< SVT, SQT, TVT, TQT >
MesurementSignal newMeasure
 A set of signals that are invoked when a meaurement on this Instrument is recorded that is newer than any previously recorded measurement. More...
 
MesurementSignal oldMeasure
 A set of signals that are invoked when a meaurement on this Instrument is recorded that is older than another already recorded measurement. More...
 
- Protected Attributes inherited from duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT >
ConnectionMap conns
 Stores connections keyed by Instrument pointer. More...
 

Detailed Description

template<class SVT, class SQT, class TVT, class TQT>
class duds::hardware::GenericMeasurementSignalGroup< SVT, SQT, TVT, TQT >

Distributes measurement signals from one or more instruments to one or more listeners.

Listeners connect to signals in this class the same way they connect to signals from an Insturment. Objects of this type connect to Intruements to receive their signals. When the signal group receives a signal from an Instrument, it resends the signal to all of its listeners.

Warning
This class and its functions are not thread-safe because I suspect that modifying these objects will typically not be done across threads.

Without using MeasurementSignalGroup, listeners must be connected to each Instrument of interest:

Using MeasurementSignalGroup allows for the same functional result while grouping connections together in a way that can make the connections easier to manage and may reduce the number of connections:

Template Parameters
SVTSample value type
SQTSample quality type
TVTTime value type
TQTTime quality type
Author
Jeff Jackowski

Definition at line 79 of file MeasurementSignalGroup.hpp.

Constructor & Destructor Documentation

◆ ~GenericMeasurementSignalGroup()

template<class SVT , class SQT , class TVT , class TQT >
virtual duds::hardware::GenericMeasurementSignalGroup< SVT, SQT, TVT, TQT >::~GenericMeasurementSignalGroup ( )
virtualdefault

Member Function Documentation

◆ handleNewMeasure()

template<class SVT , class SQT , class TVT , class TQT >
void duds::hardware::GenericMeasurementSignalGroup< SVT, SQT, TVT, TQT >::handleNewMeasure ( const std::shared_ptr< Instrument > &  i,
const std::shared_ptr< const Measurement > &  m 
)
inlineprotectedvirtual

Receives a new measurement signal and resends it on this object's corresponding signal.

Implements duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT >.

Definition at line 88 of file MeasurementSignalGroup.hpp.

◆ handleOldMeasure()

template<class SVT , class SQT , class TVT , class TQT >
void duds::hardware::GenericMeasurementSignalGroup< SVT, SQT, TVT, TQT >::handleOldMeasure ( const std::shared_ptr< Instrument > &  i,
const std::shared_ptr< const Measurement > &  m 
)
inlineprotectedvirtual

Receives an old measurement signal and resends it on this object's corresponding signal.

Implements duds::hardware::GenericMeasurementSignalSink< SVT, SQT, TVT, TQT >.

Definition at line 98 of file MeasurementSignalGroup.hpp.


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