nidas  v1.2-1520
NetcdfRPCOutput.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  ** 2006, 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 #include <nidas/Config.h>
28 
29 #ifdef HAVE_LIBNC_SERVER_RPC
30 
31 #ifndef NIDAS_DYNLD_ISFF_NETCDFRPCOUTPUT_H
32 #define NIDAS_DYNLD_ISFF_NETCDFRPCOUTPUT_H
33 
35 #include <nidas/util/UTime.h>
36 
37 namespace nidas { namespace dynld { namespace isff {
38 
39 using namespace nidas::core;
40 
41 class NetcdfRPCChannel;
42 
47 class NetcdfRPCOutput: public SampleOutputBase {
48 
49 public:
50 
51  NetcdfRPCOutput();
52 
56  NetcdfRPCOutput(IOChannel* ioc,SampleConnectionRequester* rqstr=0);
57 
61  ~NetcdfRPCOutput();
62 
66  void flush() throw() {}
67 
73  void requestConnection(SampleConnectionRequester*) throw(nidas::util::IOException);
74 
75  SampleOutput* connected(IOChannel* ioc) throw();
76 
80  size_t write(const void*, size_t)
81  throw (nidas::util::IOException)
82  {
83  throw nidas::util::IOException(getName(),"default write","not supported");
84  }
85 
89  bool receive(const Sample*) throw ();
90 
91  void fromDOMElement(const xercesc::DOMElement* node)
92  throw(nidas::util::InvalidParameterException);
93 
101  void
102  setTimeClippingWindow(const nidas::util::UTime& startTime,
103  const nidas::util::UTime& endTime);
104 
105 protected:
106 
110  NetcdfRPCOutput* clone(IOChannel* iochannel)
111  {
112  return new NetcdfRPCOutput(*this,iochannel);
113  }
114 
118  NetcdfRPCOutput(NetcdfRPCOutput&,IOChannel*);
119 
120  void setIOChannel(IOChannel* val);
121 
122 private:
123 
124  NetcdfRPCChannel* _ncChannel;
125 
130  dsm_time_t _startTime;
131  dsm_time_t _endTime;
132 
136  NetcdfRPCOutput(const NetcdfRPCOutput&);
137 
141  NetcdfRPCOutput& operator=(const NetcdfRPCOutput&);
142 
143 };
144 
145 }}} // namespace nidas namespace dynld namespace isff
146 
147 #endif
148 
149 #endif // HAVE_LIBNC_SERVER_RPC
Interface for an object that requests connections SampleOutputs.
Definition: ConnectionRequester.h:42
Interface of an output stream of samples.
Definition: SampleOutput.h:47
long long dsm_time_t
Posix time in microseconds, the number of non-leap microseconds since 1970 Jan 1 00:00 UTC...
Definition: Sample.h:61
Implementation of portions of SampleOutput.
Definition: SampleOutput.h:147
A channel for Input or Output of data.
Definition: IOChannel.h:64
Interface to a data sample.
Definition: Sample.h:189
Definition: IOException.h:37