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

A RawSampleService reads raw Samples from a socket connection and sends the samples to one or more SampleIOProcessors. More...

#include <RawSampleService.h>

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

Classes

class  Worker
 Worker thread that is run when a SampleInputConnection is established. More...
 

Public Member Functions

 RawSampleService ()
 
 ~RawSampleService ()
 
void connect (nidas::core::SampleInput *) throw ()
 
void disconnect (nidas::core::SampleInput *) throw ()
 
void schedule (bool optionalProcessing) throw (nidas::util::Exception)
 schedule this service to run. More...
 
void interrupt () throw ()
 
void fromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 Initialize myself from a xercesc::DOMElement. More...
 
void printClock (std::ostream &ostr) throw ()
 
void printStatus (std::ostream &ostr, float deltat) throw ()
 
float getRawSorterLength () const
 Get the length of the SampleSorter of raw Samples, in seconds. More...
 
void setRawSorterLength (float val)
 Set the length of the SampleSorter of raw Samples, in seconds. More...
 
float getProcSorterLength () const
 Get the length of the SampleSorter of processed Samples, in seconds. More...
 
void setProcSorterLength (float val)
 Set the length of the SampleSorter of processed Samples, in seconds. More...
 
size_t getRawHeapMax () const
 Get the size of in bytes of the raw SampleSorter. More...
 
void setRawHeapMax (size_t val)
 Set the size of in bytes of the raw SampleSorter. More...
 
size_t getProcHeapMax () const
 Get the size of in bytes of the processed SampleSorter. More...
 
void setProcHeapMax (size_t val)
 Set the size of in bytes of the processed SampleSorter. More...
 
unsigned int getRawLateSampleCacheSize () const
 Get the size of the late sample cache in the raw sample sorter. More...
 
void setRawLateSampleCacheSize (unsigned int val)
 Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter. More...
 
unsigned int getProcLateSampleCacheSize () const
 Get the size of the late sample cache in the processed sample sorter. More...
 
void setProcLateSampleCacheSize (unsigned int val)
 Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter. More...
 
const std::string & getName () const
 
virtual void setDSMServer (DSMServer *val)
 
virtual DSMServergetDSMServer () const
 
virtual void addProcessor (SampleIOProcessor *proc)
 Add a processor to this RawSampleService. More...
 
virtual const std::list
< SampleIOProcessor * > & 
getProcessors () const
 
const std::list< SampleInput * > & getInputs () const
 
ProcessorIterator getProcessorIterator () const
 
virtual int checkSubThreads () throw ()
 
virtual void cancel () throw ()
 
virtual int join () throw ()
 
nidas::util::Thread::SchedPolicy getSchedPolicy () const
 
int getSchedPriority () 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 std::string getClassName (const xercesc::DOMElement *node, const Project *) throw (nidas::util::InvalidParameterException)
 
static const XMLCh * getNamespaceURI ()
 

Protected Member Functions

void addSubThread (nidas::util::Thread *) throw ()
 

Protected Attributes

std::string _name
 
DSMServer_server
 
std::set< nidas::util::Thread * > _subThreads
 
nidas::util::Mutex _subThreadMutex
 
std::list< SampleInput * > _inputs
 
std::list< SampleIOProcessor * > _processors
 
std::list< IOChannel * > _ochans
 
nidas::util::Thread::SchedPolicy _threadPolicy
 
int _threadPriority
 

Private Member Functions

 RawSampleService (const RawSampleService &)
 Copying not supported. More...
 
RawSampleServiceoperator= (const RawSampleService &)
 Assignment not supported. More...
 

Private Attributes

nidas::core::SamplePipeline_pipeline
 
std::map
< nidas::core::SampleInput
*, Worker * > 
_workers
 Keep track of the Worker for each SampleInput. More...
 
std::map
< nidas::core::SampleInput
*, const
nidas::core::DSMConfig * > 
_dsms
 
nidas::util::Mutex _workerMutex
 
std::map< void *, size_t > _nsampsLast
 Saved between calls to printStatus in order to compute data rates. More...
 
std::map< void *, long long > _nbytesLast
 Saved between calls to printStatus in order to compute sample rates. More...
 
float _rawSorterLength
 
float _procSorterLength
 
size_t _rawHeapMax
 
size_t _procHeapMax
 
unsigned int _rawLateSampleCacheSize
 
unsigned int _procLateSampleCacheSize
 

Detailed Description

A RawSampleService reads raw Samples from a socket connection and sends the samples to one or more SampleIOProcessors.

Constructor & Destructor Documentation

RawSampleService::RawSampleService ( )
RawSampleService::~RawSampleService ( )
nidas::dynld::RawSampleService::RawSampleService ( const RawSampleService )
private

Copying not supported.

Member Function Documentation

virtual void nidas::core::DSMService::addProcessor ( SampleIOProcessor proc)
inlinevirtualinherited

Add a processor to this RawSampleService.

This is done at configuration (XML) time.

References nidas::core::DSMService::_processors.

void DSMService::addSubThread ( nidas::util::Thread thd)
throw (
)
protectedinherited
void DSMService::cancel ( )
throw (
)
virtualinherited
int DSMService::checkSubThreads ( )
throw (
)
virtualinherited
void RawSampleService::connect ( nidas::core::SampleInput input)
throw (
)
virtual
void RawSampleService::disconnect ( nidas::core::SampleInput input)
throw (
)
void RawSampleService::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtual
const string DSMService::getClassName ( const xercesc::DOMElement *  node,
const Project project 
)
throw (nidas::util::InvalidParameterException
)
staticinherited
virtual DSMServer* nidas::core::DSMService::getDSMServer ( ) const
inlinevirtualinherited
const std::list<SampleInput*>& nidas::core::DSMService::getInputs ( ) const
inlineinherited
const std::string& nidas::core::DSMService::getName ( ) const
inlineinherited
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
ProcessorIterator DSMService::getProcessorIterator ( ) const
inherited

Referenced by printStatus().

virtual const std::list<SampleIOProcessor*>& nidas::core::DSMService::getProcessors ( ) const
inlinevirtualinherited
size_t nidas::dynld::RawSampleService::getProcHeapMax ( ) const
inline

Get the size of in bytes of the processed SampleSorter.

If the size of the sorter exceeds this value then samples will be discarded.

References _procHeapMax.

unsigned int nidas::dynld::RawSampleService::getProcLateSampleCacheSize ( ) const
inline

Get the size of the late sample cache in the processed sample sorter.

See SampleSorter::getLateSampleCacheSize(). Default: 0.

References _procLateSampleCacheSize.

float nidas::dynld::RawSampleService::getProcSorterLength ( ) const
inline

Get the length of the SampleSorter of processed Samples, in seconds.

References _procSorterLength.

size_t nidas::dynld::RawSampleService::getRawHeapMax ( ) const
inline

Get the size of in bytes of the raw SampleSorter.

If the size of the sorter exceeds this value then samples will be discarded.

References _rawHeapMax.

unsigned int nidas::dynld::RawSampleService::getRawLateSampleCacheSize ( ) const
inline

Get the size of the late sample cache in the raw sample sorter.

See SampleSorter::getLateSampleCacheSize(). Default: 0.

References _rawLateSampleCacheSize.

float nidas::dynld::RawSampleService::getRawSorterLength ( ) const
inline

Get the length of the SampleSorter of raw Samples, in seconds.

References _rawSorterLength.

nidas::util::Thread::SchedPolicy nidas::core::DSMService::getSchedPolicy ( ) const
inlineinherited
int nidas::core::DSMService::getSchedPriority ( ) const
inlineinherited
void RawSampleService::interrupt ( )
throw (
)
virtual
int DSMService::join ( )
throw (
)
virtualinherited
RawSampleService& nidas::dynld::RawSampleService::operator= ( const RawSampleService )
private

Assignment not supported.

void RawSampleService::printClock ( std::ostream &  ostr)
throw (
)
virtual
void RawSampleService::printStatus ( std::ostream &  ostr,
float  deltat 
)
throw (
)
virtual
void RawSampleService::schedule ( bool  optionalProcessing)
throw (nidas::util::Exception
)
virtual
void DSMService::setDSMServer ( DSMServer val)
virtualinherited
void nidas::dynld::RawSampleService::setProcHeapMax ( size_t  val)
inline

Set the size of in bytes of the processed SampleSorter.

If the size of the sorter exceeds this value then samples will be discarded.

References _procHeapMax.

Referenced by fromDOMElement().

void nidas::dynld::RawSampleService::setProcLateSampleCacheSize ( unsigned int  val)
inline

Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter.

See SampleSorter::setLateSampleCacheSize(val).

References _procLateSampleCacheSize.

Referenced by fromDOMElement().

void nidas::dynld::RawSampleService::setProcSorterLength ( float  val)
inline

Set the length of the SampleSorter of processed Samples, in seconds.

References _procSorterLength.

Referenced by fromDOMElement().

void nidas::dynld::RawSampleService::setRawHeapMax ( size_t  val)
inline

Set the size of in bytes of the raw SampleSorter.

If the size of the sorter exceeds this value then samples will be discarded.

References _rawHeapMax.

Referenced by fromDOMElement().

void nidas::dynld::RawSampleService::setRawLateSampleCacheSize ( unsigned int  val)
inline

Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter.

See SampleSorter::setLateSampleCacheSize(val).

References _rawLateSampleCacheSize.

Referenced by fromDOMElement().

void nidas::dynld::RawSampleService::setRawSorterLength ( float  val)
inline

Set the length of the SampleSorter of raw Samples, in seconds.

References _rawSorterLength.

Referenced by fromDOMElement().

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

std::map<nidas::core::SampleInput*,const nidas::core::DSMConfig*> nidas::dynld::RawSampleService::_dsms
private

Referenced by printStatus().

std::list<SampleInput*> nidas::core::DSMService::_inputs
protectedinherited
std::string nidas::core::DSMService::_name
protectedinherited
std::map<void*,long long> nidas::dynld::RawSampleService::_nbytesLast
private

Saved between calls to printStatus in order to compute sample rates.

Referenced by printStatus().

std::map<void*,size_t> nidas::dynld::RawSampleService::_nsampsLast
private

Saved between calls to printStatus in order to compute data rates.

Referenced by printStatus().

std::list<IOChannel*> nidas::core::DSMService::_ochans
protectedinherited
nidas::core::SamplePipeline* nidas::dynld::RawSampleService::_pipeline
private

Referenced by printClock(), and printStatus().

std::list<SampleIOProcessor*> nidas::core::DSMService::_processors
protectedinherited
size_t nidas::dynld::RawSampleService::_procHeapMax
private

Referenced by getProcHeapMax(), and setProcHeapMax().

unsigned int nidas::dynld::RawSampleService::_procLateSampleCacheSize
private
float nidas::dynld::RawSampleService::_procSorterLength
private
size_t nidas::dynld::RawSampleService::_rawHeapMax
private

Referenced by getRawHeapMax(), and setRawHeapMax().

unsigned int nidas::dynld::RawSampleService::_rawLateSampleCacheSize
private
float nidas::dynld::RawSampleService::_rawSorterLength
private
DSMServer* nidas::core::DSMService::_server
protectedinherited
nidas::util::Mutex nidas::core::DSMService::_subThreadMutex
protectedinherited
std::set<nidas::util::Thread*> nidas::core::DSMService::_subThreads
protectedinherited
nidas::util::Thread::SchedPolicy nidas::core::DSMService::_threadPolicy
protectedinherited
int nidas::core::DSMService::_threadPriority
protectedinherited
nidas::util::Mutex nidas::dynld::RawSampleService::_workerMutex
private

Referenced by printStatus().

std::map<nidas::core::SampleInput*,Worker*> nidas::dynld::RawSampleService::_workers
private

Keep track of the Worker for each SampleInput.


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