nidas v1.2.3
AsciiOutput.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_DYNLD_ASCIIOUTPUT_H
28#define NIDAS_DYNLD_ASCIIOUTPUT_H
29
31
32#include <iostream>
33
34namespace nidas {
35
36namespace core {
37class SampleSource;
38}
39
40namespace dynld {
41
42using namespace nidas::core;
43
45{
46public:
47
50
52
54
55 virtual ~AsciiOutput() {}
56
60 void flush() throw() {}
61
62 void requestConnection(SampleConnectionRequester* requester) throw();
63
68
74 {
75 _format = val;
76 }
77
81 bool receive(const Sample* samp);
82
83protected:
84
85 AsciiOutput* clone(IOChannel* iochannel);
86
91
95 void printHeader();
96
97private:
98
99 std::ostringstream _ostr;
100
102
106 std::map<dsm_sample_id_t,dsm_time_t> _prevTT;
107
109
114
115};
116
117}} // namespace nidas namespace core
118
119#endif
A channel for Input or Output of data.
Definition IOChannel.h:65
Interface for an object that requests connections SampleOutputs.
Definition ConnectionRequester.h:43
Implementation of portions of SampleOutput.
Definition SampleOutput.h:160
Pure virtual interface for a source of Samples.
Definition SampleSource.h:48
Interface to a data sample.
Definition Sample.h:190
Definition AsciiOutput.h:45
void flush()
Implementation of SampleClient::flush().
Definition AsciiOutput.h:60
format_t _format
Definition AsciiOutput.h:101
enum nidas::dynld::AsciiOutput::format format_t
void connect(nidas::core::SampleSource *)
Definition AsciiOutput.cc:81
std::ostringstream _ostr
Definition AsciiOutput.h:99
AsciiOutput(const AsciiOutput &)
Copy constructor.
AsciiOutput()
Definition AsciiOutput.cc:44
AsciiOutput * clone(IOChannel *iochannel)
Definition AsciiOutput.cc:68
std::map< dsm_sample_id_t, dsm_time_t > _prevTT
Previous time tags by sample id.
Definition AsciiOutput.h:106
format
Definition AsciiOutput.h:48
@ IRIG
Definition AsciiOutput.h:49
@ SIGNED_SHORT
Definition AsciiOutput.h:48
@ HEX
Definition AsciiOutput.h:48
@ UNSIGNED_SHORT
Definition AsciiOutput.h:48
@ DEFAULT
Definition AsciiOutput.h:48
@ ASCII
Definition AsciiOutput.h:48
@ FLOAT
Definition AsciiOutput.h:49
void setFormat(format_t val)
Set the format for character samples.
Definition AsciiOutput.h:73
virtual ~AsciiOutput()
Definition AsciiOutput.h:55
void printHeader()
Definition AsciiOutput.cc:87
bool receive(const Sample *samp)
Definition AsciiOutput.cc:96
bool _headerOut
Definition AsciiOutput.h:108
void requestConnection(SampleConnectionRequester *requester)
Request a connection, of this SampleOutput, but don't wait for it.
Definition AsciiOutput.cc:74
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
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31