nidas  v1.2-1520
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | 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 () throw (nidas::util::IOException)
 
void openSensors (SensorHandler *)
 Pass my sensors to the SensorHandler for opening. More...
 
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. More...
 
void setRawSorterLength (float val)
 Set the length of the SampleSorter of raw Samples, in seconds. More...
 
float getProcSorterLength () const
 Get the length of the SampleSorter of processed Samples, in seconds. More...
 
void setProcSorterLength (float val)
 Set the length of the SampleSorter of processed Samples, in seconds. More...
 
size_t getRawHeapMax () const
 Get the size of in bytes of the raw SampleSorter. More...
 
void setRawHeapMax (size_t val)
 Set the size of in bytes of the raw SampleSorter. More...
 
size_t getProcHeapMax () const
 Get the size of in bytes of the processed SampleSorter. More...
 
void setProcHeapMax (size_t val)
 Set the size of in bytes of the processed SampleSorter. More...
 
unsigned int getRawLateSampleCacheSize () const
 Get the size of the late sample cache in the raw sample sorter. More...
 
void setRawLateSampleCacheSize (unsigned int val)
 Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter. More...
 
unsigned int getProcLateSampleCacheSize () const
 Get the size of the late sample cache in the processed sample sorter. More...
 
void setProcLateSampleCacheSize (unsigned int val)
 Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter. More...
 
DSMSensorsensorFromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 Parse a DOMElement for a DSMSensor, returning a pointer to the DSMSensor. More...
 
void validate () throw (nidas::util::InvalidParameterException)
 
void fromDOMElement (const xercesc::DOMElement *) throw (nidas::util::InvalidParameterException)
 Initialize myself from a xercesc::DOMElement. More...
 
xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException)
 Create a DOMElement and append it to the parent. More...
 
xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException)
 Add my content into a DOMElement. More...
 
std::string expandString (const std::string &input) const
 Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue(). More...
 
bool getTokenValue (const std::string &token, std::string &value) const
 Implement a lookup for tokens that I know about, like $DSM, $LOCATION. More...
 
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. More...
 
virtual const std::list
< SampleIOProcessor * > & 
getProcessors () const
 
ProcessorIterator getProcessorIterator () const
 

Static Public Member Functions

static const XMLCh * getNamespaceURI ()
 

Private Member Functions

void validateSensorAndSampleIds () throw (nidas::util::InvalidParameterException)
 Validate the ids of the DSMSensors belonging to this DSMConfig, and their SampleTags, for uniqueness. More...
 
 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. More...
 
std::list< DSMSensor * > _allSensors
 A list of all sensors configured on this DSM. More...
 
std::list< SampleOutput * > _outputs
 SampleOutputs. More...
 
unsigned short _remoteSerialSocketPort
 TCP socket port that DSMEngine listens on for remote serial connections. More...
 
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
 

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::DSMConfig ( )
DSMConfig::~DSMConfig ( )
virtual
nidas::core::DSMConfig::DSMConfig ( const DSMConfig x)
private

Member Function Documentation

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

References _outputs.

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

Add a processor to this DSM.

This is done at configuration (XML) time.

References _processors.

void DSMConfig::addSensor ( DSMSensor sensor)
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().

list< nidas::core::FileSet * > DSMConfig::findSampleOutputStreamFileSets ( ) const
void DSMConfig::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtual
const nidas::util::SocketAddress& nidas::core::DSMConfig::getDerivedDataSocketAddr ( ) const
inline
const Dictionary& nidas::core::DSMConfig::getDictionary ( ) const
inline

References _dictionary.

dsm_sample_id_t nidas::core::DSMConfig::getId ( ) const
inline
const std::string& nidas::core::DSMConfig::getLocation ( ) const
inline
const std::string& nidas::core::DSMConfig::getName ( ) const
inline
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
const std::list<SampleOutput*>& nidas::core::DSMConfig::getOutputs ( ) const
inline
ProcessorIterator DSMConfig::getProcessorIterator ( ) const
virtual const std::list<SampleIOProcessor*>& nidas::core::DSMConfig::getProcessors ( ) const
inlinevirtual
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().

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().

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().

const Project * DSMConfig::getProject ( ) const
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().

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().

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().

unsigned short nidas::core::DSMConfig::getRemoteSerialSocketPort ( ) const
inline
SampleTagIterator DSMConfig::getSampleTagIterator ( ) const
SensorIterator DSMConfig::getSensorIterator ( ) const
const std::list<DSMSensor*>& nidas::core::DSMConfig::getSensors ( ) const
inline
const Site* nidas::core::DSMConfig::getSite ( ) const
inline
const nidas::util::SocketAddress& nidas::core::DSMConfig::getStatusSocketAddr ( ) const
inline
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().

Referenced by nidas::core::DSMSensor::MyDictionary::getTokenValue().

VariableIterator DSMConfig::getVariableIterator ( ) const
void DSMConfig::initSensors ( )
throw (nidas::util::IOException
)
void DSMConfig::openSensors ( SensorHandler selector)

Pass my sensors to the SensorHandler for opening.

References _ownedSensors, and nidas::core::SensorHandler::addSensor().

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

DSMConfig& nidas::core::DSMConfig::operator= ( const DSMConfig x)
private
void DSMConfig::removeSensor ( DSMSensor sensor)

References _allSensors, and _ownedSensors.

DSMSensor * DSMConfig::sensorFromDOMElement ( const xercesc::DOMElement *  node)
throw (nidas::util::InvalidParameterException
)
void nidas::core::DSMConfig::setDerivedDataSocketAddr ( const nidas::util::SocketAddress val)
inline
void nidas::core::DSMConfig::setId ( dsm_sample_id_t  val)
inline

References _id.

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

References _location.

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

References _name.

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.

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.

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

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

References _procSorterLength.

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.

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.

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

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

References _rawSorterLength.

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

References _site.

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

void nidas::core::DSMConfig::setStatusSocketAddr ( const nidas::util::SocketAddress val)
inline
xercesc::DOMElement * DSMConfig::toDOMElement ( xercesc::DOMElement *  node,
bool  complete 
) const
throw (xercesc::DOMException
)
virtual
xercesc::DOMElement * DSMConfig::toDOMParent ( xercesc::DOMElement *  parent,
bool  complete 
) const
throw (xercesc::DOMException
)
virtual

Create a DOMElement and append it to the parent.

Reimplemented from nidas::core::DOMable.

References nidas::core::DOMable::getNamespaceURI().

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

void DSMConfig::validate ( )
throw (nidas::util::InvalidParameterException
)
void DSMConfig::validateSensorAndSampleIds ( )
throw (nidas::util::InvalidParameterException
)
private

Member Data Documentation

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

A list of all sensors configured on this DSM.

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

nidas::util::SocketAddress* nidas::core::DSMConfig::_derivedDataSocketAddr
private
nidas::core::DSMConfig::MyDictionary nidas::core::DSMConfig::_dictionary
private
unsigned int nidas::core::DSMConfig::_id
private

Referenced by getId(), and setId().

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

Referenced by getLocation(), and setLocation().

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

Referenced by getName(), and setName().

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

SampleOutputs.

Referenced by addOutput(), and getOutputs().

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().

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

Referenced by getProcHeapMax(), and setProcHeapMax().

unsigned int nidas::core::DSMConfig::_procLateSampleCacheSize
private
float nidas::core::DSMConfig::_procSorterLength
private
size_t nidas::core::DSMConfig::_rawHeapMax
private

Referenced by getRawHeapMax(), and setRawHeapMax().

unsigned int nidas::core::DSMConfig::_rawLateSampleCacheSize
private
float nidas::core::DSMConfig::_rawSorterLength
private
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().

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

Referenced by getSite(), and setSite().

nidas::util::SocketAddress* nidas::core::DSMConfig::_statusSocketAddr
private
std::string nidas::core::DSMConfig::_suffix
private

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