nidas  v1.2-1520
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | 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. More...
 
const std::string & getName () const
 
void setNumber (int val)
 Identify the Site by number. More...
 
int getNumber () const
 
bool operator== (const Site &x) const
 Equivalence operator for Site, checks name. More...
 
bool operator!= (const Site &x) const
 Non-equivalence operator for Site. More...
 
bool operator< (const Site &x) const
 Less than operator for Site, compares the names. More...
 
void setSuffix (const std::string &val)
 Set the suffix for the Site. More...
 
const std::string & getSuffix () const
 
const ProjectgetProject () const
 Provide pointer to Project. More...
 
ProjectgetProject ()
 
void setProject (Project *val)
 Set the current project for this Site. More...
 
void addDSMConfig (DSMConfig *dsm)
 A Site contains one or more DSMs. More...
 
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. More...
 
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. More...
 
const DSMConfigfindDSM (const nidas::util::Inet4Address &addr) const
 Find a DSM whose name corresponds to a given IP address. More...
 
const DSMConfigfindDSM (unsigned int id) const
 Find a DSM by id. More...
 
const DSMConfigfindDSM (const std::string &name) const
 Find a DSM by name. More...
 
DSMSensorfindSensor (unsigned int id) const
 Find a DSMSensor by the full id, both the DSM id and the sensor id. More...
 
void initSensors () throw (nidas::util::IOException)
 Initialize all sensors for a Site. More...
 
void initSensors (DSMConfig *dsm) throw (nidas::util::IOException)
 Initialize all sensors for a given dsm. More...
 
virtual void addParameter (Parameter *val)
 Add a parameter to this Site. More...
 
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. More...
 
std::string expandString (const std::string &input) const
 Utility function to expand ${TOKEN} or $TOKEN fields in a string. More...
 
bool getTokenValue (const std::string &token, std::string &value) const
 Implement a lookup for tokens that I know about, like $SITE, and $AIRCRAFT. More...
 
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 () 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...
 

Static Public Member Functions

static const XMLCh * getNamespaceURI ()
 

Protected Attributes

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

Private Member Functions

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

Private Attributes

Project_project
 Pointer back to my project. More...
 
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. More...
 
std::list< const Parameter * > _constParameters
 List of const pointers to Parameters for providing via getParameters(). More...
 

Detailed Description

A measurement site.

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

Constructor & Destructor Documentation

Site::Site ( )
Site::~Site ( )
virtual

References _ncDsms, _parameterMap, and _servers.

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

Copy not supported.

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

Member Function Documentation

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.

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.

References _constParameters, _parameterMap, and nidas::core::Parameter::getName().

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

A Site has one or more DSMServers.

References _servers.

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 PConfig::getHostNames().

const DSMConfig * Site::findDSM ( const nidas::util::Inet4Address addr) const

Find a DSM whose name corresponds to a given IP address.

References _dsms, nidas::util::Inet4Address::getAllByName(), nidas::core::DSMConfig::getName(), and VLOG.

Referenced by nidas::core::Project::findDSM().

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

Find a DSM by name.

References _dsms, nidas::core::DSMConfig::getName(), and VLOG.

DSMSensor * Site::findSensor ( unsigned int  id) const
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::DSMServer::getName().

void Site::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtual
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.

Referenced by nidas::core::Variable::convert().

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

References _dictionary.

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

References _ncDsms.

DSMServerIterator Site::getDSMServerIterator ( ) const
DSMServiceIterator Site::getDSMServiceIterator ( ) const
const std::string& nidas::core::Site::getName ( ) const
inline
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
int nidas::core::Site::getNumber ( ) const
inline
const Parameter * Site::getParameter ( const std::string &  name) const
virtual

References _parameterMap.

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

References _constParameters.

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

References _project.

SampleTagIterator Site::getSampleTagIterator ( ) const
SensorIterator Site::getSensorIterator ( ) const
const std::list<DSMServer*>& nidas::core::Site::getServers ( ) const
inline
const std::string& nidas::core::Site::getSuffix ( ) const
inline
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().

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

VariableIterator Site::getVariableIterator ( ) const
void Site::initSensors ( )
throw (nidas::util::IOException
)

Initialize all sensors for a Site.

References getDSMConfigs(), and nidas::core::DSMConfig::initSensors().

Referenced by nidas::core::Project::initSensors().

void Site::initSensors ( DSMConfig dsm)
throw (nidas::util::IOException
)

Initialize all sensors for a given dsm.

References nidas::core::DSMConfig::initSensors().

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

Non-equivalence operator for Site.

References operator==().

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

Less than operator for Site, compares the names.

References _name.

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

Assignment not supported.

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

Equivalence operator for Site, checks name.

References _name, _number, and _suffix.

Referenced by operator!=().

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

References _dsms, and _ncDsms.

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

Set the name of the Site.

References _name.

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.

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

Set the current project for this Site.

References _project.

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

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.

xercesc::DOMElement * Site::toDOMElement ( xercesc::DOMElement *  node,
bool  complete 
) const
throw (xercesc::DOMException
)
virtual
xercesc::DOMElement * Site::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::Project::toDOMElement().

void Site::validate ( )
throw (nidas::util::InvalidParameterException
)

Member Data Documentation

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

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

Referenced by getApplyVariableConversions().

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

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

Referenced by addParameter(), and getParameters().

nidas::core::Site::MyDictionary nidas::core::Site::_dictionary
private
std::list<const DSMConfig*> nidas::core::Site::_dsms
private
std::string nidas::core::Site::_name
private
std::list<DSMConfig*> nidas::core::Site::_ncDsms
private
int nidas::core::Site::_number
private

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

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

Mapping of Parameters, by name.

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

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

Pointer back to my project.

Referenced by getProject(), and setProject().

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

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


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