nidas v1.2.3
|
#include <SampleArchiver.h>
Static Public Member Functions | |
static const XMLCh * | getNamespaceURI () |
Protected Member Functions | |
void | removeRequestedSampleTag (SampleTag *tag) |
Allow subclasses to remove requested SampleTags. | |
Protected Attributes | |
SampleSourceSupport | _source |
nidas::util::Mutex | _tagsMutex |
std::list< SampleTag * > | _requestedTags |
Private Member Functions | |
SampleArchiver (const SampleArchiver &x) | |
Copy not supported. | |
SampleArchiver & | operator= (const SampleArchiver &x) |
Assignment not supported. | |
Private Attributes | |
nidas::util::Mutex | _connectionMutex |
std::set< SampleSource * > | _connectedSources |
std::set< SampleOutput * > | _connectedOutputs |
std::list< const nidas::core::FileSet * > | _filesets |
If my SampleOutput* is a nidas::core::FileSet then save the pointer for use in by printStatus(), so that the status output will contain things like the file size. | |
nidas::util::Mutex | _filesetMutex |
Mutex for controlling access to _filesets so that printStatus has valid pointers. | |
size_t | _nsampsLast |
Saved between calls to printStatus in order to compute sample rates. | |
long long | _nbytesLast |
Saved between calls to printStatus in order to compute data rates. | |
std::map< const nidas::core::FileSet *, long long > | _nbytesLastByFileSet |
bool | _rawArchive |
std::string | _name |
dsm_sample_id_t | _id |
std::list< const SampleTag * > | _constRequestedTags |
std::list< SampleOutput * > | _origOutputs |
bool | _optional |
const DSMService * | _service |
What service am I a part of? | |
const DSMConfig * | _dsm |
Or, what DSM am I a part of? | |
std::list< Parameter * > | _parameters |
std::list< const Parameter * > | _constParameters |
Static Private Attributes | |
static XMLCh * | namespaceURI = 0 |
SampleArchiver::SampleArchiver | ( | ) |
References nidas::core::SampleIOProcessor::setName().
|
virtual |
References _connectedOutputs, _connectedSources, _connectionMutex, nidas::core::SampleOutput::close(), nidas::core::SampleClient::flush(), nidas::core::SampleOutput::getName(), nidas::core::SampleOutput::getOriginal(), nidas::core::getSample(), nidas::util::Mutex::lock(), LOG_ERR, nidas::core::SampleSource::removeSampleClient(), and nidas::util::Mutex::unlock().
|
private |
Copy not supported.
|
inlinevirtualinherited |
Add an SampleOutput to this SampleIOProcessor.
This is used to add a desired SampleOutput to this SampleIOProcessor. SampleIOProcessor will own the SampleOutput. Once a SampleSource has connected, then SampleIOProcessor is responsible for do SampleOutput::requestConnection, or SampleOutputRequestThread::addConnectRequest() on all these as-yet disconnected outputs.
References nidas::core::SampleIOProcessor::_origOutputs.
Referenced by nidas::core::SampleIOProcessor::fromDOMElement().
Add a parameter to this SampleIOProcessor, which will then own the pointer and will delete it in its destructor.
If a Parameter exists with the same name, it will be replaced with the new Parameter.
nidas::util::InvalidParameterException |
References nidas::core::SampleIOProcessor::_constParameters, and nidas::core::SampleIOProcessor::_parameters.
Referenced by nidas::core::SampleIOProcessor::fromDOMElement().
Add a request for a SampleTag from this SampleIOProcessor.
This SampleIOProcessor will own the SampleTag.
nidas::util::InvalidParameterException |
Reimplemented in nidas::dynld::raf::CVIProcessor, and nidas::dynld::StatisticsProcessor.
References nidas::core::SampleIOProcessor::_constRequestedTags, nidas::core::SampleIOProcessor::_requestedTags, nidas::core::SampleIOProcessor::_tagsMutex, and nidas::core::getSample().
Referenced by nidas::dynld::raf::CVIProcessor::addRequestedSampleTag(), nidas::dynld::StatisticsProcessor::addRequestedSampleTag(), and nidas::core::SampleIOProcessor::fromDOMElement().
|
inlinevirtualinherited |
Implementation of SampleSource::addSampleClient().
Implements nidas::core::SampleSource.
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_source, and nidas::core::SampleSourceSupport::addSampleClient().
|
inlinevirtualinherited |
Add a Client for a given SampleTag.
Implementation of SampleSource::addSampleClient().
Implements nidas::core::SampleSource.
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_source, and nidas::core::SampleSourceSupport::addSampleClientForTag().
Implementation of SampleSource::addSampleTag().
Implements nidas::core::SampleSource.
Referenced by nidas::dynld::raf::CVIProcessor::addRequestedSampleTag(), and nidas::dynld::StatisticsProcessor::connectSource().
|
virtual |
Implementation of SampleConnectionRequester::connect(SampleOutput*).
Implements nidas::core::SampleConnectionRequester.
References nidas::core::SampleSource::addSampleClient(), nidas::core::getSample(), ILOG, VLOG, and WLOG.
|
overridevirtual |
Implementation of SampleIOProcessor::connectSource(SampleSource*).
Implements nidas::core::SampleIOProcessor.
References _connectedOutputs, _connectedSources, _connectionMutex, nidas::core::SampleSource::addSampleClient(), nidas::core::SampleOutput::addSourceSampleTags(), nidas::core::SampleOutputRequestThread::getInstance(), nidas::core::SampleIOProcessor::getOutputs(), nidas::core::SampleSource::getProcessedSampleSource(), getRaw(), nidas::core::SampleSource::getRawSampleSource(), nidas::core::getSample(), and nidas::core::SampleSource::getSampleTags().
|
virtual |
Implementation of SampleConnectionRequester::disconnect(SampleOutput*).
Implements nidas::core::SampleConnectionRequester.
References nidas::core::SampleOutputRequestThread::getInstance(), nidas::core::SampleOutput::getOriginal(), nidas::core::getSample(), ILOG, LOG_ERR, and nidas::core::SampleSource::removeSampleClient().
|
virtual |
Implementation of SampleIOProcessor::disconnectSource(SampleSource*).
Implements nidas::core::SampleIOProcessor.
References nidas::core::SampleSource::getProcessedSampleSource(), nidas::core::SampleSource::getRawSampleSource(), and nidas::core::getSample().
|
virtual |
Implementation of SampleSource::flush().
Implements nidas::core::SampleSource.
References _connectedOutputs, _connectionMutex, nidas::core::SampleClient::flush(), and nidas::core::getSample().
nidas::util::InvalidParameterException |
Implements nidas::core::DOMable.
References nidas::core::SampleIOProcessor::_origOutputs, nidas::core::SampleIOProcessor::addOutput(), nidas::core::SampleIOProcessor::addParameter(), nidas::core::SampleIOProcessor::addRequestedSampleTag(), nidas::core::DOMObjectFactory::createObject(), nidas::core::Parameter::createParameter(), nidas::core::SampleTag::fromDOMElement(), nidas::core::DOMable::fromDOMElement(), nidas::core::SampleIOProcessor::getId(), nidas::core::Project::getInstance(), nidas::core::SampleIOProcessor::getRequestedSampleTags(), nidas::core::getSample(), nidas::core::SampleTag::getSampleId(), nidas::core::SampleIOProcessor::setOptional(), nidas::core::SampleIOProcessor::setSampleId(), nidas::core::SampleTag::setSampleId(), nidas::core::SampleTag::setSensorId(), and WLOG.
Referenced by nidas::dynld::raf::CVIProcessor::fromDOMElement().
|
inlinevirtualinherited |
How many SampleClients are currently in my list.
)
Implements nidas::core::SampleSource.
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_source, and nidas::core::SampleSourceSupport::getClientCount().
|
inlinevirtualinherited |
What DSM am I associated with?
References nidas::core::SampleIOProcessor::_dsm.
Referenced by nidas::dynld::raf::CVIProcessor::addRequestedSampleTag().
|
inlineinherited |
References nidas::core::SampleIOProcessor::_id, and GET_FULL_ID.
Referenced by nidas::core::SampleIOProcessor::fromDOMElement().
|
virtualinherited |
References nidas::core::SampleIOProcessor::_name.
Referenced by nidas::dynld::StatisticsProcessor::addRequestedSampleTag(), nidas::dynld::StatisticsProcessor::connectSource(), nidas::dynld::raf::CVIProcessor::fromDOMElement(), nidas::dynld::raf::CVIProcessor::~CVIProcessor(), and nidas::dynld::StatisticsProcessor::~StatisticsProcessor().
References nidas::core::DOMable::namespaceURI.
Referenced by nidas::dynld::UDPSampleOutput::getProjectDOM(), nidas::core::Dataset::toDOMElement(), nidas::core::ProjectConfig::toDOMElement(), nidas::core::Dataset::toDOMParent(), nidas::core::Datasets::toDOMParent(), nidas::core::ProjectConfig::toDOMParent(), nidas::core::ProjectConfigs::toDOMParent(), nidas::core::DSMConfig::toDOMParent(), nidas::core::DSMSensor::toDOMParent(), nidas::core::Project::toDOMParent(), nidas::core::SampleTag::toDOMParent(), nidas::core::Site::toDOMParent(), nidas::core::ServerSocket::toDOMParent(), nidas::core::Variable::toDOMParent(), nidas::core::Datasets::writeXML(), and nidas::core::ProjectConfigs::writeXML().
|
inlinevirtualinherited |
References nidas::core::SampleIOProcessor::_origOutputs.
Referenced by connectSource(), nidas::dynld::raf::CVIProcessor::connectSource(), nidas::dynld::SampleProcessor::connectSource(), nidas::dynld::StatisticsProcessor::connectSource(), nidas::dynld::raf::SyncRecordGenerator::connectSource(), and nidas::core::Project::findServerSampleOutputStreamFileSets().
|
inlineinherited |
Get list of parameters.
References nidas::core::SampleIOProcessor::_constParameters.
Referenced by nidas::dynld::raf::CVIProcessor::fromDOMElement().
|
inlinevirtualinherited |
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 nidas::core::SampleIOProcessor::_source.
|
inline |
References _rawArchive.
Referenced by connectSource().
|
inlinevirtualinherited |
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.
References nidas::core::SampleIOProcessor::_constRequestedTags, nidas::core::SampleIOProcessor::_tagsMutex, and nidas::core::getSample().
Referenced by nidas::dynld::StatisticsProcessor::addRequestedSampleTag(), nidas::dynld::StatisticsProcessor::connectSource(), nidas::core::SampleIOProcessor::fromDOMElement(), and nidas::core::SampleTagIterator::hasNext().
References nidas::core::SampleIOProcessor::_id, and GET_SPS_ID.
Referenced by nidas::dynld::StatisticsProcessor::selectRequestedSampleTags().
|
inlinevirtualinherited |
Implements nidas::core::SampleSource.
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_source, and nidas::core::SampleSourceSupport::getSampleStats().
|
inlinevirtualinherited |
Implementation of SampleSource::getSampleTagIterator().
Implements nidas::core::SampleSource.
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_source, and nidas::core::SampleSourceSupport::getSampleTagIterator().
|
inlinevirtualinherited |
Implementation of SampleSource::getSampleTags().
Implements nidas::core::SampleSource.
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_source, and nidas::core::SampleSourceSupport::getSampleTags().
Referenced by nidas::dynld::raf::CVIProcessor::addRequestedSampleTag(), nidas::dynld::raf::CVIProcessor::connectSource(), and nidas::dynld::StatisticsProcessor::connectSource().
|
inlinevirtualinherited |
What DSMService am I associated with?
References nidas::core::SampleIOProcessor::_service.
|
inlinevirtualinherited |
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_optional.
|
private |
Assignment not supported.
Reimplemented from nidas::core::SampleIOProcessor.
References err, nidas::util::UTime::format(), nidas::core::getSample(), and nidas::core::SampleSource::getSampleStats().
Allow subclasses to remove requested SampleTags.
The tag will be deleted.
References nidas::core::SampleIOProcessor::_constRequestedTags, nidas::core::SampleIOProcessor::_requestedTags, nidas::core::SampleIOProcessor::_tagsMutex, and nidas::core::getSample().
Referenced by nidas::dynld::StatisticsProcessor::selectRequestedSampleTags().
|
inlinevirtualinherited |
Remove a SampleClient from this SampleSource.
)
Implements nidas::core::SampleSource.
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_source, and nidas::core::SampleSourceSupport::removeSampleClient().
|
inlinevirtualinherited |
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.
Reimplemented in nidas::dynld::raf::SyncRecordGenerator.
References nidas::core::SampleIOProcessor::_source, and nidas::core::SampleSourceSupport::removeSampleClientForTag().
|
inlinevirtualinherited |
References nidas::core::SampleIOProcessor::_dsm, and nidas::core::getSample().
References nidas::core::SampleIOProcessor::_optional, and nidas::core::getSample().
Referenced by nidas::core::SampleIOProcessor::fromDOMElement().
By default a SampleArchiver is used for archiving raw samples, and any SampleOutputs that connect will receive samples from source->getRawSampleSource(), even if the output->isRaw() method returns false.
This is to correct possible human errors in the configuation. If setRaw(false), then this SampleArchiver will archive processed samples, by connecting outputs to source->getProcessedSampleSource(). If the value of an output->isRaw() disgrees with getRaw() of this SampleArchive, a warning message is logged.
References _rawArchive, and nidas::core::getSample().
References nidas::core::SampleIOProcessor::_id, and SET_SPS_ID.
Referenced by nidas::core::SampleIOProcessor::fromDOMElement().
|
inlinevirtualinherited |
References nidas::core::SampleIOProcessor::_service, and nidas::core::getSample().
|
virtualinherited |
Add my content into a DOMElement.
xercesc::DOMException |
Reimplemented in nidas::core::DSMConfig, nidas::core::DSMSensor, nidas::core::Project, nidas::core::SampleTag, nidas::core::Site, nidas::core::ServerSocket, and nidas::core::Variable.
Referenced by nidas::core::ServerSocket::toDOMParent().
|
virtualinherited |
Create a DOMElement and append it to the parent.
xercesc::DOMException |
Reimplemented in nidas::core::DSMConfig, nidas::core::DSMSensor, nidas::core::Project, nidas::core::SampleTag, nidas::core::Site, nidas::core::ServerSocket, and nidas::core::Variable.
|
private |
Referenced by connectSource(), flush(), and ~SampleArchiver().
|
private |
Referenced by connectSource(), and ~SampleArchiver().
|
private |
Referenced by connectSource(), flush(), and ~SampleArchiver().
Or, what DSM am I a part of?
Referenced by nidas::core::SampleIOProcessor::getDSMConfig(), and nidas::core::SampleIOProcessor::setDSMConfig().
|
private |
Mutex for controlling access to _filesets so that printStatus has valid pointers.
|
private |
If my SampleOutput* is a nidas::core::FileSet then save the pointer for use in by printStatus(), so that the status output will contain things like the file size.
|
privateinherited |
|
privateinherited |
Referenced by nidas::core::SampleIOProcessor::getName(), and nidas::core::SampleIOProcessor::setName().
Saved between calls to printStatus in order to compute data rates.
|
private |
|
private |
Saved between calls to printStatus in order to compute sample rates.
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
protectedinherited |
|
privateinherited |
What service am I a part of?
Referenced by nidas::core::SampleIOProcessor::getService(), and nidas::core::SampleIOProcessor::setService().
|
protectedinherited |
Referenced by nidas::core::SampleIOProcessor::addSampleClient(), nidas::core::SampleIOProcessor::addSampleClientForTag(), nidas::core::SampleIOProcessor::getClientCount(), nidas::core::SampleIOProcessor::getProcessedSampleSource(), nidas::core::SampleIOProcessor::getSampleStats(), nidas::core::SampleIOProcessor::getSampleTagIterator(), nidas::core::SampleIOProcessor::getSampleTags(), nidas::core::SampleIOProcessor::removeSampleClient(), and nidas::core::SampleIOProcessor::removeSampleClientForTag().
|
mutableprotectedinherited |
|
staticprivateinherited |
Referenced by nidas::core::DOMable::getNamespaceURI().