nidas v1.2.3
DSMServer.h
Go to the documentation of this file.
1// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
2// vim: set shiftwidth=4 softtabstop=4 expandtab:
3/*
4 ********************************************************************
5 ** NIDAS: NCAR In-situ Data Acquistion Software
6 **
7 ** 2005, Copyright University Corporation for Atmospheric Research
8 **
9 ** This program is free software; you can redistribute it and/or modify
10 ** it under the terms of the GNU General Public License as published by
11 ** the Free Software Foundation; either version 2 of the License, or
12 ** (at your option) any later version.
13 **
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ** GNU General Public License for more details.
18 **
19 ** The LICENSE.txt file accompanying this software contains
20 ** a copy of the GNU General Public License. If it is not found,
21 ** write to the Free Software Foundation, Inc.,
22 ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 **
24 ********************************************************************
25*/
26
27#ifndef NIDAS_CORE_DSMSERVER_H
28#define NIDAS_CORE_DSMSERVER_H
29
30#include "DOMable.h"
31#include "NidsIterators.h"
32#include "XMLException.h"
34
35#include <list>
36
37namespace nidas { namespace util {
38 class Thread;
39}}
40
41namespace nidas { namespace core {
42
43class Project;
44class Site;
45class DSMService;
46
50class DSMServer: public DOMable {
51public:
52
53 DSMServer();
54
55 virtual ~DSMServer();
56
57 const std::string& getName() const { return _name; }
58
59 void setName(const std::string& val) { _name = val; }
60
61 const std::string& getXMLConfigFileName() const { return _xmlFileName; }
62
63 void setXMLConfigFileName(const std::string& val) { _xmlFileName = val; }
64
65 void addService(DSMService* service) { _services.push_back(service); }
66
67 const std::list<DSMService*>& getServices() const { return _services; }
68
69 void setProject(Project* val) { _project = val; }
70
71 const Project* getProject() const { return _project; }
72
73 void setSite(const Site* val) { _site = val; }
74
75 const Site* getSite() const { return _site; }
76
78
80
82
84
86
90 void scheduleServices(bool optionalProcessing);
91
92 void interruptServices() throw();
93
94 void joinServices() throw();
95
96 void setStatusSocketAddr(const nidas::util::SocketAddress& val)
97 {
98 delete _statusSocketAddr;
100 }
101
103 {
104 return *_statusSocketAddr;
105 }
106
110 void fromDOMElement(const xercesc::DOMElement*);
111
112private:
113
118 std::string _name;
119
121
126 const Site* _site;
127
131 std::list<DSMService*> _services;
132
133 std::string _xmlFileName;
134
136
141
146
147};
148
149}} // namespace nidas namespace core
150
151#endif
Interface of an object that can be instantiated from a DOM element, via the fromDOMElement method,...
Definition DOMable.h:51
A provider of services to a DSM.
Definition DSMServer.h:50
const Site * getSite() const
Definition DSMServer.h:75
void interruptServices()
Definition DSMServer.cc:193
SampleTagIterator getSampleTagIterator() const
Definition DSMServer.cc:90
const std::list< DSMService * > & getServices() const
Definition DSMServer.h:67
void setProject(Project *val)
Definition DSMServer.h:69
void fromDOMElement(const xercesc::DOMElement *)
Definition DSMServer.cc:95
ProcessorIterator getProcessorIterator() const
Definition DSMServer.cc:78
DSMServer & operator=(const DSMServer &)
Assignment not supported.
void setName(const std::string &val)
Definition DSMServer.h:59
Project * _project
Definition DSMServer.h:120
const std::string & getXMLConfigFileName() const
Definition DSMServer.h:61
void setXMLConfigFileName(const std::string &val)
Definition DSMServer.h:63
DSMServer()
Definition DSMServer.cc:45
std::string _name
Name of this server.
Definition DSMServer.h:118
nidas::util::SocketAddress * _statusSocketAddr
Definition DSMServer.h:135
std::list< DSMService * > _services
The DSMServices that we've been configured to start.
Definition DSMServer.h:131
void addService(DSMService *service)
Definition DSMServer.h:65
void setSite(const Site *val)
Definition DSMServer.h:73
virtual ~DSMServer()
Definition DSMServer.cc:51
void addThread(nidas::util::Thread *thrd)
SensorIterator getSensorIterator() const
Definition DSMServer.cc:83
void setStatusSocketAddr(const nidas::util::SocketAddress &val)
Definition DSMServer.h:96
DSMServiceIterator getDSMServiceIterator() const
Definition DSMServer.cc:73
std::string _xmlFileName
Definition DSMServer.h:133
const Project * getProject() const
Definition DSMServer.h:71
void joinServices()
Definition DSMServer.cc:203
DSMServer(const DSMServer &)
Copy not supported.
const Site * _site
What Site to I serve? Can be NULL if this DSMServer is not for a specific Site, but serves the Projec...
Definition DSMServer.h:126
void scheduleServices(bool optionalProcessing)
Definition DSMServer.cc:182
const nidas::util::SocketAddress & getStatusSocketAddr() const
Definition DSMServer.h:102
const std::string & getName() const
Definition DSMServer.h:57
Class for iterating over the DSMServices of a DSMServer.
Definition NidsIterators.h:92
Base class for a service, as built from a <service> XML tag.
Definition DSMService.h:48
Class for iterating over the Processors of a DSMServer or DSMConfig.
Definition NidsIterators.h:150
Definition Project.h:60
Class for iterating over the SampleTags of a Project, Site, DSMConfig, or a SampleSource.
Definition NidsIterators.h:218
Class for iterating over the DSMSensors of a Project, Site, or DSMConfig.
Definition NidsIterators.h:186
A measurement site.
Definition Site.h:49
An interface for a socket address.
Definition SocketAddress.h:36
virtual SocketAddress * clone() const =0
Virtual constructor.
Definition Thread.h:83
Sample * getSample(sampleType type, unsigned int len)
A convienence method for getting a sample of an enumerated type from a pool.
Definition Sample.cc:70
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31