nidas v1.2.3
XMLConfigService.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
28#ifndef NIDAS_DYNLD_XMLCONFIGSERVICE_H
29#define NIDAS_DYNLD_XMLCONFIGSERVICE_H
30
34
35namespace nidas { namespace dynld {
36
37using namespace nidas::core;
38
40{
41public:
43
45
46 void interrupt() throw();
47
49
50 void connect(SampleInput*) throw() { assert(false); }
51 void disconnect(SampleInput*) throw() { assert(false); }
52
53 void schedule(bool optionalProcessing);
54
56 {
57 return XML_CONFIG;
58 }
59
60protected:
61
62 XMLConfigService(const std::string& name): DSMService(name) {}
63
68 {
69 public:
70 Worker(XMLConfigService* svc,IOChannel* iochan,const DSMConfig* dsm = 0);
71 ~Worker();
72 int run();
73 void interrupt();
74 private:
78 Worker(const Worker&);
80 };
81
82private:
83
88
93
94};
95
96}} // namespace nidas namespace core
97
98#endif
Class that should include all that is configurable about a DSM.
Definition DSMConfig.h:55
Base class for a service, as built from a <service> XML tag.
Definition DSMService.h:48
Interface for an object that requests connections to Inputs or Outputs.
Definition IOChannel.h:56
A channel for Input or Output of data.
Definition IOChannel.h:65
Interface of an input SampleSource.
Definition SampleInput.h:48
Worker thread that is run when a connection comes in.
Definition XMLConfigService.h:68
void interrupt()
Interrupt this thread.
Definition XMLConfigService.cc:132
Worker(XMLConfigService *svc, IOChannel *iochan, const DSMConfig *dsm=0)
Definition XMLConfigService.cc:120
XMLConfigService * _svc
Definition XMLConfigService.h:75
~Worker()
Definition XMLConfigService.cc:126
const DSMConfig * _dsm
Definition XMLConfigService.h:77
int run()
The method which will run in its own thread.
Definition XMLConfigService.cc:140
IOChannel * _iochan
Definition XMLConfigService.h:76
Worker & operator=(const Worker &)
Definition XMLConfigService.h:40
void interrupt()
Definition XMLConfigService.cc:77
~XMLConfigService()
Definition XMLConfigService.cc:62
void connect(SampleInput *)
Definition XMLConfigService.h:50
XMLConfigService & operator=(const XMLConfigService &)
Assignment not supported.
void schedule(bool optionalProcessing)
schedule this service to run.
Definition XMLConfigService.cc:66
XMLConfigService(const XMLConfigService &)
Copying not supported.
void disconnect(SampleInput *)
Definition XMLConfigService.h:51
XMLConfigService()
Definition XMLConfigService.cc:57
IOChannelRequester * connected(IOChannel *)
Definition XMLConfigService.cc:87
virtual McSocketRequest getRequestType() const
Definition XMLConfigService.h:55
XMLConfigService(const std::string &name)
Definition XMLConfigService.h:62
Definition Thread.h:83
The essential core classes of nidas.
Definition A2DConverter.h:31
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
McSocketRequest
Definition Datagrams.h:34
@ XML_CONFIG
Request for a TCP feed of the configuration in XML.
Definition Datagrams.h:39
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31