27 #ifndef NIDAS_CORE_PROJECT_H
28 #define NIDAS_CORE_PROJECT_H
43 #define ACCESS_AS_SINGLETON
45 namespace nidas {
namespace core {
76 #ifdef ACCESS_AS_SINGLETON
127 std::list<DSMServer*>
findServers(
const std::string& hostname)
const;
177 const std::
string& dsmName) const;
251 throw(nidas::util::InvalidParameterException);
254 toDOMParent(xercesc::DOMElement* parent,
bool complete) const
255 throw(xercesc::DOMException);
258 toDOMElement(xercesc::DOMElement* node,
bool complete) const
259 throw(xercesc::DOMException);
328 #ifdef ACCESS_AS_SINGLETON
357 bool getTokenValue(
const std::string& token, std::string& value)
const;
374 mutable std::map<dsm_sample_id_t,const DSMConfig*>
_dsmById;
DSMConfigIterator getDSMConfigIterator() const
Definition: Project.cc:200
Class for iterating over the DSMServers of a Project.
Definition: NidsIterators.h:66
std::list< nidas::core::FileSet * > findSampleOutputStreamFileSets() const
Find SampleOutputStreamFileSets of all DSMs.
Definition: Project.cc:502
Interface for a Dictionary class, which can return a string value for a string token name...
Definition: Dictionary.h:38
Project & operator=(const Project &)
Assignment not supported.
void addSite(Site *val)
Definition: Project.cc:142
void removeAutoConfig(xercesc::DOMNode *node, bool bumpRecursion=false)
Scan the DOM and pull out any <autoconfig> tags, as well as change the autoconfig classes back to DSM...
Definition: Project.cc:717
SampleTagIterator getSampleTagIterator() const
Definition: Project.cc:210
void setConfigName(const std::string &val)
Definition: Project.h:97
ProcessorIterator getProcessorIterator() const
Definition: Project.cc:190
int _minSiteNumber
Definition: Project.h:388
static Project * _instance
Definition: Project.h:329
ServiceCatalog * _serviceCatalog
Definition: Project.h:368
SensorIterator getSensorIterator() const
Definition: Project.cc:205
std::list< Site * > _sites
Definition: Project.h:362
xercesc::DOMDocument * parseXMLConfigFile(const std::string &xmlFileName)
Utility function which creates a temporary XMLParser, sets the options we typically want and parses t...
Definition: XMLParser.cc:269
Site * findSite(int stationNumber) const
Find a Site with the given station number.
Definition: Project.cc:162
unsigned int dsm_sample_id_t
Definition: Sample.h:63
VariableIterator getVariableIterator() const
Definition: Project.cc:215
DSMSensor * findSensor(dsm_sample_id_t id) const
Definition: Project.cc:578
void addServer(DSMServer *srvr)
A Project has one or more DSMServers.
Definition: Project.h:118
A catalog of dsm DOMElements, implemented with std::map, containing dsm DOMElements, keyed by the ID attributes.
Definition: ServiceCatalog.h:41
std::map< int, Site * > _siteByStationNumber
Definition: Project.h:380
int _maxSiteNumber
Definition: Project.h:386
Exception which can be built from an xerces::XMLException, xercesc::SAXException, or xercesc::DOMExce...
Definition: XMLException.h:43
void disableAutoconfig(bool disable)
When true, autoconfig elements in the config document are removed before realizing the Project with f...
Definition: Project.h:303
Implementation of an IOChannel using an nidas::util::FileSet.
Definition: FileSet.h:42
A measurement site.
Definition: Site.h:49
dsm_sample_id_t getUniqueSampleId(unsigned int dsmid)
Get a temporary unique sample id for a given DSM id.
Definition: Project.cc:606
void fromDOMElement(const xercesc::DOMElement *)
Initialize myself from a xercesc::DOMElement.
Definition: Project.cc:847
void initSensors()
Initialize all sensors for a Project.
Definition: Project.cc:223
DSMServerIterator getDSMServerIterator() const
Definition: Project.cc:180
const std::string & getConfigVersion() const
Definition: Project.h:95
void setSystemName(const std::string &val)
Definition: Project.h:91
Class that should include all that is configurable about a DSM.
Definition: DSMConfig.h:55
Class for iterating over the Variables of a Project, Site, DSMConfig, DSMSensor, or SampleTag...
Definition: NidsIterators.h:286
A Dataset is a named collection of parameters, that are used in data processing.
Definition: Datasets.h:47
const std::list< DSMServer * > & getServers() const
Definition: Project.h:120
Interface of an object that can be instantiated from a DOM element, via the fromDOMElement method...
Definition: DOMable.h:51
std::list< nidas::core::FileSet * > findServerSampleOutputStreamFileSets() const
Call findServerSampleOutputStreamFileSets(name) passing the nodename returned by uname(2).
Definition: Project.cc:566
ServiceCatalog * getServiceCatalog() const
Definition: Project.h:215
xercesc::DOMElement * toDOMElement(xercesc::DOMElement *node, bool complete) const
Add my content into a DOMElement.
Definition: Project.cc:1015
std::string expandString(const std::string &input) const
Utility function that scans a string for tokens like ${XXXX}, or $XXX followed by any characters from...
Definition: Dictionary.cc:33
DSMCatalog * _dsmCatalog
Definition: Project.h:366
Project * _project
Definition: Project.h:359
void throw(nidas::core::XMLException)
Convenient method to fill this Project instance from the configuration in the XML file at xmlfilepath...
Definition: Project.cc:120
const std::string & getName() const
Definition: Project.h:89
SensorCatalog * getSensorCatalog() const
Definition: Project.h:209
void addParameter(Parameter *val)
Add a parameter to this Project.
Definition: Project.h:314
const Parameter * getParameter(const std::string &name) const
Definition: Project.cc:630
int getMinSiteNumber() const
Definition: Project.h:113
std::map< dsm_sample_id_t, DSMSensor * > _sensorById
Definition: Project.h:378
int getMaxSiteNumber() const
Convenience function to return the maximum site number.
Definition: Project.h:111
void setSensorCatalog(SensorCatalog *val)
Definition: Project.h:208
std::string expandString(const std::string &input) const
Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue(...
Definition: Project.h:268
Class for iterating over the Processors of a DSMServer or DSMConfig.
Definition: NidsIterators.h:149
SiteIterator getSiteIterator() const
Definition: Project.cc:195
void setConfigVersion(const std::string &val)
Definition: Project.h:94
Class for iterating over the DSMServices of a DSMServer.
Definition: NidsIterators.h:91
nidas::util::Mutex _lookupLock
Definition: Project.h:372
DSMServer * findServer(const nidas::util::Inet4Address &addr) const
Definition: Project.cc:321
SensorCatalog * _sensorCatalog
Definition: Project.h:364
std::list< DSMServer * > _servers
Definition: Project.h:370
MyDictionary & operator=(const MyDictionary &rhs)
Definition: Project.h:349
std::list< DSMServer * > findServers(const std::string &hostname) const
Look for a server for this project that either has no name or whose name matches hostname.
Definition: Project.cc:265
void setServiceCatalog(ServiceCatalog *val)
Definition: Project.h:214
bool _disableAutoconfig
Definition: Project.h:400
const DSMConfig * findDSM(const nidas::util::Inet4Address &addr) const
Find a DSM whose name corresponds to a given IP address.
Definition: Project.cc:340
void setDSMCatalog(DSMCatalog *val)
Definition: Project.h:211
std::string _flightName
Definition: Project.h:343
DSMSensor provides the basic support for reading, processing and distributing samples from a sensor a...
Definition: DSMSensor.h:87
Definition: Parameter.h:46
void setDataset(const Dataset &val)
Definition: Project.h:288
xercesc::DOMElement * toDOMParent(xercesc::DOMElement *parent, bool complete) const
Create a DOMElement and append it to the parent.
Definition: Project.cc:1004
Class for iterating over the Sites of a Project, or the Sites served by a DSMServer.
Definition: NidsIterators.h:45
std::string _name
Definition: Project.h:332
void setName(const std::string &val)
Definition: Project.h:88
static void destroyInstance()
Destory the singleton.
Definition: Project.cc:69
std::map< dsm_sample_id_t, const DSMConfig * > _dsmById
Definition: Project.h:374
std::map< std::string, Site * > _siteByName
Definition: Project.h:382
Class for iterating over the SampleTags of a Project, Site, DSMConfig, or a SampleSource.
Definition: NidsIterators.h:217
MyDictionary(Project *project)
Definition: Project.h:347
std::set< dsm_sample_id_t > _usedIds
Definition: Project.h:384
Class describing a group of variables that are sampled and handled together.
Definition: SampleTag.h:87
Dataset _dataset
The current dataset.
Definition: Project.h:398
std::string _sysname
Definition: Project.h:334
Class for iterating over the DSMSensors of a Project, Site, or DSMConfig.
Definition: NidsIterators.h:185
DSMCatalog * getDSMCatalog() const
Definition: Project.h:212
A catalog of DSM DOMElements, implemented with std::map, containing dsm DOMElements, keyed by the ID attributes.
Definition: DSMCatalog.h:41
DSMServiceIterator getDSMServiceIterator() const
Definition: Project.cc:185
std::string _configVersion
Definition: Project.h:336
const Dataset & getDataset() const
Definition: Project.h:293
void setFlightName(const std::string &val)
Definition: Project.h:100
virtual ~Project()
Definition: Project.cc:90
nidas::core::Project::MyDictionary _dictionary
const std::string & getSystemName() const
Definition: Project.h:92
A provider of services to a DSM.
Definition: DSMServer.h:50
Class for iterating over the DSMConfigs of a Project or Site.
Definition: NidsIterators.h:124
Definition: Project.h:345
bool getTokenValue(const std::string &token, std::string &value) const
Implement a lookup for tokens that I know about, like $PROJECT, and $SYSTEM.
Definition: Project.h:278
Project()
Definition: Project.cc:76
A C++ wrapper for a POSIX mutex.
Definition: ThreadSupport.h:154
const Dictionary & getDictionary() const
Definition: Project.h:283
DSMConfig * findDSMFromHostname(const std::string &hostname)
Find a DSMConfig in any site in this project whose name matches the given hostname.
Definition: Project.cc:463
Support for IP version 4 host address.
Definition: Inet4Address.h:46
std::string _configName
Name of XML file that this project was initialized from.
Definition: Project.h:341
std::list< Parameter * > _parameters
List of pointers to Parameters.
Definition: Project.h:393
nidas::util::Mutex _sensorMapLock
Definition: Project.h:376
const std::list< Site * > & getSites() const
Definition: Project.h:106
MyDictionary(const MyDictionary &x)
Definition: Project.h:348
bool getTokenValue(const std::string &token, std::string &value) const
Definition: Project.cc:1030
const std::string & getConfigName() const
Definition: Project.h:98
A catalog of sensor DOMElements, implemented with std::map, containing sensor DOMElements, keyed by the ID attributes.
Definition: SensorCatalog.h:41
const std::string & getFlightName() const
Definition: Project.cc:131
static Project * getInstance()
Project is a singleton.
Definition: Project.cc:62