nidas v1.2.3
SampleInput.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#ifndef NIDAS_CORE_SAMPLEINPUT_H
28#define NIDAS_CORE_SAMPLEINPUT_H
29
30
31#include "SampleSource.h"
32#include "IOStream.h"
33#include "SampleSorter.h"
34#include "SampleInputHeader.h"
35
36namespace nidas { namespace core {
37
38class DSMConfig;
39class DSMSensor;
40
48{
49public:
50
51 virtual ~SampleInput() {}
52
53 virtual std::string getName() const = 0;
54
55 virtual void setKeepStats(bool val) = 0;
56
57 virtual const DSMConfig* getDSMConfig() const = 0;
58
59 // virtual void init() throw(nidas::util::IOException) = 0;
60
64 virtual void requestConnection(DSMService*) = 0;
65
66 virtual SampleInput* getOriginal() const = 0;
67
80 virtual bool readSamples() = 0;
81
88 virtual Sample* readSample() = 0;
89
93 virtual void close() = 0;
94
98 virtual void setNonBlocking(bool val) = 0;
99
103 virtual bool isNonBlocking() const = 0;
104
105 virtual int getFd() const = 0;
106
107};
108
109}} // namespace nidas namespace core
110
111#endif
Interface of an object that can be instantiated from a DOM element, via the fromDOMElement method,...
Definition DOMable.h:51
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
Interface of an input SampleSource.
Definition SampleInput.h:48
virtual const DSMConfig * getDSMConfig() const =0
virtual void requestConnection(DSMService *)=0
virtual bool readSamples()=0
Read a buffer of data, serialize the data into samples, and distribute() samples to the receive() met...
virtual void setNonBlocking(bool val)=0
virtual void setKeepStats(bool val)=0
virtual ~SampleInput()
Definition SampleInput.h:51
virtual bool isNonBlocking() const =0
virtual int getFd() const =0
virtual void close()=0
virtual std::string getName() const =0
virtual SampleInput * getOriginal() const =0
virtual Sample * readSample()=0
Blocking read of the next sample from the buffer.
Pure virtual interface for a source of Samples.
Definition SampleSource.h:48
Interface to a data sample.
Definition Sample.h:190
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31