nidas v1.2.3
SampleOutputStream.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_DYNLD_SAMPLEOUTPUTSTREAM_H
28#define NIDAS_DYNLD_SAMPLEOUTPUTSTREAM_H
29
30
32
33namespace nidas { namespace dynld {
34
35using namespace nidas::core;
36
41{
42public:
43
45
50
51 virtual ~SampleOutputStream();
52
57 SampleOutput* connected(IOChannel* ochan) throw();
58
68
72 void close();
73
74 bool receive(const Sample *s) throw();
75
76 void flush() throw();
77
81 size_t write(const void* buf, size_t len, bool streamFlush);
82
93 void setLatency(float val);
94
95protected:
96
98
103
107 size_t write(const Sample* samp, bool streamFlush);
108
110
111private:
112
117
122
127
132
133};
134
135}} // namespace nidas namespace core
136
137#endif
A channel for Input or Output of data.
Definition IOChannel.h:65
A base class for buffering data.
Definition IOStream.h:41
Interface for an object that requests connections SampleOutputs.
Definition ConnectionRequester.h:43
Implementation of portions of SampleOutput.
Definition SampleOutput.h:160
Interface of an output stream of samples.
Definition SampleOutput.h:49
Interface to a data sample.
Definition Sample.h:190
A class for serializing Samples on an OutputStream.
Definition SampleOutputStream.h:41
SampleOutputStream()
Definition SampleOutputStream.cc:44
virtual ~SampleOutputStream()
Definition SampleOutputStream.cc:76
SampleOutputStream * clone(IOChannel *iochannel)
Definition SampleOutputStream.cc:82
int _maxUsecs
Maximum number of microseconds between physical writes.
Definition SampleOutputStream.h:116
void setLatency(float val)
Outgoing data is buffered in an IOStream.
Definition SampleOutputStream.cc:96
dsm_time_t _lastFlushTT
Timetag of last flush of IOStream.
Definition SampleOutputStream.h:121
IOStream * getIOStream()
Get the IOStream of this SampleOutputStream.
Definition SampleOutputStream.h:67
SampleOutput * connected(IOChannel *ochan)
Implementation of IOChannelRequester::connected().
Definition SampleOutputStream.cc:105
void close()
Definition SampleOutputStream.cc:88
IOStream * _iostream
Definition SampleOutputStream.h:109
bool receive(const Sample *s)
Return true if SampleOutputBase considers the sample handled, such as if it is outside the clipping w...
Definition SampleOutputStream.cc:134
void flush()
Ask that this SampleClient send out any buffered Samples that it may be holding.
Definition SampleOutputStream.cc:120
size_t write(const void *buf, size_t len, bool streamFlush)
Definition SampleOutputStream.cc:175
The essential core classes of nidas.
Definition A2DConverter.h:31
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:62
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
int len
Definition sing.cc:948