27#ifndef NIDAS_DYNLD_SAMPLEINPUTSTREAM_H
28#define NIDAS_DYNLD_SAMPLEINPUTSTREAM_H
68 BlockStats(
bool goodblock=
true,
size_t startblock=0);
341 void flush() throw();
505 bool searching=
false,
518 ReadResult(
size_t ilen=0,
bool inewinput=
false,
bool ieof=
false):
527 readBlock(
bool keepreading,
char* &ptr,
size_t& lentoread);
530 read(
bool keepreading,
char* ptr,
size_t lentoread);
Implement rules for filtering bad samples.
Definition BadSampleFilter.h:23
void setMaxSampleLength(unsigned int val)
The default maximum sample length is 32768.
Definition BadSampleFilter.cc:63
void setMinSampleLength(unsigned int val)
The default minimum sample length is 1.
Definition BadSampleFilter.cc:55
void setMaxSampleTime(const nidas::util::UTime &val)
Set the maximum sample time for a valid sample.
Definition BadSampleFilter.cc:79
void setMinSampleTime(const nidas::util::UTime &val)
Set the minimum sample time for a valid sample.
Definition BadSampleFilter.cc:71
void setMinDsmId(unsigned int val)
The default minimum DSM ID for a valid sample is 1.
Definition BadSampleFilter.cc:39
void setMaxDsmId(unsigned int val)
The default maximum DSM ID for a valid sample is 1024.
Definition BadSampleFilter.cc:47
void setFilterBadSamples(bool val)
Enable filtering of bad samples.
Definition BadSampleFilter.cc:32
Class that should include all that is configurable about a DSM.
Definition DSMConfig.h:55
Base class for a service, as built from a <service> XML tag.
Definition DSMService.h:48
A channel for Input or Output of data.
Definition IOChannel.h:65
A base class for buffering data.
Definition IOStream.h:41
Pure virtual interface of a client of Samples.
Definition SampleClient.h:38
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
SampleSource * getRawSampleSource()
Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.
Definition SampleSourceSupport.h:60
void removeSampleClientForTag(SampleClient *c, const SampleTag *)
Add a SampleClient to this SampleSource.
Definition SampleSourceSupport.cc:121
void distribute(const Sample *s)
Distribute a sample to my clients, calling the receive() method of each client, passing the const poi...
Definition SampleSourceSupport.cc:141
void addSampleClientForTag(SampleClient *c, const SampleTag *)
Add a SampleClient to this SampleSource.
Definition SampleSourceSupport.cc:101
void addSampleClient(SampleClient *c)
Add a SampleClient to this SampleSource.
Definition SampleSourceSupport.cc:80
SampleSource * getProcessedSampleSource()
Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.
Definition SampleSourceSupport.h:66
void setKeepStats(bool val)
Definition SampleSourceSupport.h:154
SampleTagIterator getSampleTagIterator() const
Definition SampleSourceSupport.cc:75
int getClientCount() const
How many SampleClients are currently in my list.
Definition SampleSourceSupport.cc:136
void removeSampleTag(const SampleTag *tag)
Definition SampleSourceSupport.cc:67
const SampleStats & getSampleStats() const
Definition SampleSourceSupport.h:149
void addSampleTag(const SampleTag *tag)
Add a SampleTag to this SampleSource.
Definition SampleSourceSupport.cc:60
std::list< const SampleTag * > getSampleTags() const
What SampleTags am I a SampleSource for?
Definition SampleSourceSupport.cc:54
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
Interface to a data sample.
Definition Sample.h:190
A class for parsing, formatting and doing operations on time, based on Unix time conventions,...
Definition UTime.h:95
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
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
Keep track of statistics for a contiguous block of good or bad samples in a stream.
Definition SampleInputStream.h:60
BlockStats(bool goodblock=true, size_t startblock=0)
Initialize a block as good or bad and give it an offset.
Definition SampleInputStream.cc:69
nidas::core::dsm_time_t dsm_time_t
Definition SampleInputStream.h:62
size_t nbytes
Size in bytes of this block.
Definition SampleInputStream.h:142
size_t block_start
Definition SampleInputStream.h:137
void endBadBlock(nidas::core::Sample *samp, long long offset)
Mark the end of a bad block by assigning the end_time and setting nbytes according to the current off...
Definition SampleInputStream.cc:128
size_t blockEnd() const
Definition SampleInputStream.h:109
bool good
True if this is a block of good samples.
Definition SampleInputStream.h:127
void addBadSample(long long offset, unsigned int nbadbytes)
An alternative to calling startBadBlock()/endBadBlock(), it adds nbadbytes to a bad block,...
Definition SampleInputStream.cc:101
bool addGoodSample(nidas::core::Sample *samp, long long offset)
On a good sample, reset this block to a good block if not already, and update the last good sample an...
Definition SampleInputStream.cc:81
dsm_time_t start_time
Sample times bounding this block.
Definition SampleInputStream.h:121
size_t nsamples
Number of good samples in a row.
Definition SampleInputStream.h:132
unsigned int last_good_sample_size
Size of the last good sample in a good sample block.
Definition SampleInputStream.h:148
void startBadBlock(long long offset)
Start a bad block.
Definition SampleInputStream.cc:115
dsm_time_t end_time
Definition SampleInputStream.h:122