nidas  v1.2-1520
PacketInputStream.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_ISFF_PACKETINPUTSTREAM_H
28 #define NIDAS_DYNLD_ISFF_PACKETINPUTSTREAM_H
29 
30 #include "Packets.h"
32 
33 namespace nidas {
34 
35 namespace core {
36 class Sample;
37 class SampleTag;
38 class IOChannel;
39 class IOStream;
40 }
41 
42 namespace dynld { namespace isff {
43 
44 class GOESProject;
45 
47 {
48 
49 public:
50 
61 
66 
70  virtual PacketInputStream* clone(nidas::core::IOChannel* iochannel);
71 
72  virtual ~PacketInputStream();
73 
74  std::string getName() const;
75 
76  std::list<const nidas::core::SampleTag*> getSampleTags() const;
77 
78  void init() throw();
79 
86  {
87  throw nidas::util::IOException(getName(),"readSample","not supported");
88  }
89 
99  bool readSamples() throw(nidas::util::IOException);
100 
101  void close() throw(nidas::util::IOException);
102 
106  void flush() throw() {}
107 
108 private:
109 
110  const nidas::core::SampleTag* findSampleTag(int configId, int goesId, int sampleId)
112 
113  const GOESProject* getGOESProject(int configid) const
115 
117 
119 
121 
122  mutable std::map<int,GOESProject*> _projectsByConfigId;
123 
128 
133 
134 };
135 
136 }}} // namespace nidas namespace dynld namespace isff
137 
138 #endif
PacketInputStream(const PacketInputStream &x, nidas::core::IOChannel *iochannel)
Copy constructor, with a new, connected IOChannel.
Definition: PacketInputStream.cc:58
A base class for buffering data.
Definition: IOStream.h:41
const GOESProject * getGOESProject(int configid) const
Definition: PacketInputStream.cc:235
throw(nidas::util::InvalidParameterException)
Constructor.
An implementation of a SampleInput.
Definition: SampleInputStream.h:172
void init()
Definition: PacketInputStream.cc:97
PacketInputStream & operator=(const PacketInputStream &)
No assignment.
Definition: Packets.h:126
void flush()
Implementation of SampleSource::flush().
Definition: PacketInputStream.h:106
Definition: GOESProject.h:46
virtual PacketInputStream * clone(nidas::core::IOChannel *iochannel)
Create a clone, with a new, connected IOChannel.
Definition: PacketInputStream.cc:70
std::list< const nidas::core::SampleTag * > getSampleTags() const
What SampleTags am I a SampleSource for?
Definition: PacketInputStream.cc:91
Definition: PacketInputStream.h:46
nidas::core::Sample * readSample()
Read the next sample from the InputStream.
Definition: PacketInputStream.h:85
A channel for Input or Output of data.
Definition: IOChannel.h:64
void close()
Definition: PacketInputStream.cc:114
virtual ~PacketInputStream()
Definition: PacketInputStream.cc:75
std::string getName() const
Definition: PacketInputStream.cc:85
Interface to a data sample.
Definition: Sample.h:189
Definition: IOException.h:37
const nidas::core::SampleTag * findSampleTag(int configId, int goesId, int sampleId)
Definition: PacketInputStream.cc:265
Class describing a group of variables that are sampled and handled together.
Definition: SampleTag.h:87
nidas::core::IOStream * _iostream
Definition: PacketInputStream.h:118
bool readSamples()
Read a buffer of data, serialize the data into samples, and distribute() samples to the receive() met...
Definition: PacketInputStream.cc:123
nidas::core::IOChannel * _iochan
Definition: PacketInputStream.h:116
PacketParser * _packetParser
Definition: PacketInputStream.h:120
Definition: InvalidParameterException.h:35
std::map< int, GOESProject * > _projectsByConfigId
Definition: PacketInputStream.h:122