nidas v1.2.3
SyncRecordGenerator.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_RAF_SYNCRECORDGENERATOR_H
28#define NIDAS_DYNLD_RAF_SYNCRECORDGENERATOR_H
29
31#include "SyncRecordSource.h"
32
33namespace nidas { namespace dynld { namespace raf {
34
35using namespace nidas::core;
36
38{
39public:
40
45
46 virtual ~SyncRecordGenerator();
47
51 void connectSource(SampleSource* source) override;
52
56 void disconnectSource(SampleSource* source) throw();
57
61 void connect(SampleOutput* output) throw();
62
66 void disconnect(SampleOutput* output) throw();
67
73 void sendHeader(dsm_time_t thead,SampleOutput* output);
74
75 void init(dsm_time_t sampleTime) throw();
76
77 std::list<const SampleTag*> getSampleTags() const
78 {
80 }
81
89
93 void addSampleClient(SampleClient* client) throw();
94
95 void removeSampleClient(SampleClient* client) throw()
96 {
98 }
99
104 void addSampleClientForTag(SampleClient* client,const SampleTag* tag) throw()
105 {
107 }
108
109 void removeSampleClientForTag(SampleClient* client,const SampleTag* tag) throw()
110 {
112 }
113
114 int getClientCount() const throw()
115 {
117 }
118
122 void flush() throw()
123 {
125 }
126
128 {
130 }
131
132 void printStatus(std::ostream&,float deltat,int&) throw();
133
136 {
137 return &_syncRecSource;
138 }
139
140protected:
141
142 void scanSensors(const std::list<DSMSensor*>& sensors);
143
145
146private:
147
149
150 std::set<SampleSource*> _connectedSources;
151
152 std::set<SampleOutput*> _connectedOutputs;
153
155
157
159
161
163
166
169
170};
171
172}}} // namespace nidas namespace dynld namespace raf
173
174#endif
An interface for sending a SampleHeader to a SampleOutput.
Definition HeaderSource.h:43
Pure virtual interface of a client of Samples.
Definition SampleClient.h:38
Interface of a processor of samples.
Definition SampleIOProcessor.h:50
Interface of an output stream of samples.
Definition SampleOutput.h:49
Pure virtual interface for a source of Samples.
Definition SampleSource.h:48
A source of samples.
Definition SampleStats.h:41
Class for iterating over the SampleTags of a Project, Site, DSMConfig, or a SampleSource.
Definition NidsIterators.h:218
Class describing a group of variables that are sampled and handled together.
Definition SampleTag.h:88
Definition SyncRecordGenerator.h:38
void connectSource(SampleSource *source) override
Implementation of SampleIOProcessor::connectSource(SampleSource*).
Definition SyncRecordGenerator.cc:80
void addSampleClient(SampleClient *client)
Implementation of SampleSource::addSampleClient().
Definition SyncRecordGenerator.cc:160
virtual ~SyncRecordGenerator()
Definition SyncRecordGenerator.cc:56
std::set< SampleSource * > _connectedSources
Definition SyncRecordGenerator.h:150
void disconnectSource(SampleSource *source)
Implementation of SampleIOProcessor::disconnectSource(SampleSource*).
Definition SyncRecordGenerator.cc:108
void disconnect(SampleOutput *output)
Implementation of SampleConnectionRequester::disconnect(SampleOutput*).
Definition SyncRecordGenerator.cc:127
SampleTagIterator getSampleTagIterator() const
Implementation of SampleSource::getSampleTagIterator().
Definition SyncRecordGenerator.h:85
SyncRecordSource * getSyncRecordSource()
Definition SyncRecordGenerator.h:135
SyncRecordGenerator & operator=(const SyncRecordGenerator &)
No assignment.
void init(dsm_time_t sampleTime)
Definition SyncRecordGenerator.cc:176
SyncRecordGenerator()
Constructor.
Definition SyncRecordGenerator.cc:46
nidas::util::Mutex _connectionMutex
Definition SyncRecordGenerator.h:148
std::set< SampleOutput * > _connectedOutputs
Definition SyncRecordGenerator.h:152
void allocateRecord(dsm_time_t timetag)
SyncRecordSource _syncRecSource
Definition SyncRecordGenerator.h:154
long long _numInputBytesLast
Definition SyncRecordGenerator.h:160
size_t _numInputSampsLast
Definition SyncRecordGenerator.h:156
void connect(SampleOutput *output)
Implementation of SampleConnectionRequester::connect(SampleOutput*).
Definition SyncRecordGenerator.cc:116
std::list< const SampleTag * > getSampleTags() const
Implementation of SampleSource::getSampleTags().
Definition SyncRecordGenerator.h:77
void removeSampleClient(SampleClient *client)
Remove a SampleClient from this SampleSource.
Definition SyncRecordGenerator.h:95
void removeSampleClientForTag(SampleClient *client, const SampleTag *tag)
Remove a SampleClient for a given SampleTag from this SampleSource.
Definition SyncRecordGenerator.h:109
void scanSensors(const std::list< DSMSensor * > &sensors)
int getClientCount() const
How many SampleClients are currently in my list.
Definition SyncRecordGenerator.h:114
long long _numOutputBytesLast
Definition SyncRecordGenerator.h:162
void flush()
Implementation of SampleSource::flush().
Definition SyncRecordGenerator.h:122
size_t _numOutputSampsLast
Definition SyncRecordGenerator.h:158
void addSampleClientForTag(SampleClient *client, const SampleTag *tag)
Add a Client for a given SampleTag.
Definition SyncRecordGenerator.h:104
SyncRecordGenerator(const SyncRecordGenerator &)
No copying.
void printStatus(std::ostream &, float deltat, int &)
Definition SyncRecordGenerator.cc:184
const SampleStats & getSampleStats() const
Definition SyncRecordGenerator.h:127
void sendHeader(dsm_time_t thead, SampleOutput *output)
Method called to write a header to an SampleOutput.
Definition SyncRecordGenerator.cc:169
Definition SyncRecordSource.h:56
void removeSampleClient(SampleClient *client)
Remove a SampleClient from this SampleSource.
Definition SyncRecordSource.h:244
void removeSampleClientForTag(SampleClient *client, const SampleTag *)
Remove a SampleClient for a given SampleTag from this SampleSource.
Definition SyncRecordSource.h:259
void addSampleClientForTag(SampleClient *client, const SampleTag *)
Add a Client for a given SampleTag.
Definition SyncRecordSource.h:253
int getClientCount() const
How many SampleClients are currently in my list.
Definition SyncRecordSource.h:264
const SampleStats & getSampleStats() const
Definition SyncRecordSource.h:275
void flush()
Implementation of Resampler::flush().
Definition SyncRecordSource.cc:628
std::list< const SampleTag * > getSampleTags() const
Get the output SampleTags.
Definition SyncRecordSource.h:223
SampleTagIterator getSampleTagIterator() const
Implementation of SampleSource::getSampleTagIterator().
Definition SyncRecordSource.h:231
A C++ wrapper for a POSIX mutex.
Definition ThreadSupport.h:161
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