nidas  v1.2-1520
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
nidas::dynld::SampleInputStream Class Reference

An implementation of a SampleInput. More...

#include <SampleInputStream.h>

Inheritance diagram for nidas::dynld::SampleInputStream:
Inheritance graph
[legend]

Classes

struct  ReadResult
 Tuple for all the possible results of iostream reads. More...
 

Public Types

typedef nidas::core::dsm_time_t dsm_time_t
 

Public Member Functions

 SampleInputStream (bool raw=false)
 Constructor. More...
 
 SampleInputStream (nidas::core::IOChannel *iochannel, bool raw=false)
 Constructor. More...
 
virtual SampleInputStreamclone (nidas::core::IOChannel *iochannel)
 Create a clone, with a new, connected IOChannel. More...
 
virtual ~SampleInputStream ()
 
std::string getName () const
 
int getFd () const
 
virtual void setIOChannel (nidas::core::IOChannel *val)
 Set the IOChannel for this SampleInputStream.h. More...
 
void readInputHeader () throw (nidas::util::IOException)
 Read archive information at beginning of input stream or file. More...
 
bool parseInputHeader () throw (nidas::util::IOException)
 
const
nidas::core::SampleInputHeader
getInputHeader () const
 
void requestConnection (nidas::core::DSMService *) throw (nidas::util::IOException)
 
virtual nidas::core::SampleInputgetOriginal () const
 
nidas::core::SampleInputconnected (nidas::core::IOChannel *iochan) throw ()
 Implementation of IOChannelRequester::connected. More...
 
void setNonBlocking (bool val) throw (nidas::util::IOException)
 
bool isNonBlocking () const throw (nidas::util::IOException)
 
const nidas::core::DSMConfiggetDSMConfig () const
 What DSM am I connnected to? May be NULL if it cannot be determined. More...
 
void setKeepStats (bool val)
 
void addSampleTag (const nidas::core::SampleTag *tag) throw ()
 Implementation of SampleInput::addSampleTag(). More...
 
void removeSampleTag (const nidas::core::SampleTag *tag) throw ()
 
nidas::core::SampleSourcegetRawSampleSource ()
 Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples. More...
 
nidas::core::SampleSourcegetProcessedSampleSource ()
 Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples. More...
 
std::list< const
nidas::core::SampleTag * > 
getSampleTags () const
 Get the output SampleTags. More...
 
nidas::core::SampleTagIterator getSampleTagIterator () const
 Implementation of SampleSource::getSampleTagIterator(). More...
 
void addSampleClient (nidas::core::SampleClient *client) throw ()
 Implementation of SampleSource::addSampleClient(). More...
 
void removeSampleClient (nidas::core::SampleClient *client) throw ()
 Remove a SampleClient from this SampleSource. More...
 
void addSampleClientForTag (nidas::core::SampleClient *client, const nidas::core::SampleTag *tag) throw ()
 Add a Client for a given SampleTag. More...
 
void removeSampleClientForTag (nidas::core::SampleClient *client, const nidas::core::SampleTag *tag) throw ()
 Remove a SampleClient for a given SampleTag from this SampleSource. More...
 
int getClientCount () const throw ()
 How many SampleClients are currently in my list. More...
 
void flush () throw ()
 Implementation of SampleSource::flush(), unpacks and distributes any samples currently in the read buffer. More...
 
const nidas::core::SampleStatsgetSampleStats () const
 
bool readSamples () throw (nidas::util::IOException)
 Read a buffer of data, serialize the data into samples, and distribute() samples to the receive() method of my SampleClients and DSMSensors. More...
 
void search (const nidas::util::UTime &tt) throw (nidas::util::IOException)
 Search forward until a sample header is read whose time is greater than or equal to tt. More...
 
nidas::core::SamplereadSample () throw (nidas::util::IOException)
 Read the next sample from the InputStream. More...
 
void distribute (const nidas::core::Sample *s) throw ()
 Distribute a sample to my clients. More...
 
size_t getBadSamples () const
 
void close () throw (nidas::util::IOException)
 
void setBadSampleFilter (const nidas::core::BadSampleFilter &bsf)
 Replace the bad sample filter rules for this stream with bsf. More...
 
void setFilterBadSamples (bool val)
 See BadSampleFilter. More...
 
void setMinDsmId (int val)
 See BadSampleFilter. More...
 
void setMaxDsmId (int val)
 See BadSampleFilter. More...
 
void setMinSampleLength (unsigned int val)
 See BadSampleFilter. More...
 
void setMaxSampleLength (unsigned int val)
 See BadSampleFilter. More...
 
void setMinSampleTime (const nidas::util::UTime &val)
 See BadSampleFilter. More...
 
void setMaxSampleTime (const nidas::util::UTime &val)
 See BadSampleFilter. More...
 
void fromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 Initialize myself from a xercesc::DOMElement. More...
 
void setExpectHeader (bool val)
 
bool getExpectHeader () const
 
virtual xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException)
 Create a DOMElement and append it to the parent. More...
 
virtual xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException)
 Add my content into a DOMElement. More...
 

Static Public Member Functions

static const XMLCh * getNamespaceURI ()
 

Protected Member Functions

 SampleInputStream (SampleInputStream &x, nidas::core::IOChannel *iochannel)
 Copy constructor, with a new, connected IOChannel. More...
 

Protected Attributes

nidas::core::IOChannel_iochan
 
nidas::core::SampleSourceSupport _source
 

Private Member Functions

nidas::core::SamplenextSample () throw ()
 Unpack the next sample from the InputStream. More...
 
nidas::core::SamplenextSample (bool keepreading, bool searching=false, dsm_time_t search_time=LONG_LONG_MIN) throw (nidas::util::IOException)
 Unpack the next sample from the InputStream buffer or by reading more data if keepreading is true. More...
 
void checkUnexpectedEOF ()
 
ReadResult readBlock (bool keepreading, char *&ptr, size_t &lentoread)
 Read a block into memory, updating the given block pointer and length counter accordingly. More...
 
ReadResult read (bool keepreading, char *ptr, size_t lentoread)
 All reads of the iostream go through here. More...
 
void handleNewInput ()
 Whenever we are at the start of a new input, we need to start over with parsing the input header. More...
 
nidas::core::SamplehandleEOF (bool keepreading)
 When EOF has been caught, then either we need to return the last pending sample, or else we need to throw the exception. More...
 
void closeBlocks ()
 
nidas::core::SamplesampleFromHeader () throw ()
 Check the current header for validity and generate a sample for it. More...
 
 SampleInputStream (const SampleInputStream &x)
 No regular copy. More...
 
SampleInputStreamoperator= (const SampleInputStream &x)
 No assignment. More...
 

Private Attributes

nidas::core::DSMService_service
 Service that has requested my input. More...
 
nidas::core::IOStream_iostream
 
const nidas::core::DSMConfig_dsm
 
bool _expectHeader
 
bool _inputHeaderParsed
 
nidas::core::SampleHeader _sheader
 
size_t _headerToRead
 
char * _hptr
 
nidas::core::Sample_samp
 Will be non-null if we have previously read part of a sample from the stream. More...
 
nidas::core::Sample_sampPending
 The currently pending sample. More...
 
size_t _dataToRead
 How many bytes left to read from the stream into the data portion of samp. More...
 
char * _dptr
 Pointer into the data portion of samp where we will read next. More...
 
bool _skipSample
 This is set if the data for the current sample header should be read but skipped, because the sample is the first after a block of bad samples and thus the time at the front of the sample might still be corrupt. More...
 
BlockStats _block
 Information about the current block of samples, good or bad. More...
 
size_t _badSamples
 Number of bad samples in the stream so far, which is to say number of bytes checked which did not contain a reasonable sample header. More...
 
size_t _goodSamples
 Number of good samples in the stream so far. More...
 
nidas::core::SampleInputHeader _inputHeader
 
nidas::core::BadSampleFilter _bsf
 
SampleInputStream_original
 
bool _raw
 
std::string _last_name
 Keep the current name of the input stream so it can be referenced even after the input stream has advanced to a new input name. More...
 
nidas::util::EOFException _eofx
 
bool _ateof
 

Detailed Description

An implementation of a SampleInput.

The readSamples method converts raw bytes from the iochannel into Samples.

If a SampleClient has requested processed Samples via addProcessedSampleClient, then SampleInputStream will pass Samples to the respective DSMSensor for processing, and then the DSMSensor passes the processed Samples to the SampleClient:

iochannel -> readSamples method -> DSMSensor -> SampleClient

If a SampleClient has requested non-processed Samples, via the simple addSampleClient method, then SampleInput stream passes the Samples straight to the SampleClient:

iochannel -> readSamples method -> SampleClient

Member Typedef Documentation

Constructor & Destructor Documentation

SampleInputStream::SampleInputStream ( bool  raw = false)

Constructor.

Parameters
rawWhether the input samples are raw.

Referenced by clone().

SampleInputStream::SampleInputStream ( nidas::core::IOChannel iochannel,
bool  raw = false 
)

Constructor.

Parameters
iochannelThe IOChannel that we use for data input. SampleInputStream will own the pointer to the IOChannel, and will delete it in ~SampleInputStream(). If it is a null pointer, then it must be set within the fromDOMElement method.

References _iochan, _iostream, nidas::core::IOChannel::getBufferSize(), and setIOChannel().

SampleInputStream::~SampleInputStream ( )
virtual
SampleInputStream::SampleInputStream ( SampleInputStream x,
nidas::core::IOChannel iochannel 
)
protected

Copy constructor, with a new, connected IOChannel.

References _iochan, _iostream, nidas::core::IOChannel::getBufferSize(), and setIOChannel().

nidas::dynld::SampleInputStream::SampleInputStream ( const SampleInputStream x)
private

No regular copy.

Member Function Documentation

void nidas::dynld::SampleInputStream::addSampleClient ( nidas::core::SampleClient client)
throw (
)
inlinevirtual
void nidas::dynld::SampleInputStream::addSampleClientForTag ( nidas::core::SampleClient client,
const nidas::core::SampleTag tag 
)
throw (
)
inlinevirtual

Add a Client for a given SampleTag.

Implementation of SampleSource::addSampleClient().

Implements nidas::core::SampleSource.

References _source, and nidas::core::SampleSourceSupport::addSampleClientForTag().

void nidas::dynld::SampleInputStream::addSampleTag ( const nidas::core::SampleTag tag)
throw (
)
inlinevirtual
void SampleInputStream::checkUnexpectedEOF ( )
private
SampleInputStream * SampleInputStream::clone ( nidas::core::IOChannel iochannel)
virtual

Create a clone, with a new, connected IOChannel.

Reimplemented in nidas::dynld::isff::PacketInputStream, and nidas::dynld::RawSampleInputStream.

References SampleInputStream().

void SampleInputStream::close ( )
throw (nidas::util::IOException
)
virtual
void SampleInputStream::closeBlocks ( )
private
SampleInput * SampleInputStream::connected ( nidas::core::IOChannel iochan)
throw (
)
virtual

Implementation of IOChannelRequester::connected.

One can use this method to notify SampleInputStream that the IOChannel is connected, which will cause SampleInputStream to open the IOStream.

Implements nidas::core::IOChannelRequester.

void nidas::dynld::SampleInputStream::distribute ( const nidas::core::Sample s)
throw (
)
inline

Distribute a sample to my clients.

One could use this to insert a sample into the stream.

References _source, and nidas::core::SampleSourceSupport::distribute().

Referenced by nidas::dynld::raf::SyncServer::handleSample().

void SampleInputStream::flush ( )
throw (
)
virtual

Implementation of SampleSource::flush(), unpacks and distributes any samples currently in the read buffer.

Implements nidas::core::SampleSource.

References _source, CNAME, nidas::core::SampleSourceSupport::distribute(), nidas::core::SampleSourceSupport::getClientCount(), nextSample(), and VLOG.

void SampleInputStream::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtual
size_t nidas::dynld::SampleInputStream::getBadSamples ( ) const
inline

References _badSamples.

int nidas::dynld::SampleInputStream::getClientCount ( ) const
throw (
)
inlinevirtual

How many SampleClients are currently in my list.

Implements nidas::core::SampleSource.

References _source, and nidas::core::SampleSourceSupport::getClientCount().

const DSMConfig * SampleInputStream::getDSMConfig ( ) const
virtual

What DSM am I connnected to? May be NULL if it cannot be determined.

Implements nidas::core::SampleInput.

References _dsm.

bool nidas::dynld::SampleInputStream::getExpectHeader ( ) const
inline

References _expectHeader.

int SampleInputStream::getFd ( ) const
virtual
const nidas::core::SampleInputHeader& nidas::dynld::SampleInputStream::getInputHeader ( ) const
inline
string SampleInputStream::getName ( ) const
virtual
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
virtual nidas::core::SampleInput* nidas::dynld::SampleInputStream::getOriginal ( ) const
inlinevirtual

Implements nidas::core::SampleInput.

References _original.

nidas::core::SampleSource* nidas::dynld::SampleInputStream::getProcessedSampleSource ( )
inlinevirtual

Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.

SampleClients use this method to get a pointer to whatever sample source they are interested in. Derived classes can return NULL if they are not a SampleSource of processed samples.

Implements nidas::core::SampleSource.

References _source, and nidas::core::SampleSourceSupport::getProcessedSampleSource().

nidas::core::SampleSource* nidas::dynld::SampleInputStream::getRawSampleSource ( )
inlinevirtual

Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.

SampleClients use this method to get a pointer to whatever sample source they are interested in. Derived classes can return NULL if they are not a SampleSource of raw samples.

Implements nidas::core::SampleSource.

References _source, and nidas::core::SampleSourceSupport::getRawSampleSource().

const nidas::core::SampleStats& nidas::dynld::SampleInputStream::getSampleStats ( ) const
inlinevirtual
nidas::core::SampleTagIterator nidas::dynld::SampleInputStream::getSampleTagIterator ( ) const
inlinevirtual
std::list<const nidas::core::SampleTag*> nidas::dynld::SampleInputStream::getSampleTags ( ) const
inlinevirtual

Get the output SampleTags.

Implements nidas::core::SampleSource.

References _source, and nidas::core::SampleSourceSupport::getSampleTags().

Sample * SampleInputStream::handleEOF ( bool  keepreading)
private

When EOF has been caught, then either we need to return the last pending sample, or else we need to throw the exception.

HOWEVER, because nextSample() is not allowed to throw an IOException when keepreading is false, since in general it does not make sense to trigger EOF when nothing is being read, this handler only throws the exception when keepreading is true.

References _eofx, _sampPending, CNAME, and DLOG.

Referenced by readSamples().

void SampleInputStream::handleNewInput ( )
private

Whenever we are at the start of a new input, we need to start over with parsing the input header.

This method sets up the right state to start over on a new file.

References _inputHeaderParsed, _iostream, nidas::core::IOStream::backup(), closeBlocks(), CNAME, DLOG, nidas::core::IOStream::getNumInputBytes(), and VLOG.

Referenced by read().

bool SampleInputStream::isNonBlocking ( ) const
throw (nidas::util::IOException
)
virtual
Sample * SampleInputStream::nextSample ( )
throw (
)
private

Unpack the next sample from the InputStream.

This method does not perform any physical reads.

Returns
pointer to a sample if there is one available in the buffer, else NULL.

Referenced by flush(), readSample(), and readSamples().

nidas::core::Sample* nidas::dynld::SampleInputStream::nextSample ( bool  keepreading,
bool  searching = false,
dsm_time_t  search_time = LONG_LONG_MIN 
)
throw (nidas::util::IOException
)
private

Unpack the next sample from the InputStream buffer or by reading more data if keepreading is true.

If searching is set, then reading stops after the first sample header found whose time tag is after search_time, as described in the search() method.

SampleInputStream& nidas::dynld::SampleInputStream::operator= ( const SampleInputStream x)
private

No assignment.

bool SampleInputStream::parseInputHeader ( )
throw (nidas::util::IOException
)
SampleInputStream::ReadResult SampleInputStream::read ( bool  keepreading,
char *  ptr,
size_t  lentoread 
)
private

All reads of the iostream go through here.

There are three kinds of reads needed:

  • Read to fill the iostream buffer but not a local block. (ptr==0 and keepreading=true)
  • Read from the iostream buffer into a local block (keepreading==false).
  • Read from the iostream to fill a local block, filling the buffer as needed (keepreading=true)

In all these cases, we need to catch if we hit the end of a file to know if the file ended unexpectedly. Also, if we hit the end of a file and a sample is still pending (because filtering is enabled and a sample is not good until it passes the filter and is succeeded by eof or another good sample), then we also need to return that sample. This method records the eof exception but does not pass it on, waiting instead for it to be thrown after any pending sample has been returned by nextSample(). Callers can test ReadResult members for which cases have occurred.

References _ateof, _eofx, _iostream, nidas::core::IOStream::available(), checkUnexpectedEOF(), CNAME, DLOG, nidas::dynld::SampleInputStream::ReadResult::eof, handleNewInput(), nidas::core::IOStream::isNewInput(), nidas::dynld::SampleInputStream::ReadResult::len, nidas::dynld::SampleInputStream::ReadResult::newinput, nidas::core::IOStream::read(), nidas::core::IOStream::readBuf(), and VLOG.

Referenced by readBlock(), and readSamples().

SampleInputStream::ReadResult SampleInputStream::readBlock ( bool  keepreading,
char *&  ptr,
size_t &  lentoread 
)
private

Read a block into memory, updating the given block pointer and length counter accordingly.

If keepreading is false, only read into the block what is available from the iostream buffer. Return the ReadResult of the last read. Always return if the current input ends or eof is reached.

References nidas::dynld::SampleInputStream::ReadResult::eof, nidas::dynld::SampleInputStream::ReadResult::len, nidas::dynld::SampleInputStream::ReadResult::newinput, and read().

void SampleInputStream::readInputHeader ( )
throw (nidas::util::IOException
)
Sample * SampleInputStream::readSample ( )
throw (nidas::util::IOException
)
virtual

Read the next sample from the InputStream.

The caller must call freeReference on the sample when they're done with it. This method may perform zero or more reads of the IOChannel.

Returns
pointer to a sample, never NULL.

Implements nidas::core::SampleInput.

References nextSample().

Referenced by nidas::dynld::raf::SyncRecordReader::init(), nidas::dynld::raf::SyncServer::openStream(), nidas::dynld::raf::SyncServer::read(), NidsMerge::run(), MergeVerifier::run(), SensorExtract::run(), ExtractDMT::run(), and ExtractFast2D::run().

bool SampleInputStream::readSamples ( )
throw (nidas::util::IOException
)
virtual

Read a buffer of data, serialize the data into samples, and distribute() samples to the receive() method of my SampleClients and DSMSensors.

This will perform only one physical read of the underlying IOChannel and so is appropriate to use when a select() or poll() has determined that there is data available on the file descriptor, or when the physical device is configured for non-blocking reads.

Returns
false: no data available for physical read, likely the result of an EAGAIN from a non-blocking read on a file descriptor. true: physical read did not necessarily consume all available data.

Implements nidas::core::SampleInput.

References _ateof, _iostream, _source, nidas::core::IOStream::available(), CNAME, nidas::core::SampleSourceSupport::distribute(), nidas::dynld::SampleInputStream::ReadResult::eof, handleEOF(), nidas::dynld::SampleInputStream::ReadResult::len, nidas::dynld::SampleInputStream::ReadResult::newinput, nextSample(), read(), and VLOG.

Referenced by DataStats::readSamples(), StatsProcess::run(), and DataPrep::run().

void nidas::dynld::SampleInputStream::removeSampleClient ( nidas::core::SampleClient c)
throw (
)
inlinevirtual

Remove a SampleClient from this SampleSource.

Implements nidas::core::SampleSource.

References _source, and nidas::core::SampleSourceSupport::removeSampleClient().

void nidas::dynld::SampleInputStream::removeSampleClientForTag ( nidas::core::SampleClient c,
const nidas::core::SampleTag  
)
throw (
)
inlinevirtual

Remove a SampleClient for a given SampleTag from this SampleSource.

The pointer to the SampleClient must remain valid, until after it is removed.

Implements nidas::core::SampleSource.

References _source, and nidas::core::SampleSourceSupport::removeSampleClientForTag().

void nidas::dynld::SampleInputStream::removeSampleTag ( const nidas::core::SampleTag tag)
throw (
)
inlinevirtual
void SampleInputStream::requestConnection ( nidas::core::DSMService requester)
throw (nidas::util::IOException
)
virtual
Sample * SampleInputStream::sampleFromHeader ( )
throw (
)
private
void SampleInputStream::search ( const nidas::util::UTime tt)
throw (nidas::util::IOException
)

Search forward until a sample header is read whose time is greater than or equal to tt.

Leaves the InputStream positioned so that the next call to readSample() or readSamples() will read the rest of the sample.

References CNAME, and DLOG.

Referenced by StatsProcess::run(), and DataPrep::run().

void nidas::dynld::SampleInputStream::setBadSampleFilter ( const nidas::core::BadSampleFilter bsf)
inline

Replace the bad sample filter rules for this stream with bsf.

References _bsf.

Referenced by StatsProcess::run(), DataPrep::run(), and DataStats::run().

void nidas::dynld::SampleInputStream::setExpectHeader ( bool  val)
inline

References _expectHeader.

Referenced by setIOChannel().

void nidas::dynld::SampleInputStream::setFilterBadSamples ( bool  val)
inline

See BadSampleFilter.

References _bsf, and nidas::core::BadSampleFilter::setFilterBadSamples().

void SampleInputStream::setIOChannel ( nidas::core::IOChannel val)
virtual
void nidas::dynld::SampleInputStream::setKeepStats ( bool  val)
inlinevirtual
void nidas::dynld::SampleInputStream::setMaxDsmId ( int  val)
inline
void nidas::dynld::SampleInputStream::setMaxSampleLength ( unsigned int  val)
inline
void nidas::dynld::SampleInputStream::setMaxSampleTime ( const nidas::util::UTime val)
inline
void nidas::dynld::SampleInputStream::setMinDsmId ( int  val)
inline

See BadSampleFilter.

References _bsf, and nidas::core::BadSampleFilter::setMinDsmId().

void nidas::dynld::SampleInputStream::setMinSampleLength ( unsigned int  val)
inline

See BadSampleFilter.

References _bsf, and nidas::core::BadSampleFilter::setMinSampleLength().

void nidas::dynld::SampleInputStream::setMinSampleTime ( const nidas::util::UTime val)
inline
void SampleInputStream::setNonBlocking ( bool  val)
throw (nidas::util::IOException
)
virtual
xercesc::DOMElement * DOMable::toDOMElement ( xercesc::DOMElement *  node,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
xercesc::DOMElement * DOMable::toDOMParent ( xercesc::DOMElement *  parent,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited

Member Data Documentation

bool nidas::dynld::SampleInputStream::_ateof
private

Referenced by read(), and readSamples().

size_t nidas::dynld::SampleInputStream::_badSamples
private

Number of bad samples in the stream so far, which is to say number of bytes checked which did not contain a reasonable sample header.

Referenced by closeBlocks(), getBadSamples(), and sampleFromHeader().

BlockStats nidas::dynld::SampleInputStream::_block
private

Information about the current block of samples, good or bad.

Referenced by closeBlocks(), and sampleFromHeader().

nidas::core::BadSampleFilter nidas::dynld::SampleInputStream::_bsf
private
size_t nidas::dynld::SampleInputStream::_dataToRead
private

How many bytes left to read from the stream into the data portion of samp.

Referenced by checkUnexpectedEOF(), and parseInputHeader().

char* nidas::dynld::SampleInputStream::_dptr
private

Pointer into the data portion of samp where we will read next.

const nidas::core::DSMConfig* nidas::dynld::SampleInputStream::_dsm
private

Referenced by getDSMConfig(), and setIOChannel().

nidas::util::EOFException nidas::dynld::SampleInputStream::_eofx
private

Referenced by handleEOF(), and read().

bool nidas::dynld::SampleInputStream::_expectHeader
private
size_t nidas::dynld::SampleInputStream::_goodSamples
private

Number of good samples in the stream so far.

Referenced by closeBlocks(), and sampleFromHeader().

size_t nidas::dynld::SampleInputStream::_headerToRead
private
char* nidas::dynld::SampleInputStream::_hptr
private
nidas::core::SampleInputHeader nidas::dynld::SampleInputStream::_inputHeader
private

Referenced by getInputHeader(), and parseInputHeader().

bool nidas::dynld::SampleInputStream::_inputHeaderParsed
private
nidas::core::IOChannel* nidas::dynld::SampleInputStream::_iochan
protected
nidas::core::IOStream* nidas::dynld::SampleInputStream::_iostream
private
std::string nidas::dynld::SampleInputStream::_last_name
private

Keep the current name of the input stream so it can be referenced even after the input stream has advanced to a new input name.

Referenced by checkUnexpectedEOF(), closeBlocks(), and readInputHeader().

SampleInputStream* nidas::dynld::SampleInputStream::_original
private

Referenced by getOriginal().

bool nidas::dynld::SampleInputStream::_raw
private
nidas::core::Sample* nidas::dynld::SampleInputStream::_samp
private

Will be non-null if we have previously read part of a sample from the stream.

Referenced by checkUnexpectedEOF(), parseInputHeader(), and ~SampleInputStream().

nidas::core::Sample* nidas::dynld::SampleInputStream::_sampPending
private

The currently pending sample.

When filtering is active, the pending sample is held until the succeeding sample header is confirmed to be good.

Referenced by handleEOF(), and ~SampleInputStream().

nidas::core::DSMService* nidas::dynld::SampleInputStream::_service
private

Service that has requested my input.

nidas::core::SampleHeader nidas::dynld::SampleInputStream::_sheader
private
bool nidas::dynld::SampleInputStream::_skipSample
private

This is set if the data for the current sample header should be read but skipped, because the sample is the first after a block of bad samples and thus the time at the front of the sample might still be corrupt.

Referenced by sampleFromHeader().

nidas::core::SampleSourceSupport nidas::dynld::SampleInputStream::_source
protected

The documentation for this class was generated from the following files: