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

A measurement site. More...

#include <Site.h>

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

Classes

class  MyDictionary
 

Public Member Functions

 Site ()
 
virtual ~Site ()
 
void setName (const std::string &val)
 Set the name of the Site.
 
const std::string & getName () const
 
void setNumber (int val)
 Identify the Site by number.
 
int getNumber () const
 
bool operator== (const Site &x) const
 Equivalence operator for Site, checks name.
 
bool operator!= (const Site &x) const
 Non-equivalence operator for Site.
 
bool operator< (const Site &x) const
 Less than operator for Site, compares the names.
 
void setSuffix (const std::string &val)
 Set the suffix for the Site.
 
const std::string & getSuffix () const
 
const ProjectgetProject () const
 Provide pointer to Project.
 
ProjectgetProject ()
 
void setProject (Project *val)
 Set the current project for this Site.
 
void addDSMConfig (DSMConfig *dsm)
 A Site contains one or more DSMs.
 
void removeDSMConfig (DSMConfig *dsm)
 
const std::list< const DSMConfig * > & getDSMConfigs () const
 
const std::list< DSMConfig * > & getDSMConfigs ()
 
void addServer (DSMServer *srvr)
 A Site has one or more DSMServers.
 
const std::list< DSMServer * > & getServers () const
 
DSMServerfindServer (const std::string &hostname) const
 Look for a server on this aircraft that either has no name or whose name matches hostname.
 
const DSMConfigfindDSM (unsigned int id) const
 Find a DSM by id.
 
const DSMConfigfindDSM (const std::string &name) const
 Find a DSM by name.
 
DSMSensorfindSensor (unsigned int id) const
 Find a DSMSensor by the full id, both the DSM id and the sensor id.
 
void initSensors ()
 Initialize all sensors for a Site.
 
void initSensors (DSMConfig *dsm)
 Initialize all sensors for a given dsm.
 
virtual void addParameter (Parameter *val)
 Add a parameter to this Site.
 
virtual const ParametergetParameter (const std::string &name) const
 
virtual const std::list< const Parameter * > & getParameters () const
 
virtual bool getApplyVariableConversions () const
 Do we want DSMSensor::process methods at this site to apply variable conversions? Currently on raf.Aircraft we don't want process methods to apply the conversions.
 
std::string expandString (const std::string &input) const
 Utility function to expand ${TOKEN} or $TOKEN fields in a string.
 
bool getTokenValue (const std::string &token, std::string &value) const
 Implement a lookup for tokens that I know about, like $SITE, and $AIRCRAFT.
 
const DictionarygetDictionary () const
 
DSMServerIterator getDSMServerIterator () const
 
DSMServiceIterator getDSMServiceIterator () const
 
ProcessorIterator getProcessorIterator () const
 
DSMConfigIterator getDSMConfigIterator () const
 
SensorIterator getSensorIterator () const
 
SampleTagIterator getSampleTagIterator () const
 
VariableIterator getVariableIterator () const
 
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
 

Static Public Member Functions

static const XMLChgetNamespaceURI ()
 

Protected Attributes

bool _applyCals
 Should NIDAS apply calibrations, or defer them to other processing.
 

Private Member Functions

 Site (const Site &)
 Copy not supported.
 
Siteoperator= (const Site &)
 Assignment not supported.
 

Private Attributes

Project_project
 Pointer back to my project.
 
std::string _name
 
int _number
 
std::string _suffix
 
nidas::core::Site::MyDictionary _dictionary
 
std::list< const DSMConfig * > _dsms
 
std::list< DSMConfig * > _ncDsms
 
std::list< DSMServer * > _servers
 
std::map< std::string, Parameter * > _parameterMap
 Mapping of Parameters, by name.
 
std::list< const Parameter * > _constParameters
 List of const pointers to Parameters for providing via getParameters().
 

Static Private Attributes

static XMLChnamespaceURI = 0
 

Detailed Description

A measurement site.

It could be an Aircraft, or a grouping of measurement systems (e.g. "meadow" site).

Constructor & Destructor Documentation

◆ Site() [1/2]

Site::Site ( )

◆ ~Site()

Site::~Site ( )
virtual

◆ Site() [2/2]

nidas::core::Site::Site ( const Site & )
private

Copy not supported.

See Project copy constructor: Project(const Project&);

Member Function Documentation

◆ addDSMConfig()

void nidas::core::Site::addDSMConfig ( DSMConfig * dsm)
inline

A Site contains one or more DSMs.

Site will own the pointer and will delete the DSMConfig in its destructor.

References _dsms, and _ncDsms.

Referenced by fromDOMElement().

◆ addParameter()

void Site::addParameter ( Parameter * val)
virtual

Add a parameter to this Site.

Site will then own the pointer and will delete it in its destructor.

Reimplemented in nidas::dynld::raf::Aircraft.

References _constParameters, _parameterMap, and nidas::core::getSample().

Referenced by nidas::dynld::raf::Aircraft::addParameter(), and fromDOMElement().

◆ addServer()

void nidas::core::Site::addServer ( DSMServer * srvr)
inline

A Site has one or more DSMServers.

References _servers.

Referenced by fromDOMElement().

◆ expandString()

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

Utility function to expand ${TOKEN} or $TOKEN fields in a string.

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

◆ findDSM() [1/2]

const DSMConfig * Site::findDSM ( const std::string & name) const

Find a DSM by name.

References _dsms, findDSM(), nidas::core::getSample(), and VLOG.

◆ findDSM() [2/2]

const DSMConfig * Site::findDSM ( unsigned int id) const

Find a DSM by id.

References _dsms, nidas::core::getSample(), and VLOG.

Referenced by findDSM().

◆ findSensor()

DSMSensor * Site::findSensor ( unsigned int id) const

◆ findServer()

DSMServer * Site::findServer ( const std::string & hostname) const

Look for a server on this aircraft that either has no name or whose name matches hostname.

If none found, remove any domain names and try again.

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

◆ fromDOMElement()

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

◆ getApplyVariableConversions()

virtual bool nidas::core::Site::getApplyVariableConversions ( ) const
inlinevirtual

Do we want DSMSensor::process methods at this site to apply variable conversions? Currently on raf.Aircraft we don't want process methods to apply the conversions.

References _applyCals.

◆ getDictionary()

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

References _dictionary.

◆ getDSMConfigIterator()

DSMConfigIterator Site::getDSMConfigIterator ( ) const

Referenced by toDOMElement().

◆ getDSMConfigs() [1/2]

const std::list< DSMConfig * > & nidas::core::Site::getDSMConfigs ( )
inline

References _ncDsms.

◆ getDSMConfigs() [2/2]

const std::list< const DSMConfig * > & nidas::core::Site::getDSMConfigs ( ) const
inline

◆ getDSMServerIterator()

DSMServerIterator Site::getDSMServerIterator ( ) const

◆ getDSMServiceIterator()

DSMServiceIterator Site::getDSMServiceIterator ( ) const

◆ getName()

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

◆ getNamespaceURI()

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

◆ getNumber()

int nidas::core::Site::getNumber ( ) const
inline

References _number.

Referenced by toDOMElement().

◆ getParameter()

const Parameter * Site::getParameter ( const std::string & name) const
virtual

◆ getParameters()

const list< const Parameter * > & Site::getParameters ( ) const
virtual

References _constParameters.

◆ getProcessorIterator()

ProcessorIterator Site::getProcessorIterator ( ) const

◆ getProject() [1/2]

Project * nidas::core::Site::getProject ( )
inline

References _project.

◆ getProject() [2/2]

const Project * nidas::core::Site::getProject ( ) const
inline

Provide pointer to Project.

References _project.

Referenced by fromDOMElement(), and nidas::core::Site::MyDictionary::getTokenValue().

◆ getSampleTagIterator()

SampleTagIterator Site::getSampleTagIterator ( ) const

◆ getSensorIterator()

SensorIterator Site::getSensorIterator ( ) const

Referenced by findSensor().

◆ getServers()

const std::list< DSMServer * > & nidas::core::Site::getServers ( ) const
inline

References _servers.

◆ getSuffix()

const std::string & nidas::core::Site::getSuffix ( ) const
inline

References _suffix.

◆ getTokenValue()

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

Implement a lookup for tokens that I know about, like $SITE, and $AIRCRAFT.

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

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

◆ getVariableIterator()

VariableIterator Site::getVariableIterator ( ) const

◆ initSensors() [1/2]

void Site::initSensors ( )

Initialize all sensors for a Site.

Exceptions
nidas::util::IOException

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

◆ initSensors() [2/2]

void Site::initSensors ( DSMConfig * dsm)

Initialize all sensors for a given dsm.

Exceptions
nidas::util::IOException

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

◆ operator!=()

bool nidas::core::Site::operator!= ( const Site & x) const
inline

Non-equivalence operator for Site.

References operator==().

◆ operator<()

bool nidas::core::Site::operator< ( const Site & x) const
inline

Less than operator for Site, compares the names.

References _name.

◆ operator=()

Site & nidas::core::Site::operator= ( const Site & )
private

Assignment not supported.

◆ operator==()

bool nidas::core::Site::operator== ( const Site & x) const
inline

Equivalence operator for Site, checks name.

References _name, _number, and _suffix.

Referenced by operator!=().

◆ removeDSMConfig()

void nidas::core::Site::removeDSMConfig ( DSMConfig * dsm)
inline

◆ setName()

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

Set the name of the Site.

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

Referenced by fromDOMElement().

◆ setNumber()

void nidas::core::Site::setNumber ( int val)
inline

Identify the Site by number.

The site number can be used for things like a NetCDF station dimension.

Parameters
Sitenumber, 0 means no number is associated with the site.

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

Referenced by fromDOMElement().

◆ setProject()

void nidas::core::Site::setProject ( Project * val)
inline

Set the current project for this Site.

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

◆ setSuffix()

void nidas::core::Site::setSuffix ( const std::string & val)
inline

Set the suffix for the Site.

All variable names from this site will have the suffix.

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

Referenced by fromDOMElement().

◆ toDOMElement()

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

◆ toDOMParent()

xercesc::DOMElement * Site::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::Project::toDOMElement().

◆ validate()

void Site::validate ( )

Member Data Documentation

◆ _applyCals

bool nidas::core::Site::_applyCals
protected

Should NIDAS apply calibrations, or defer them to other processing.

Referenced by fromDOMElement(), and getApplyVariableConversions().

◆ _constParameters

std::list<const Parameter*> nidas::core::Site::_constParameters
private

List of const pointers to Parameters for providing via getParameters().

Referenced by addParameter(), and getParameters().

◆ _dictionary

nidas::core::Site::MyDictionary nidas::core::Site::_dictionary
private

◆ _dsms

std::list<const DSMConfig*> nidas::core::Site::_dsms
private

◆ _name

std::string nidas::core::Site::_name
private

◆ _ncDsms

std::list<DSMConfig*> nidas::core::Site::_ncDsms
private

◆ _number

int nidas::core::Site::_number
private

Referenced by getNumber(), operator==(), and setNumber().

◆ _parameterMap

std::map<std::string,Parameter*> nidas::core::Site::_parameterMap
private

Mapping of Parameters, by name.

Referenced by addParameter(), getParameter(), and ~Site().

◆ _project

Project* nidas::core::Site::_project
private

Pointer back to my project.

Referenced by getProject(), getProject(), and setProject().

◆ _servers

std::list<DSMServer*> nidas::core::Site::_servers
private

◆ _suffix

std::string nidas::core::Site::_suffix
private

Referenced by getSuffix(), operator==(), and setSuffix().

◆ namespaceURI

XMLCh * DOMable::namespaceURI = 0
staticprivateinherited

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