nidas v1.2.3
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
SampleDispatcher Class Reference
Inheritance diagram for SampleDispatcher:
Inheritance graph
[legend]

Public Member Functions

 SampleDispatcher (InfluxDB *db, const list< DSMSensor * > &sensors, NidasApp &app)
 
virtual ~SampleDispatcher ()
 
void flush () throw ()
 Ask that this SampleClient send out any buffered Samples that it may be holding.
 
bool receive (const Sample *samp) throw ()
 Method called to pass a sample to this client.
 

Private Types

typedef map< dsm_sample_id_t, SampleToDatabasesample_map_t
 

Private Member Functions

sample_map_t::iterator findStats (dsm_sample_id_t sampid)
 Find the SampleToDatabase for the given sample ID.
 

Private Attributes

sample_map_t _samples
 
NidasApp_app
 

Member Typedef Documentation

◆ sample_map_t

Constructor & Destructor Documentation

◆ SampleDispatcher()

SampleDispatcher::SampleDispatcher ( InfluxDB * db,
const list< DSMSensor * > & sensors,
NidasApp & app )

◆ ~SampleDispatcher()

virtual SampleDispatcher::~SampleDispatcher ( )
inlinevirtual

Member Function Documentation

◆ findStats()

sample_map_t::iterator SampleDispatcher::findStats ( dsm_sample_id_t sampid)
inlineprivate

Find the SampleToDatabase for the given sample ID.

Wisard samples get mapped to one sensor type, so we look for all of them.

References _app, _samples, nidas::core::NidasApp::formatId(), nidas::core::getSample(), and VLOG.

Referenced by SampleDispatcher().

◆ flush()

void SampleDispatcher::flush ( )
throw ( )
inlinevirtual

Ask that this SampleClient send out any buffered Samples that it may be holding.

Exceptions

)

Implements nidas::core::SampleClient.

◆ receive()

bool SampleDispatcher::receive ( const Sample * s)
throw ( )
virtual

Method called to pass a sample to this client.

This method is typically called by a SampleSource for each of its SampleClients when it has a sample ready. Returns true: success false: sample rejected. This is meant to signal a warning-type situation - like a socket not being available temporarily. True errors will be thrown as an IOException.

Exceptions

)

Implements nidas::core::SampleClient.

References DLOG, nidas::core::getSample(), VLOG, and WLOG.

Member Data Documentation

◆ _app

NidasApp& SampleDispatcher::_app
private

Referenced by findStats(), and SampleDispatcher().

◆ _samples

sample_map_t SampleDispatcher::_samples
private

Referenced by findStats(), and SampleDispatcher().


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