nidas v1.2.3
StatisticsProcessor.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_STATISTICSPROCESSOR_H
28#define NIDAS_DYNLD_STATISTICSPROCESSOR_H
29
31#include "StatisticsCruncher.h"
32#include <nidas/util/UTime.h>
33
34namespace nidas { namespace dynld {
35
36using namespace nidas::core;
37
44{
45public:
46
48
50
59
60 void selectRequestedSampleTags(const std::vector<unsigned int>& sampleIds);
61
72 void connectSource(SampleSource*) override;
73
78 void disconnectSource(SampleSource*) throw();
79
86 void connect(SampleOutput* output) throw();
87
94 void disconnect(SampleOutput* output) throw();
95
100 void flush() throw();
101
103 {
104 _startTime = val;
105 }
106
108 {
109 return _startTime;
110 }
111
113 {
114 _endTime = val;
115 }
116
118 {
119 return _endTime;
120 }
121
122 float getPeriod() const
123 {
124 return _statsPeriod;
125 }
126
134 bool getFillGaps() const
135 {
136 return _fillGaps;
137 }
138
139 void setFillGaps(bool val)
140 {
141 _fillGaps = val;
142 }
143
151 std::string getUniqueCountsName(const std::string& val);
152
153protected:
154
158 /*
159 void addSampleTag(SampleTag* tag)
160 throw(nidas::util::InvalidParameterException);
161 */
162
163private:
164
166
167 std::set<SampleSource*> _connectedSources;
168
169 std::set<SampleOutput*> _connectedOutputs;
170
171
172 std::list<StatisticsCruncher*> _crunchers;
173
181
182 std::map<dsm_sample_id_t,struct OutputInfo> _infoBySampleId;
183
185
187
189
191
195 std::set<std::string> _cntsNames;
196
201
206
207};
208
209}} // namespace nidas namespace core
210
211#endif
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
Class describing a group of variables that are sampled and handled together.
Definition SampleTag.h:88
Definition StatisticsCruncher.h:48
enum nidas::dynld::StatisticsCruncher::statsEnumType statisticsType
Types of statistics I can generate.
Interface of a processor of samples.
Definition StatisticsProcessor.h:44
nidas::util::UTime getEndTime() const
Definition StatisticsProcessor.h:117
StatisticsProcessor(const StatisticsProcessor &)
Copy not supported.
void addRequestedSampleTag(SampleTag *tag)
Request a sample from this StatisticsProcessor, containing Parameters indicating what variables to pr...
Definition StatisticsProcessor.cc:109
nidas::util::UTime getStartTime() const
Definition StatisticsProcessor.h:107
void setStartTime(const nidas::util::UTime &val)
Definition StatisticsProcessor.h:102
std::set< std::string > _cntsNames
Set of counts variables for output samples.
Definition StatisticsProcessor.h:195
nidas::util::UTime _endTime
Definition StatisticsProcessor.h:186
void setEndTime(const nidas::util::UTime &val)
Definition StatisticsProcessor.h:112
float _statsPeriod
Definition StatisticsProcessor.h:188
nidas::util::Mutex _cruncherListMutex
Implementation of SampleIOProcessor::addSampleTag(SampleTag*).
Definition StatisticsProcessor.h:165
void selectRequestedSampleTags(const std::vector< unsigned int > &sampleIds)
Definition StatisticsProcessor.cc:272
void connect(SampleOutput *output)
Implementation of SampleConnectionRequester::connect.
Definition StatisticsProcessor.cc:491
StatisticsProcessor & operator=(const StatisticsProcessor &)
Assignment not supported.
bool getFillGaps() const
Whether to generate output samples over time gaps.
Definition StatisticsProcessor.h:134
std::map< dsm_sample_id_t, struct OutputInfo > _infoBySampleId
Definition StatisticsProcessor.h:182
StatisticsProcessor()
Definition StatisticsProcessor.cc:46
~StatisticsProcessor()
Definition StatisticsProcessor.cc:56
std::list< StatisticsCruncher * > _crunchers
Definition StatisticsProcessor.h:172
void disconnect(SampleOutput *output)
Implementation of SampleConnectionRequester::disconnect.
Definition StatisticsProcessor.cc:507
nidas::util::UTime _startTime
Definition StatisticsProcessor.h:184
float getPeriod() const
Definition StatisticsProcessor.h:122
std::set< SampleOutput * > _connectedOutputs
Definition StatisticsProcessor.h:169
bool _fillGaps
Definition StatisticsProcessor.h:190
void setFillGaps(bool val)
Definition StatisticsProcessor.h:139
void disconnectSource(SampleSource *)
Disconnect a SampleInput from this StatisticsProcessor.
Definition StatisticsProcessor.cc:475
std::set< SampleSource * > _connectedSources
Definition StatisticsProcessor.h:167
std::string getUniqueCountsName(const std::string &val)
All output samples (and StatisticsCrunchers) should have a unique name for their counts output variab...
Definition StatisticsProcessor.cc:255
void flush()
Implementation of SampleSource::flush().
Definition StatisticsProcessor.cc:91
void connectSource(SampleSource *) override
Do common operations necessary when a input has connected:
Definition StatisticsProcessor.cc:295
A C++ wrapper for a POSIX mutex.
Definition ThreadSupport.h:161
A class for parsing, formatting and doing operations on time, based on Unix time conventions,...
Definition UTime.h:95
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
Definition StatisticsProcessor.h:174
std::string countsName
Definition StatisticsProcessor.h:178
bool higherMoments
Definition StatisticsProcessor.h:179
StatisticsCruncher::statisticsType type
Definition StatisticsProcessor.h:177
OutputInfo()
Definition StatisticsProcessor.h:175