nidas  v1.2-1520
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
nidas::dynld::raf::SyncRecordGenerator Class Reference

#include <SyncRecordGenerator.h>

Inheritance diagram for nidas::dynld::raf::SyncRecordGenerator:
Inheritance graph
[legend]

Public Member Functions

 SyncRecordGenerator ()
 Constructor. More...
 
virtual ~SyncRecordGenerator ()
 
void connectSource (SampleSource *source) override
 Implementation of SampleIOProcessor::connectSource(SampleSource*). More...
 
void disconnectSource (SampleSource *source) throw ()
 Implementation of SampleIOProcessor::disconnectSource(SampleSource*). More...
 
void connect (SampleOutput *output) throw ()
 Implementation of SampleConnectionRequester::connect(SampleOutput*). More...
 
void disconnect (SampleOutput *output) throw ()
 Implementation of SampleConnectionRequester::disconnect(SampleOutput*). More...
 
void sendHeader (dsm_time_t thead, SampleOutput *output) throw (nidas::util::IOException)
 Method called to write a header to an SampleOutput. More...
 
void init (dsm_time_t sampleTime) throw ()
 
std::list< const SampleTag * > getSampleTags () const
 Implementation of SampleSource::getSampleTags(). More...
 
SampleTagIterator getSampleTagIterator () const
 Implementation of SampleSource::getSampleTagIterator(). More...
 
void addSampleClient (SampleClient *client) throw ()
 Implementation of SampleSource::addSampleClient(). More...
 
void removeSampleClient (SampleClient *client) throw ()
 Remove a SampleClient from this SampleSource. More...
 
void addSampleClientForTag (SampleClient *client, const SampleTag *tag) throw ()
 Add a Client for a given SampleTag. More...
 
void removeSampleClientForTag (SampleClient *client, const SampleTag *tag) throw ()
 Remove a SampleClient for a given SampleTag from this SampleSource. More...
 
int getClientCount () const throw ()
 How many SampleClients are currently in my list. More...
 
void flush () throw ()
 Implementation of SampleSource::flush(). More...
 
const SampleStatsgetSampleStats () const
 
void printStatus (std::ostream &, float deltat, int &) throw ()
 
SyncRecordSourcegetSyncRecordSource ()
 
virtual const std::string & getName () const
 
virtual void setName (const std::string &val)
 
virtual void setOptional (bool val)
 
virtual bool isOptional () const
 
virtual const DSMServicegetService () const
 What DSMService am I associated with? More...
 
virtual void setService (const DSMService *val)
 
virtual const DSMConfiggetDSMConfig () const
 What DSM am I associated with? More...
 
virtual void setDSMConfig (const DSMConfig *val)
 
dsm_sample_id_t getId () const
 
void setSampleId (int val)
 
unsigned int getSampleId () const
 
SampleSourcegetRawSampleSource ()
 Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples. More...
 
SampleSourcegetProcessedSampleSource ()
 Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples. More...
 
virtual void addRequestedSampleTag (SampleTag *tag) throw (nidas::util::InvalidParameterException)
 Add a request for a SampleTag from this SampleIOProcessor. More...
 
virtual std::list< const
SampleTag * > 
getRequestedSampleTags () const
 
void addSampleTag (const SampleTag *tag) throw ()
 Implementation of SampleSource::addSampleTag(). More...
 
void removeSampleTag (const SampleTag *tag) throw ()
 
virtual void addOutput (SampleOutput *val)
 Add an SampleOutput to this SampleIOProcessor. More...
 
virtual const std::list
< SampleOutput * > & 
getOutputs () const
 
void addParameter (Parameter *val) throw (nidas::util::InvalidParameterException)
 Add a parameter to this SampleIOProcessor, which will then own the pointer and will delete it in its destructor. More...
 
const std::list< const
Parameter * > & 
getParameters () const
 Get list of parameters. More...
 
void fromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 Initialize myself from a xercesc::DOMElement. More...
 
virtual xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException)
 Create a DOMElement and append it to the parent. More...
 
virtual xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException)
 Add my content into a DOMElement. More...
 

Static Public Member Functions

static const XMLCh * getNamespaceURI ()
 
static void setDefaults (SampleInputHeader &header)
 
static void sendDefaultHeader (SampleOutput *output) throw (nidas::util::IOException)
 

Protected Member Functions

void scanSensors (const std::list< DSMSensor * > &sensors)
 
void allocateRecord (dsm_time_t timetag)
 
void removeRequestedSampleTag (SampleTag *tag)
 Allow subclasses to remove requested SampleTags. More...
 

Protected Attributes

SampleSourceSupport _source
 
nidas::util::Mutex _tagsMutex
 
std::list< SampleTag * > _requestedTags
 

Private Member Functions

 SyncRecordGenerator (const SyncRecordGenerator &)
 No copying. More...
 
SyncRecordGeneratoroperator= (const SyncRecordGenerator &)
 No assignment. More...
 

Private Attributes

nidas::util::Mutex _connectionMutex
 
std::set< SampleSource * > _connectedSources
 
std::set< SampleOutput * > _connectedOutputs
 
SyncRecordSource _syncRecSource
 
size_t _numInputSampsLast
 
size_t _numOutputSampsLast
 
long long _numInputBytesLast
 
long long _numOutputBytesLast
 

Constructor & Destructor Documentation

SyncRecordGenerator::SyncRecordGenerator ( )
SyncRecordGenerator::~SyncRecordGenerator ( )
virtual
nidas::dynld::raf::SyncRecordGenerator::SyncRecordGenerator ( const SyncRecordGenerator )
private

No copying.

Member Function Documentation

virtual void nidas::core::SampleIOProcessor::addOutput ( SampleOutput val)
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.

void SampleIOProcessor::addParameter ( Parameter val)
throw (nidas::util::InvalidParameterException
)
inherited

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.

void SampleIOProcessor::addRequestedSampleTag ( SampleTag tag)
throw (nidas::util::InvalidParameterException
)
virtualinherited
void SyncRecordGenerator::addSampleClient ( SampleClient client)
throw (
)
virtual

Implementation of SampleSource::addSampleClient().

Reimplemented from nidas::core::SampleIOProcessor.

References DLOG.

Referenced by nidas::dynld::raf::SyncServer::init().

void nidas::dynld::raf::SyncRecordGenerator::addSampleClientForTag ( SampleClient client,
const SampleTag tag 
)
throw (
)
inlinevirtual

Add a Client for a given SampleTag.

Implementation of SampleSource::addSampleClient().

Reimplemented from nidas::core::SampleIOProcessor.

void SampleIOProcessor::addSampleTag ( const SampleTag tag)
throw (
)
virtualinherited
void nidas::dynld::raf::SyncRecordGenerator::allocateRecord ( dsm_time_t  timetag)
protected
void SyncRecordGenerator::connect ( SampleOutput output)
throw (
)
virtual
void SyncRecordGenerator::connectSource ( SampleSource source)
overridevirtual
void SyncRecordGenerator::disconnect ( SampleOutput output)
throw (
)
virtual
void SyncRecordGenerator::disconnectSource ( SampleSource source)
throw (
)
virtual
void nidas::dynld::raf::SyncRecordGenerator::flush ( )
throw (
)
inlinevirtual
void SampleIOProcessor::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtualinherited
int nidas::dynld::raf::SyncRecordGenerator::getClientCount ( ) const
throw (
)
inlinevirtual

How many SampleClients are currently in my list.

Reimplemented from nidas::core::SampleIOProcessor.

virtual const DSMConfig* nidas::core::SampleIOProcessor::getDSMConfig ( ) const
inlinevirtualinherited

What DSM am I associated with?

References nidas::core::SampleIOProcessor::_dsm.

dsm_sample_id_t nidas::core::SampleIOProcessor::getId ( ) const
inlineinherited
const std::string & SampleIOProcessor::getName ( ) const
virtualinherited
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
virtual const std::list<SampleOutput*>& nidas::core::SampleIOProcessor::getOutputs ( ) const
inlinevirtualinherited
const std::list<const Parameter*>& nidas::core::SampleIOProcessor::getParameters ( ) const
inlineinherited

Get list of parameters.

References nidas::core::SampleIOProcessor::_constParameters.

SampleSource* nidas::core::SampleIOProcessor::getProcessedSampleSource ( )
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.

SampleSource* nidas::core::SampleIOProcessor::getRawSampleSource ( )
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.

std::list< const SampleTag * > SampleIOProcessor::getRequestedSampleTags ( ) const
virtualinherited
unsigned int nidas::core::SampleIOProcessor::getSampleId ( ) const
inlineinherited
const SampleStats& nidas::dynld::raf::SyncRecordGenerator::getSampleStats ( ) const
inlinevirtual

Reimplemented from nidas::core::SampleIOProcessor.

SampleTagIterator nidas::dynld::raf::SyncRecordGenerator::getSampleTagIterator ( ) const
inlinevirtual
std::list<const SampleTag*> nidas::dynld::raf::SyncRecordGenerator::getSampleTags ( ) const
inlinevirtual

Implementation of SampleSource::getSampleTags().

Reimplemented from nidas::core::SampleIOProcessor.

virtual const DSMService* nidas::core::SampleIOProcessor::getService ( ) const
inlinevirtualinherited

What DSMService am I associated with?

References nidas::core::SampleIOProcessor::_service.

SyncRecordSource* nidas::dynld::raf::SyncRecordGenerator::getSyncRecordSource ( )
inline
void SyncRecordGenerator::init ( dsm_time_t  sampleTime)
throw (
)
virtual

Reimplemented from nidas::core::SampleIOProcessor.

References DLOG.

Referenced by nidas::dynld::raf::SyncServer::init().

virtual bool nidas::core::SampleIOProcessor::isOptional ( ) const
inlinevirtualinherited
SyncRecordGenerator& nidas::dynld::raf::SyncRecordGenerator::operator= ( const SyncRecordGenerator )
private

No assignment.

void SyncRecordGenerator::printStatus ( std::ostream &  ,
float  deltat,
int &   
)
throw (
)
virtual
void SampleIOProcessor::removeRequestedSampleTag ( SampleTag tag)
protectedinherited
void nidas::dynld::raf::SyncRecordGenerator::removeSampleClient ( SampleClient c)
throw (
)
inlinevirtual

Remove a SampleClient from this SampleSource.

Reimplemented from nidas::core::SampleIOProcessor.

Referenced by nidas::dynld::raf::SyncServer::stop().

void nidas::dynld::raf::SyncRecordGenerator::removeSampleClientForTag ( SampleClient c,
const SampleTag  
)
throw (
)
inlinevirtual

Remove a SampleClient for a given SampleTag from this SampleSource.

The pointer to the SampleClient must remain valid, until after it is removed.

Reimplemented from nidas::core::SampleIOProcessor.

void SampleIOProcessor::removeSampleTag ( const SampleTag tag)
throw (
)
virtualinherited
void nidas::dynld::raf::SyncRecordGenerator::scanSensors ( const std::list< DSMSensor * > &  sensors)
protected
void HeaderSource::sendDefaultHeader ( SampleOutput output)
throw (nidas::util::IOException
)
staticinherited
void SyncRecordGenerator::sendHeader ( dsm_time_t  thead,
SampleOutput output 
)
throw (nidas::util::IOException
)
virtual

Method called to write a header to an SampleOutput.

Implements nidas::core::HeaderSource.

References DLOG, and nidas::core::HeaderSource::sendDefaultHeader().

void HeaderSource::setDefaults ( SampleInputHeader header)
staticinherited
virtual void nidas::core::SampleIOProcessor::setDSMConfig ( const DSMConfig val)
inlinevirtualinherited
void SampleIOProcessor::setName ( const std::string &  val)
virtualinherited
virtual void nidas::core::SampleIOProcessor::setOptional ( bool  val)
inlinevirtualinherited
void nidas::core::SampleIOProcessor::setSampleId ( int  val)
inlineinherited
virtual void nidas::core::SampleIOProcessor::setService ( const DSMService val)
inlinevirtualinherited
xercesc::DOMElement * DOMable::toDOMElement ( xercesc::DOMElement *  node,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
xercesc::DOMElement * DOMable::toDOMParent ( xercesc::DOMElement *  parent,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited

Member Data Documentation

std::set<SampleOutput*> nidas::dynld::raf::SyncRecordGenerator::_connectedOutputs
private

Referenced by ~SyncRecordGenerator().

std::set<SampleSource*> nidas::dynld::raf::SyncRecordGenerator::_connectedSources
private

Referenced by connectSource().

nidas::util::Mutex nidas::dynld::raf::SyncRecordGenerator::_connectionMutex
private
long long nidas::dynld::raf::SyncRecordGenerator::_numInputBytesLast
private
size_t nidas::dynld::raf::SyncRecordGenerator::_numInputSampsLast
private
long long nidas::dynld::raf::SyncRecordGenerator::_numOutputBytesLast
private
size_t nidas::dynld::raf::SyncRecordGenerator::_numOutputSampsLast
private
std::list<SampleTag*> nidas::core::SampleIOProcessor::_requestedTags
protectedinherited
SampleSourceSupport nidas::core::SampleIOProcessor::_source
protectedinherited
SyncRecordSource nidas::dynld::raf::SyncRecordGenerator::_syncRecSource
private
nidas::util::Mutex nidas::core::SampleIOProcessor::_tagsMutex
mutableprotectedinherited

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