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

#include <PacketInputStream.h>

Inheritance diagram for nidas::dynld::isff::PacketInputStream:
Inheritance graph
[legend]

Public Types

typedef nidas::core::dsm_time_t dsm_time_t
 

Public Member Functions

 throw (nidas::util::InvalidParameterException)
 Constructor. More...
 
 PacketInputStream (const PacketInputStream &x, nidas::core::IOChannel *iochannel)
 Copy constructor, with a new, connected IOChannel. More...
 
virtual PacketInputStreamclone (nidas::core::IOChannel *iochannel)
 Create a clone, with a new, connected IOChannel. More...
 
virtual ~PacketInputStream ()
 
std::string getName () const
 
std::list< const
nidas::core::SampleTag * > 
getSampleTags () const
 What SampleTags am I a SampleSource for? More...
 
void init () throw ()
 
nidas::core::SamplereadSample () throw (nidas::util::IOException)
 Read the next sample from the InputStream. More...
 
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 close () throw (nidas::util::IOException)
 
void flush () throw ()
 Implementation of SampleSource::flush(). More...
 
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...
 
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...
 
const nidas::core::SampleStatsgetSampleStats () const
 
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...
 
void distribute (const nidas::core::Sample *s) throw ()
 Distribute a sample to my clients. More...
 
size_t getBadSamples () const
 
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 Attributes

nidas::core::SampleSourceSupport _source
 

Private Member Functions

const nidas::core::SampleTagfindSampleTag (int configId, int goesId, int sampleId) throw (nidas::util::InvalidParameterException)
 
const GOESProjectgetGOESProject (int configid) const throw (nidas::util::InvalidParameterException)
 
 PacketInputStream (const PacketInputStream &)
 No copy. More...
 
PacketInputStreamoperator= (const PacketInputStream &)
 No assignment. More...
 

Private Attributes

nidas::core::IOChannel_iochan
 
nidas::core::IOStream_iostream
 
PacketParser_packetParser
 
std::map< int, GOESProject * > _projectsByConfigId
 

Member Typedef Documentation

Constructor & Destructor Documentation

PacketInputStream::PacketInputStream ( const PacketInputStream x,
nidas::core::IOChannel iochannel 
)

Copy constructor, with a new, connected IOChannel.

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

Referenced by clone().

PacketInputStream::~PacketInputStream ( )
virtual

References _iochan, _iostream, and _packetParser.

nidas::dynld::isff::PacketInputStream::PacketInputStream ( const PacketInputStream )
private

No copy.

Member Function Documentation

void nidas::dynld::SampleInputStream::addSampleClient ( nidas::core::SampleClient client)
throw (
)
inlinevirtualinherited
void nidas::dynld::SampleInputStream::addSampleClientForTag ( nidas::core::SampleClient client,
const nidas::core::SampleTag tag 
)
throw (
)
inlinevirtualinherited
void nidas::dynld::SampleInputStream::addSampleTag ( const nidas::core::SampleTag tag)
throw (
)
inlinevirtualinherited
PacketInputStream * PacketInputStream::clone ( nidas::core::IOChannel iochannel)
virtual

Create a clone, with a new, connected IOChannel.

Reimplemented from nidas::dynld::SampleInputStream.

References PacketInputStream().

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

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 (
)
inlineinherited

Distribute a sample to my clients.

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

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

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

const SampleTag * PacketInputStream::findSampleTag ( int  configId,
int  goesId,
int  sampleId 
)
throw (nidas::util::InvalidParameterException
)
private
void nidas::dynld::isff::PacketInputStream::flush ( )
throw (
)
inlinevirtual

Implementation of SampleSource::flush().

Implements nidas::core::SampleSource.

void SampleInputStream::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtualinherited
size_t nidas::dynld::SampleInputStream::getBadSamples ( ) const
inlineinherited
int nidas::dynld::SampleInputStream::getClientCount ( ) const
throw (
)
inlinevirtualinherited

How many SampleClients are currently in my list.

Implements nidas::core::SampleSource.

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

const DSMConfig * SampleInputStream::getDSMConfig ( ) const
virtualinherited

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

Implements nidas::core::SampleInput.

References nidas::dynld::SampleInputStream::_dsm.

bool nidas::dynld::SampleInputStream::getExpectHeader ( ) const
inlineinherited
int SampleInputStream::getFd ( ) const
virtualinherited
const GOESProject * PacketInputStream::getGOESProject ( int  configid) const
throw (nidas::util::InvalidParameterException
)
private
const nidas::core::SampleInputHeader& nidas::dynld::SampleInputStream::getInputHeader ( ) const
inlineinherited
string PacketInputStream::getName ( ) const
virtual
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
virtual nidas::core::SampleInput* nidas::dynld::SampleInputStream::getOriginal ( ) const
inlinevirtualinherited
nidas::core::SampleSource* nidas::dynld::SampleInputStream::getProcessedSampleSource ( )
inlinevirtualinherited

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 nidas::dynld::SampleInputStream::_source, and nidas::core::SampleSourceSupport::getProcessedSampleSource().

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

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 nidas::dynld::SampleInputStream::_source, and nidas::core::SampleSourceSupport::getRawSampleSource().

const nidas::core::SampleStats& nidas::dynld::SampleInputStream::getSampleStats ( ) const
inlinevirtualinherited
nidas::core::SampleTagIterator nidas::dynld::SampleInputStream::getSampleTagIterator ( ) const
inlinevirtualinherited
list< const SampleTag * > PacketInputStream::getSampleTags ( ) const
virtual

What SampleTags am I a SampleSource for?

Implements nidas::core::SampleSource.

References getGOESProject(), and nidas::dynld::isff::GOESProject::getSampleTags().

Referenced by PacketDecode::run().

void PacketInputStream::init ( )
throw (
)
bool SampleInputStream::isNonBlocking ( ) const
throw (nidas::util::IOException
)
virtualinherited
PacketInputStream& nidas::dynld::isff::PacketInputStream::operator= ( const PacketInputStream )
private

No assignment.

bool SampleInputStream::parseInputHeader ( )
throw (nidas::util::IOException
)
inherited
void SampleInputStream::readInputHeader ( )
throw (nidas::util::IOException
)
inherited
nidas::core::Sample* nidas::dynld::isff::PacketInputStream::readSample ( )
throw (nidas::util::IOException
)
inlinevirtual

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.

Implements nidas::core::SampleInput.

References getName().

bool PacketInputStream::readSamples ( )
throw (nidas::util::IOException
)
virtual
void nidas::dynld::SampleInputStream::removeSampleClient ( nidas::core::SampleClient c)
throw (
)
inlinevirtualinherited
void nidas::dynld::SampleInputStream::removeSampleClientForTag ( nidas::core::SampleClient c,
const nidas::core::SampleTag  
)
throw (
)
inlinevirtualinherited

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 nidas::dynld::SampleInputStream::_source, and nidas::core::SampleSourceSupport::removeSampleClientForTag().

void nidas::dynld::SampleInputStream::removeSampleTag ( const nidas::core::SampleTag tag)
throw (
)
inlinevirtualinherited
void SampleInputStream::requestConnection ( nidas::core::DSMService requester)
throw (nidas::util::IOException
)
virtualinherited
void SampleInputStream::search ( const nidas::util::UTime tt)
throw (nidas::util::IOException
)
inherited

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)
inlineinherited

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

References nidas::dynld::SampleInputStream::_bsf.

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

void nidas::dynld::SampleInputStream::setExpectHeader ( bool  val)
inlineinherited
void nidas::dynld::SampleInputStream::setFilterBadSamples ( bool  val)
inlineinherited
void SampleInputStream::setIOChannel ( nidas::core::IOChannel val)
virtualinherited
void nidas::dynld::SampleInputStream::setKeepStats ( bool  val)
inlinevirtualinherited
void nidas::dynld::SampleInputStream::setMaxDsmId ( int  val)
inlineinherited
void nidas::dynld::SampleInputStream::setMaxSampleLength ( unsigned int  val)
inlineinherited
void nidas::dynld::SampleInputStream::setMaxSampleTime ( const nidas::util::UTime val)
inlineinherited
void nidas::dynld::SampleInputStream::setMinDsmId ( int  val)
inlineinherited
void nidas::dynld::SampleInputStream::setMinSampleLength ( unsigned int  val)
inlineinherited
void nidas::dynld::SampleInputStream::setMinSampleTime ( const nidas::util::UTime val)
inlineinherited
void SampleInputStream::setNonBlocking ( bool  val)
throw (nidas::util::IOException
)
virtualinherited
nidas::dynld::isff::PacketInputStream::throw ( nidas::util::InvalidParameterException  )

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.
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

nidas::core::IOChannel* nidas::dynld::isff::PacketInputStream::_iochan
private
nidas::core::IOStream* nidas::dynld::isff::PacketInputStream::_iostream
private

Referenced by close(), and ~PacketInputStream().

PacketParser* nidas::dynld::isff::PacketInputStream::_packetParser
private

Referenced by close(), and ~PacketInputStream().

std::map<int,GOESProject*> nidas::dynld::isff::PacketInputStream::_projectsByConfigId
mutableprivate
nidas::core::SampleSourceSupport nidas::dynld::SampleInputStream::_source
protectedinherited

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