27 #ifndef NIDAS_CORE_NEARESTRESAMPLER_H
28 #define NIDAS_CORE_NEARESTRESAMPLER_H
35 namespace nidas {
namespace core {
60 NearestResampler(
const std::vector<const Variable*>& vars,
bool nansVariable=
true);
140 void flush() throw();
180 std::map<dsm_sample_id_t,std::vector<unsigned int> >
_inmap;
185 std::map<dsm_sample_id_t,std::vector<unsigned int> >
_lenmap;
190 std::map<dsm_sample_id_t,std::vector<unsigned int> >
_outmap;
void connect(SampleSource *src)
Connect the resampler to a SampleSource.
Definition: NearestResampler.cc:156
bool _debug
Definition: NearestResampler.h:212
unsigned int _master
Definition: NearestResampler.h:196
Interface for a resampler, simply a SampleClient and a SampleSource.
Definition: Resampler.h:39
void flush()
Implementation of Resampler::flush().
Definition: NearestResampler.cc:462
std::map< Variable *, unsigned int > _outVarIndices
Index of each requested output variable in the output sample.
Definition: NearestResampler.h:174
float * _prevData
Definition: NearestResampler.h:204
SampleTagIterator getSampleTagIterator() const
Implementation of SampleSource::getSampleTagIterator().
Definition: NearestResampler.h:81
int _nmaster
Definition: NearestResampler.h:198
bool receive(const Sample *s)
Implementation of SampleClient::receive().
Definition: NearestResampler.cc:254
void removeSampleTag(const SampleTag *tag)
Definition: SampleSourceSupport.cc:67
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:61
Class describing a sampled variable.
Definition: Variable.h:46
Pure virtual interface for a source of Samples.
Definition: SampleSource.h:48
SampleTagIterator getSampleTagIterator() const
Definition: SampleSourceSupport.cc:75
void removeSampleClient(SampleClient *client)
Remove a SampleClient from this SampleSource.
Definition: NearestResampler.h:94
NearestResampler & operator=(const NearestResampler &)
No assignment.
unsigned int _outlen
Definition: NearestResampler.h:194
A source of samples.
Definition: SampleSourceSupport.h:47
void removeSampleClient(SampleClient *c)
Remove a SampleClient from this SampleSource This will also remove a SampleClient if it has been adde...
Definition: SampleSourceSupport.cc:88
void addSampleClient(SampleClient *c)
Add a SampleClient to this SampleSource.
Definition: SampleSourceSupport.cc:80
Pure virtual interface of a client of Samples.
Definition: SampleClient.h:38
std::map< dsm_sample_id_t, unsigned int > _ttOutOfOrder
Definition: NearestResampler.h:210
std::list< const SampleTag * > getSampleTags() const
Get the SampleTag of my merged output sample.
Definition: NearestResampler.h:73
void addSampleTag(const SampleTag *tag)
Add a SampleTag to this SampleSource.
Definition: NearestResampler.h:152
const SampleStats & getSampleStats() const
Definition: SampleSourceSupport.h:149
dsm_time_t * _prevTT
Definition: NearestResampler.h:200
int getClientCount() const
How many SampleClients are currently in my list.
Definition: NearestResampler.h:114
void removeSampleClientForTag(SampleClient *client, const SampleTag *)
Remove a SampleClient for a given SampleTag from this SampleSource.
Definition: NearestResampler.h:109
SampleSourceSupport _source
Definition: NearestResampler.h:162
std::map< dsm_sample_id_t, std::vector< unsigned int > > _inmap
For each input sample, first index of variable data values to be read.
Definition: NearestResampler.h:180
void disconnect(SampleSource *src)
Definition: NearestResampler.cc:249
const SampleStats & getSampleStats() const
Definition: NearestResampler.h:119
int * _samplesSinceMaster
Definition: NearestResampler.h:208
Interface to a data sample.
Definition: Sample.h:189
float * _nearData
Definition: NearestResampler.h:206
std::vector< Variable * > _reqVars
Requested variables.
Definition: NearestResampler.h:169
SampleSource * getRawSampleSource()
Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.
Definition: NearestResampler.h:66
Class for iterating over the SampleTags of a Project, Site, DSMConfig, or a SampleSource.
Definition: NidsIterators.h:217
Class describing a group of variables that are sampled and handled together.
Definition: SampleTag.h:87
SampleTag _outSample
Definition: NearestResampler.h:164
A source of samples.
Definition: SampleStats.h:41
SampleSource * getProcessedSampleSource()
Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.
Definition: NearestResampler.h:68
unsigned int _ndataValues
Definition: NearestResampler.h:192
~NearestResampler()
Definition: NearestResampler.cc:68
std::map< dsm_sample_id_t, std::vector< unsigned int > > _lenmap
For each input sample, length of variables to read.
Definition: NearestResampler.h:185
std::map< dsm_sample_id_t, std::vector< unsigned int > > _outmap
For each input sample, index into output sample of each variable.
Definition: NearestResampler.h:190
int getClientCount() const
How many SampleClients are currently in my list.
Definition: SampleSourceSupport.cc:136
std::list< const SampleTag * > getSampleTags() const
What SampleTags am I a SampleSource for?
Definition: SampleSourceSupport.cc:54
void removeSampleTag(const SampleTag *tag)
Definition: NearestResampler.h:157
void addSampleClientForTag(SampleClient *client, const SampleTag *)
Add a Client for a given SampleTag.
Definition: NearestResampler.h:103
dsm_time_t * _nearTT
Definition: NearestResampler.h:202
A simple, nearest-point resampler, for generating merged samples from variables from one or more samp...
Definition: NearestResampler.h:54
NearestResampler(const std::vector< const Variable * > &vars, bool nansVariable=true)
Constructor.
Definition: NearestResampler.cc:39
void addSampleClient(SampleClient *client)
Implementation of SampleSource::addSampleClient().
Definition: NearestResampler.h:89
void ctorCommon(const std::vector< const Variable * > &vars, bool nansVariable)
Common tasks of constructors.
Definition: NearestResampler.cc:80
Definition: InvalidParameterException.h:35
void addSampleTag(const SampleTag *tag)
Add a SampleTag to this SampleSource.
Definition: SampleSourceSupport.cc:60