nidas v1.2.3
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
nidas::core::DSMConfig Class Reference

Class that should include all that is configurable about a DSM. More...

#include <DSMConfig.h>

Inheritance diagram for nidas::core::DSMConfig:
Inheritance graph
[legend]

Classes

class  MyDictionary
 

Public Member Functions

 DSMConfig ()
 
virtual ~DSMConfig ()
 
void setSite (const Site *val)
 
const SitegetSite () const
 
const ProjectgetProject () const
 
const std::string & getName () const
 
void setName (const std::string &val)
 
const std::string & getLocation () const
 
void setLocation (const std::string &val)
 
dsm_sample_id_t getId () const
 
void setId (dsm_sample_id_t val)
 
void addSensor (DSMSensor *sensor)
 
void removeSensor (DSMSensor *sensor)
 
const std::list< DSMSensor * > & getSensors () const
 
void initSensors ()
 
void openSensors (SensorHandler *)
 Pass my sensors to the SensorHandler for opening.
 
void addOutput (SampleOutput *output)
 
const std::list< SampleOutput * > & getOutputs () const
 
std::list< nidas::core::FileSet * > findSampleOutputStreamFileSets () const
 
unsigned short getRemoteSerialSocketPort () const
 
void setRemoteSerialSocketPort (unsigned short val)
 
SensorIterator getSensorIterator () const
 
SampleTagIterator getSampleTagIterator () const
 
VariableIterator getVariableIterator () const
 
float getRawSorterLength () const
 Get the length of the SampleSorter of raw Samples, in seconds.
 
void setRawSorterLength (float val)
 Set the length of the SampleSorter of raw Samples, in seconds.
 
float getProcSorterLength () const
 Get the length of the SampleSorter of processed Samples, in seconds.
 
void setProcSorterLength (float val)
 Set the length of the SampleSorter of processed Samples, in seconds.
 
size_t getRawHeapMax () const
 Get the size of in bytes of the raw SampleSorter.
 
void setRawHeapMax (size_t val)
 Set the size of in bytes of the raw SampleSorter.
 
size_t getProcHeapMax () const
 Get the size of in bytes of the processed SampleSorter.
 
void setProcHeapMax (size_t val)
 Set the size of in bytes of the processed SampleSorter.
 
unsigned int getRawLateSampleCacheSize () const
 Get the size of the late sample cache in the raw sample sorter.
 
void setRawLateSampleCacheSize (unsigned int val)
 Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter.
 
unsigned int getProcLateSampleCacheSize () const
 Get the size of the late sample cache in the processed sample sorter.
 
void setProcLateSampleCacheSize (unsigned int val)
 Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter.
 
DSMSensorsensorFromDOMElement (const xercesc::DOMElement *node)
 Parse a DOMElement for a DSMSensor, returning a pointer to the DSMSensor.
 
void validate ()
 
void fromDOMElement (const xercesc::DOMElement *)
 
xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const
 
xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const
 
std::string expandString (const std::string &input) const
 Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue().
 
bool getTokenValue (const std::string &token, std::string &value) const
 Implement a lookup for tokens that I know about, like $DSM, $LOCATION.
 
const DictionarygetDictionary () const
 
void setDerivedDataSocketAddr (const nidas::util::SocketAddress &val)
 
const nidas::util::SocketAddressgetDerivedDataSocketAddr () const
 
void setStatusSocketAddr (const nidas::util::SocketAddress &val)
 
const nidas::util::SocketAddressgetStatusSocketAddr () const
 
virtual void addProcessor (SampleIOProcessor *proc)
 Add a processor to this DSM.
 
virtual const std::list< SampleIOProcessor * > & getProcessors () const
 
ProcessorIterator getProcessorIterator () const
 

Static Public Member Functions

static const XMLChgetNamespaceURI ()
 

Private Member Functions

void validateSensorAndSampleIds ()
 Validate the ids of the DSMSensors belonging to this DSMConfig, and their SampleTags, for uniqueness.
 
 DSMConfig (const DSMConfig &x)
 
DSMConfigoperator= (const DSMConfig &x)
 

Private Attributes

const Site_site
 
std::string _name
 
std::string _suffix
 
std::string _location
 
nidas::core::DSMConfig::MyDictionary _dictionary
 
unsigned int _id
 
std::list< DSMSensor * > _ownedSensors
 A list of the sensors on this DSM that have not been passed to a SensorHandler, i.e.
 
std::list< DSMSensor * > _allSensors
 A list of all sensors configured on this DSM.
 
std::list< SampleOutput * > _outputs
 SampleOutputs.
 
unsigned short _remoteSerialSocketPort
 TCP socket port that DSMEngine listens on for remote serial connections.
 
float _rawSorterLength
 
float _procSorterLength
 
size_t _rawHeapMax
 
size_t _procHeapMax
 
unsigned int _rawLateSampleCacheSize
 
unsigned int _procLateSampleCacheSize
 
nidas::util::SocketAddress_derivedDataSocketAddr
 
std::list< SampleIOProcessor * > _processors
 
nidas::util::SocketAddress_statusSocketAddr
 

Static Private Attributes

static XMLChnamespaceURI = 0
 

Detailed Description

Class that should include all that is configurable about a DSM.

It should be able to initialize itself from a <dsm> XML element, and provide get methods to access its essential pieces, like sensors.

Constructor & Destructor Documentation

◆ DSMConfig() [1/2]

DSMConfig::DSMConfig ( )

◆ ~DSMConfig()

DSMConfig::~DSMConfig ( )
virtual

◆ DSMConfig() [2/2]

nidas::core::DSMConfig::DSMConfig ( const DSMConfig & x)
private

Member Function Documentation

◆ addOutput()

void nidas::core::DSMConfig::addOutput ( SampleOutput * output)
inline

References _outputs.

Referenced by fromDOMElement().

◆ addProcessor()

virtual void nidas::core::DSMConfig::addProcessor ( SampleIOProcessor * proc)
inlinevirtual

Add a processor to this DSM.

This is done at configuration (XML) time.

References _processors.

Referenced by fromDOMElement().

◆ addSensor()

void DSMConfig::addSensor ( DSMSensor * sensor)

◆ expandString()

std::string nidas::core::DSMConfig::expandString ( const std::string & input) const
inline

Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue().

If curly brackets are not used, then the TOKEN should be delimited by a '/', a '.' or the end of string, e.g.: xxx/yyy/$ZZZ.dat

References _dictionary, and nidas::core::Dictionary::expandString().

Referenced by fromDOMElement().

◆ findSampleOutputStreamFileSets()

list< nidas::core::FileSet * > DSMConfig::findSampleOutputStreamFileSets ( ) const

◆ fromDOMElement()

void DSMConfig::fromDOMElement ( const xercesc::DOMElement * node)
virtual

◆ getDerivedDataSocketAddr()

const nidas::util::SocketAddress & nidas::core::DSMConfig::getDerivedDataSocketAddr ( ) const
inline

◆ getDictionary()

const Dictionary & nidas::core::DSMConfig::getDictionary ( ) const
inline

References _dictionary.

◆ getId()

dsm_sample_id_t nidas::core::DSMConfig::getId ( ) const
inline

◆ getLocation()

const std::string & nidas::core::DSMConfig::getLocation ( ) const
inline

◆ getName()

const std::string & nidas::core::DSMConfig::getName ( ) const
inline

◆ getNamespaceURI()

static const XMLCh * nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited

◆ getOutputs()

const std::list< SampleOutput * > & nidas::core::DSMConfig::getOutputs ( ) const
inline

◆ getProcessorIterator()

ProcessorIterator DSMConfig::getProcessorIterator ( ) const

◆ getProcessors()

virtual const std::list< SampleIOProcessor * > & nidas::core::DSMConfig::getProcessors ( ) const
inlinevirtual

References _processors.

◆ getProcHeapMax()

size_t nidas::core::DSMConfig::getProcHeapMax ( ) const
inline

Get the size of in bytes of the processed SampleSorter.

If the size of the sorter exceeds this value then samples will be discarded.

References _procHeapMax.

Referenced by nidas::core::DSMEngine::openSensors().

◆ getProcLateSampleCacheSize()

unsigned int nidas::core::DSMConfig::getProcLateSampleCacheSize ( ) const
inline

Get the size of the late sample cache in the processed sample sorter.

See SampleSorter::getLateSampleCacheSize(). Default: 0.

References _procLateSampleCacheSize.

Referenced by nidas::core::DSMEngine::openSensors().

◆ getProcSorterLength()

float nidas::core::DSMConfig::getProcSorterLength ( ) const
inline

Get the length of the SampleSorter of processed Samples, in seconds.

References _procSorterLength.

Referenced by nidas::core::DSMEngine::openSensors().

◆ getProject()

const Project * DSMConfig::getProject ( ) const

◆ getRawHeapMax()

size_t nidas::core::DSMConfig::getRawHeapMax ( ) const
inline

Get the size of in bytes of the raw SampleSorter.

If the size of the sorter exceeds this value then samples will be discarded.

References _rawHeapMax.

Referenced by nidas::core::DSMEngine::openSensors().

◆ getRawLateSampleCacheSize()

unsigned int nidas::core::DSMConfig::getRawLateSampleCacheSize ( ) const
inline

Get the size of the late sample cache in the raw sample sorter.

See SampleSorter::getLateSampleCacheSize(). Default: 0.

References _rawLateSampleCacheSize.

Referenced by nidas::core::DSMEngine::openSensors().

◆ getRawSorterLength()

float nidas::core::DSMConfig::getRawSorterLength ( ) const
inline

Get the length of the SampleSorter of raw Samples, in seconds.

References _rawSorterLength.

Referenced by nidas::core::DSMEngine::openSensors().

◆ getRemoteSerialSocketPort()

unsigned short nidas::core::DSMConfig::getRemoteSerialSocketPort ( ) const
inline

◆ getSampleTagIterator()

SampleTagIterator DSMConfig::getSampleTagIterator ( ) const

◆ getSensorIterator()

SensorIterator DSMConfig::getSensorIterator ( ) const

◆ getSensors()

const std::list< DSMSensor * > & nidas::core::DSMConfig::getSensors ( ) const
inline

◆ getSite()

const Site * nidas::core::DSMConfig::getSite ( ) const
inline

◆ getStatusSocketAddr()

const nidas::util::SocketAddress & nidas::core::DSMConfig::getStatusSocketAddr ( ) const
inline

◆ getTokenValue()

bool nidas::core::DSMConfig::getTokenValue ( const std::string & token,
std::string & value ) const
inline

Implement a lookup for tokens that I know about, like $DSM, $LOCATION.

For other tokens, call getSite()->getTokenValue(token,value);

References _dictionary, and nidas::core::DSMConfig::MyDictionary::getTokenValue().

◆ getVariableIterator()

VariableIterator DSMConfig::getVariableIterator ( ) const

◆ initSensors()

void DSMConfig::initSensors ( )

◆ openSensors()

void DSMConfig::openSensors ( SensorHandler * selector)

Pass my sensors to the SensorHandler for opening.

References _ownedSensors, and nidas::core::getSample().

Referenced by nidas::core::DSMEngine::openSensors().

◆ operator=()

DSMConfig & nidas::core::DSMConfig::operator= ( const DSMConfig & x)
private

◆ removeSensor()

void DSMConfig::removeSensor ( DSMSensor * sensor)

◆ sensorFromDOMElement()

DSMSensor * DSMConfig::sensorFromDOMElement ( const xercesc::DOMElement * node)

Parse a DOMElement for a DSMSensor, returning a pointer to the DSMSensor.

The pointer may be for a new instance of a DSMSensor, or, if the devicename matches a previous DSMSensor that has been added to this DSMConfig, will point to the matching DSMSensor.

Exceptions
nidas::util::InvalidParameterException

References nidas::core::DOMObjectFactory::createObject(), nidas::core::DSMSensor::fromDOMElement(), nidas::core::DSMSensor::getClassName(), getName(), nidas::core::DSMSensor::getName(), getProject(), nidas::core::getSample(), getSensors(), and nidas::core::DSMSensor::setDSMConfig().

Referenced by fromDOMElement().

◆ setDerivedDataSocketAddr()

void nidas::core::DSMConfig::setDerivedDataSocketAddr ( const nidas::util::SocketAddress & val)
inline

◆ setId()

void nidas::core::DSMConfig::setId ( dsm_sample_id_t val)
inline

References _id, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setLocation()

void nidas::core::DSMConfig::setLocation ( const std::string & val)
inline

References _location, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setName()

void nidas::core::DSMConfig::setName ( const std::string & val)
inline

References _name, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setProcHeapMax()

void nidas::core::DSMConfig::setProcHeapMax ( size_t val)
inline

Set the size of in bytes of the processed SampleSorter.

If the size of the sorter exceeds this value then samples will be discarded.

References _procHeapMax, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setProcLateSampleCacheSize()

void nidas::core::DSMConfig::setProcLateSampleCacheSize ( unsigned int val)
inline

Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter.

See SampleSorter::setLateSampleCacheSize(val).

References _procLateSampleCacheSize, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setProcSorterLength()

void nidas::core::DSMConfig::setProcSorterLength ( float val)
inline

Set the length of the SampleSorter of processed Samples, in seconds.

References _procSorterLength, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setRawHeapMax()

void nidas::core::DSMConfig::setRawHeapMax ( size_t val)
inline

Set the size of in bytes of the raw SampleSorter.

If the size of the sorter exceeds this value then samples will be discarded.

References _rawHeapMax, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setRawLateSampleCacheSize()

void nidas::core::DSMConfig::setRawLateSampleCacheSize ( unsigned int val)
inline

Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter.

See SampleSorter::setLateSampleCacheSize(val).

References _rawLateSampleCacheSize, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setRawSorterLength()

void nidas::core::DSMConfig::setRawSorterLength ( float val)
inline

Set the length of the SampleSorter of raw Samples, in seconds.

References _rawSorterLength, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setRemoteSerialSocketPort()

void nidas::core::DSMConfig::setRemoteSerialSocketPort ( unsigned short val)
inline

◆ setSite()

void nidas::core::DSMConfig::setSite ( const Site * val)
inline

References _site, and nidas::core::getSample().

◆ setStatusSocketAddr()

void nidas::core::DSMConfig::setStatusSocketAddr ( const nidas::util::SocketAddress & val)
inline

◆ toDOMElement()

xercesc::DOMElement * DSMConfig::toDOMElement ( xercesc::DOMElement * node,
bool complete ) const
virtual

◆ toDOMParent()

xercesc::DOMElement * DSMConfig::toDOMParent ( xercesc::DOMElement * parent,
bool complete ) const
virtual
Exceptions
xercesc::DOMException

Reimplemented from nidas::core::DOMable.

References nidas::core::DOMable::getNamespaceURI(), and toDOMElement().

Referenced by nidas::core::Site::toDOMElement().

◆ validate()

void DSMConfig::validate ( )

◆ validateSensorAndSampleIds()

void DSMConfig::validateSensorAndSampleIds ( )
private

Member Data Documentation

◆ _allSensors

std::list<DSMSensor*> nidas::core::DSMConfig::_allSensors
private

A list of all sensors configured on this DSM.

Referenced by addSensor(), getSensors(), initSensors(), and removeSensor().

◆ _derivedDataSocketAddr

nidas::util::SocketAddress* nidas::core::DSMConfig::_derivedDataSocketAddr
private

◆ _dictionary

nidas::core::DSMConfig::MyDictionary nidas::core::DSMConfig::_dictionary
private

◆ _id

unsigned int nidas::core::DSMConfig::_id
private

Referenced by getId(), and setId().

◆ _location

std::string nidas::core::DSMConfig::_location
private

Referenced by getLocation(), and setLocation().

◆ _name

std::string nidas::core::DSMConfig::_name
private

Referenced by getName(), and setName().

◆ _outputs

std::list<SampleOutput*> nidas::core::DSMConfig::_outputs
private

SampleOutputs.

Referenced by addOutput(), and getOutputs().

◆ _ownedSensors

std::list<DSMSensor*> nidas::core::DSMConfig::_ownedSensors
private

A list of the sensors on this DSM that have not been passed to a SensorHandler, i.e.

the sensors that DSMConfig still ownes. On a running DSM this list will be empty.

Referenced by addSensor(), openSensors(), removeSensor(), and ~DSMConfig().

◆ _processors

std::list<SampleIOProcessor*> nidas::core::DSMConfig::_processors
private

◆ _procHeapMax

size_t nidas::core::DSMConfig::_procHeapMax
private

Referenced by getProcHeapMax(), and setProcHeapMax().

◆ _procLateSampleCacheSize

unsigned int nidas::core::DSMConfig::_procLateSampleCacheSize
private

◆ _procSorterLength

float nidas::core::DSMConfig::_procSorterLength
private

◆ _rawHeapMax

size_t nidas::core::DSMConfig::_rawHeapMax
private

Referenced by getRawHeapMax(), and setRawHeapMax().

◆ _rawLateSampleCacheSize

unsigned int nidas::core::DSMConfig::_rawLateSampleCacheSize
private

◆ _rawSorterLength

float nidas::core::DSMConfig::_rawSorterLength
private

◆ _remoteSerialSocketPort

unsigned short nidas::core::DSMConfig::_remoteSerialSocketPort
private

TCP socket port that DSMEngine listens on for remote serial connections.

0=don't listen.

Referenced by getRemoteSerialSocketPort(), and setRemoteSerialSocketPort().

◆ _site

const Site* nidas::core::DSMConfig::_site
private

Referenced by getSite(), and setSite().

◆ _statusSocketAddr

nidas::util::SocketAddress* nidas::core::DSMConfig::_statusSocketAddr
private

◆ _suffix

std::string nidas::core::DSMConfig::_suffix
private

◆ namespaceURI

XMLCh * DOMable::namespaceURI = 0
staticprivateinherited

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