nidas  v1.2-1520
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 
31 #include <nidas/core/DSMService.h>
32 #include <nidas/core/Datagrams.h>
33 #include <nidas/core/IOChannel.h>
34 
35 namespace nidas { namespace dynld {
36 
37 using namespace nidas::core;
38 
40 {
41 public:
43 
45 
46  void interrupt() throw();
47 
48  IOChannelRequester* connected(IOChannel*) throw();
49 
50  void connect(SampleInput*) throw() { assert(false); }
51  void disconnect(SampleInput*) throw() { assert(false); }
52 
53  void schedule(bool optionalProcessing) throw(nidas::util::Exception);
54 
56  {
57  return XML_CONFIG;
58  }
59 
60 protected:
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() throw(nidas::util::Exception);
73  void interrupt();
74  private:
77  const DSMConfig* _dsm;
78  Worker(const Worker&);
79  Worker& operator=(const Worker&);
80  };
81 
82 private:
83 
88 
92  XMLConfigService& operator =(const XMLConfigService&);
93 
94 };
95 
96 }} // namespace nidas namespace core
97 
98 #endif
void connect(SampleInput *)
Definition: XMLConfigService.h:50
void disconnect(SampleInput *)
Definition: XMLConfigService.h:51
McSocketRequest
Definition: Datagrams.h:34
Class that should include all that is configurable about a DSM.
Definition: DSMConfig.h:55
IOChannel * _iochan
Definition: XMLConfigService.h:76
virtual McSocketRequest getRequestType() const
Definition: XMLConfigService.h:55
A channel for Input or Output of data.
Definition: IOChannel.h:64
Definition: Exception.h:35
Definition: Thread.h:80
const DSMConfig * _dsm
Definition: XMLConfigService.h:77
Worker thread that is run when a connection comes in.
Definition: XMLConfigService.h:67
Request for a TCP feed of the configuration in XML.
Definition: Datagrams.h:39
Definition: XMLConfigService.h:39
Base class for a service, as built from a &lt;service&gt; XML tag.
Definition: DSMService.h:47
Interface for an object that requests connections to Inputs or Outputs.
Definition: IOChannel.h:54
XMLConfigService(const std::string &name)
Definition: XMLConfigService.h:62
XMLConfigService * _svc
Definition: XMLConfigService.h:75
Interface of an input SampleSource.
Definition: SampleInput.h:47