|
nidas v1.2.3
|
#include <SampleAverager.h>

Protected Member Functions | |
| void | init () throw () |
Private Member Functions | |
| void | addSampleTag (const SampleTag *tag) throw () |
| Add a SampleTag to this SampleSource. | |
| void | removeSampleTag (const SampleTag *tag) throw () |
| SampleAverager (const SampleAverager &) | |
| No copy. | |
| SampleAverager & | operator= (const SampleAverager &) |
| No assignment. | |
Private Attributes | |
| SampleSourceSupport | _source |
| SampleTag | _outSample |
| int | _averagePeriodUsecs |
| Length of average, in microseconds. | |
| dsm_time_t | _endTime |
| end time of current statistics window. | |
| std::map< Variable *, unsigned int > | _outVarIndices |
| Index of each requested output variable in the output sample. | |
| std::map< dsm_sample_id_t, std::vector< unsigned int > > | _inmap |
| std::map< dsm_sample_id_t, std::vector< unsigned int > > | _lenmap |
| std::map< dsm_sample_id_t, std::vector< unsigned int > > | _outmap |
| unsigned int | _ndataValues |
| double * | _sums |
| int * | _cnts |
| SampleAverager::SampleAverager | ( | ) |
|
private |
No copy.
|
inlinevirtual | |||||||||||||
Implementation of SampleSource::addSampleClient().
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::addSampleClient().
|
inlinevirtual | |||||||||||||||
Add a Client for a given SampleTag.
Implementation of SampleSource::addSampleClient().
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::addSampleClient().
|
inlineprivatevirtual | |||||||||||||
Add a SampleTag to this SampleSource.
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::addSampleTag().
Referenced by SampleAverager(), SampleAverager(), and SampleAverager().
References _ndataValues, _outSample, _outVarIndices, nidas::core::SampleTag::addVariable(), and nidas::core::getSample().
Referenced by nidas::dynld::raf::CVIProcessor::addRequestedSampleTag(), and addVariables().
References addVariable(), and nidas::core::getSample().
Referenced by SampleAverager(), and SampleAverager().
|
virtual |
Connect the resampler to a SampleSource.
| nidas::util::InvalidParameterException |
Implements nidas::core::Resampler.
References _inmap, _lenmap, _outmap, _outSample, _outVarIndices, nidas::core::SampleSource::addSampleClientForTag(), nidas::core::Sample::getId(), nidas::core::Variable::getName(), nidas::core::getSample(), nidas::core::SampleSource::getSampleTags(), nidas::core::SampleTag::getVariable(), nidas::core::SampleTag::getVariables(), init(), and WLOG.
Referenced by nidas::dynld::raf::CVIProcessor::connectSource().
|
virtual | |||||||||||||
Implements nidas::core::Resampler.
|
virtual | ||||||||||||
Implementation of Resampler::flush().
Implements nidas::core::Resampler.
References _averagePeriodUsecs, _cnts, _endTime, _ndataValues, _outSample, _source, _sums, nidas::core::SampleSourceSupport::distribute(), nidas::core::floatNAN, fp, nidas::core::SampleTag::getId(), and nidas::core::getSample().
Referenced by nidas::dynld::raf::CVIProcessor::flush().
|
inline |
Get average period.
References _averagePeriodUsecs, and USECS_PER_SEC.
|
inlinevirtual | ||||||||||||
How many SampleClients are currently in my list.
)
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::getClientCount().
|
inlinevirtual |
Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.
SampleClients use this method to get a pointer to whatever sample source they are interested in. Derived classes can return NULL if they are not a SampleSource of processed samples.
Implements nidas::core::SampleSource.
References _source.
|
inlinevirtual |
Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.
SampleClients use this method to get a pointer to whatever sample source they are interested in. Derived classes can return NULL if they are not a SampleSource of raw samples.
Implements nidas::core::SampleSource.
|
inlinevirtual |
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::getSampleStats().
|
inlinevirtual |
Implementation of SampleSource::getSampleTagIterator().
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::getSampleTagIterator().
Get the output SampleTags.
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::getSampleTags().
|
protected | ||||||||||||
References _cnts, _endTime, _ndataValues, and _sums.
Referenced by connect().
|
private |
No assignment.
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.
)
Implements nidas::core::SampleClient.
References nidas::core::DOUBLE_ST, nidas::core::FLOAT_ST, nidas::core::floatNAN, nidas::util::UTime::format(), fp, nidas::core::getSample(), and nidas::util::timeCeiling().
|
inlinevirtual | |||||||||||||
Remove a SampleClient from this SampleSource.
)
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::removeSampleClient().
Referenced by nidas::dynld::raf::CVIProcessor::~CVIProcessor().
|
inlinevirtual | |||||||||||||||
Remove a SampleClient for a given SampleTag from this SampleSource.
The pointer to the SampleClient must remain valid, until after it is removed.
)
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::removeSampleClient().
|
inlineprivatevirtual | |||||||||||||
)
Implements nidas::core::SampleSource.
References _source, and nidas::core::SampleSourceSupport::removeSampleTag().
Set average period.
| val | average period, in seconds. |
References _averagePeriodUsecs, _outSample, nidas::core::getSample(), nidas::core::SampleTag::setRate(), and USECS_PER_SEC.
Referenced by nidas::dynld::raf::CVIProcessor::addRequestedSampleTag(), SampleAverager(), SampleAverager(), and SampleAverager().
|
private |
Length of average, in microseconds.
Referenced by flush(), getAveragePeriodSecs(), and setAveragePeriodSecs().
|
private |
Referenced by flush(), init(), and ~SampleAverager().
|
private |
|
private |
Referenced by connect().
|
private |
Referenced by connect().
Referenced by addVariable(), flush(), and init().
|
private |
Referenced by connect().
|
private |
Referenced by addVariable(), connect(), flush(), SampleAverager(), SampleAverager(), SampleAverager(), and setAveragePeriodSecs().
Index of each requested output variable in the output sample.
Referenced by addVariable(), and connect().
|
private |
|
private |
Referenced by flush(), init(), and ~SampleAverager().