nidas v1.2.3
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static 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)
 
void interrupt () throw ()
 
void fromDOMElement (const xercesc::DOMElement *node)
 
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.
 
void setRawSorterLength (float val)
 Set the length of the SampleSorter of raw Samples, in seconds.
 
float getProcSorterLength () const
 Get the length of the SampleSorter of processed Samples, in seconds.
 
void setProcSorterLength (float val)
 Set the length of the SampleSorter of processed Samples, in seconds.
 
size_t getRawHeapMax () const
 Get the size of in bytes of the raw SampleSorter.
 
void setRawHeapMax (size_t val)
 Set the size of in bytes of the raw SampleSorter.
 
size_t getProcHeapMax () const
 Get the size of in bytes of the processed SampleSorter.
 
void setProcHeapMax (size_t val)
 Set the size of in bytes of the processed SampleSorter.
 
unsigned int getRawLateSampleCacheSize () const
 Get the size of the late sample cache in the raw sample sorter.
 
void setRawLateSampleCacheSize (unsigned int val)
 Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter.
 
unsigned int getProcLateSampleCacheSize () const
 Get the size of the late sample cache in the processed sample sorter.
 
void setProcLateSampleCacheSize (unsigned int val)
 Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter.
 
const std::string & getName () const
 
virtual void setDSMServer (DSMServer *val)
 
virtual DSMServergetDSMServer () const
 
virtual void addProcessor (SampleIOProcessor *proc)
 Add a processor to this RawSampleService.
 
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
 Create a DOMElement and append it to the parent.
 
virtual xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const
 Add my content into a DOMElement.
 

Static Public Member Functions

static const std::string getClassName (const xercesc::DOMElement *node, const Project *)
 
static const XMLChgetNamespaceURI ()
 

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.
 
RawSampleServiceoperator= (const RawSampleService &)
 Assignment not supported.
 

Private Attributes

nidas::core::SamplePipeline_pipeline
 
std::map< nidas::core::SampleInput *, Worker * > _workers
 Keep track of the Worker for each SampleInput.
 
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.
 
std::map< void *, long long_nbytesLast
 Saved between calls to printStatus in order to compute sample rates.
 
float _rawSorterLength
 
float _procSorterLength
 
size_t _rawHeapMax
 
size_t _procHeapMax
 
unsigned int _rawLateSampleCacheSize
 
unsigned int _procLateSampleCacheSize
 

Static Private Attributes

static XMLChnamespaceURI = 0
 

Detailed Description

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

Constructor & Destructor Documentation

◆ RawSampleService() [1/2]

RawSampleService::RawSampleService ( )

◆ ~RawSampleService()

RawSampleService::~RawSampleService ( )

◆ RawSampleService() [2/2]

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

Copying not supported.

Member Function Documentation

◆ addProcessor()

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.

Referenced by nidas::core::DSMService::fromDOMElement().

◆ addSubThread()

void DSMService::addSubThread ( nidas::util::Thread * thd)
throw ( )
protectedinherited

◆ cancel()

void DSMService::cancel ( )
throw ( )
virtualinherited

◆ checkSubThreads()

int DSMService::checkSubThreads ( )
throw ( )
virtualinherited

◆ connect()

void RawSampleService::connect ( nidas::core::SampleInput * input)
throw ( )
virtual

◆ disconnect()

void RawSampleService::disconnect ( nidas::core::SampleInput * input)
throw ( )

◆ fromDOMElement()

void RawSampleService::fromDOMElement ( const xercesc::DOMElement * node)
virtual

◆ getClassName()

const string DSMService::getClassName ( const xercesc::DOMElement * node,
const Project * project )
staticinherited

◆ getDSMServer()

virtual DSMServer * nidas::core::DSMService::getDSMServer ( ) const
inlinevirtualinherited

◆ getInputs()

const std::list< SampleInput * > & nidas::core::DSMService::getInputs ( ) const
inlineinherited

References nidas::core::DSMService::_inputs.

Referenced by schedule().

◆ getName()

const std::string & nidas::core::DSMService::getName ( ) const
inlineinherited

◆ getNamespaceURI()

static const XMLCh * nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited

◆ getProcessorIterator()

ProcessorIterator DSMService::getProcessorIterator ( ) const
inherited

Referenced by printStatus().

◆ getProcessors()

virtual const std::list< SampleIOProcessor * > & nidas::core::DSMService::getProcessors ( ) const
inlinevirtualinherited

◆ getProcHeapMax()

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.

Referenced by schedule().

◆ getProcLateSampleCacheSize()

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.

Referenced by schedule().

◆ getProcSorterLength()

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

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

References _procSorterLength.

Referenced by schedule().

◆ getRawHeapMax()

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.

Referenced by schedule().

◆ getRawLateSampleCacheSize()

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.

Referenced by schedule().

◆ getRawSorterLength()

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

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

References _rawSorterLength.

Referenced by schedule().

◆ getSchedPolicy()

nidas::util::Thread::SchedPolicy nidas::core::DSMService::getSchedPolicy ( ) const
inlineinherited

◆ getSchedPriority()

int nidas::core::DSMService::getSchedPriority ( ) const
inlineinherited

◆ interrupt()

void RawSampleService::interrupt ( )
throw ( )
virtual

◆ join()

int DSMService::join ( )
throw ( )
virtualinherited

◆ operator=()

RawSampleService & nidas::dynld::RawSampleService::operator= ( const RawSampleService & )
private

Assignment not supported.

◆ printClock()

void RawSampleService::printClock ( std::ostream & ostr)
throw ( )
virtual

◆ printStatus()

void RawSampleService::printStatus ( std::ostream & ostr,
float deltat )
throw ( )
virtual

◆ schedule()

void RawSampleService::schedule ( bool optionalProcessing)
virtual

◆ setDSMServer()

void DSMService::setDSMServer ( DSMServer * val)
virtualinherited

◆ setProcHeapMax()

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, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setProcLateSampleCacheSize()

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, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setProcSorterLength()

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

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

References _procSorterLength, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setRawHeapMax()

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, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setRawLateSampleCacheSize()

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, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ setRawSorterLength()

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

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

References _rawSorterLength, and nidas::core::getSample().

Referenced by fromDOMElement().

◆ toDOMElement()

xercesc::DOMElement * DOMable::toDOMElement ( xercesc::DOMElement * node,
bool complete ) const
virtualinherited

◆ toDOMParent()

xercesc::DOMElement * DOMable::toDOMParent ( xercesc::DOMElement * parent,
bool complete ) const
virtualinherited

Create a DOMElement and append it to the parent.

Exceptions
xercesc::DOMException

Reimplemented in nidas::core::DSMConfig, nidas::core::DSMSensor, nidas::core::Project, nidas::core::SampleTag, nidas::core::Site, nidas::core::ServerSocket, and nidas::core::Variable.

Member Data Documentation

◆ _dsms

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

Referenced by printStatus().

◆ _inputs

std::list<SampleInput*> nidas::core::DSMService::_inputs
protectedinherited

◆ _name

std::string nidas::core::DSMService::_name
protectedinherited

◆ _nbytesLast

std::map<void*,long long> nidas::dynld::RawSampleService::_nbytesLast
private

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

Referenced by printStatus().

◆ _nsampsLast

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

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

Referenced by printStatus().

◆ _ochans

std::list<IOChannel*> nidas::core::DSMService::_ochans
protectedinherited

◆ _pipeline

nidas::core::SamplePipeline* nidas::dynld::RawSampleService::_pipeline
private

◆ _processors

std::list<SampleIOProcessor*> nidas::core::DSMService::_processors
protectedinherited

◆ _procHeapMax

size_t nidas::dynld::RawSampleService::_procHeapMax
private

Referenced by getProcHeapMax(), and setProcHeapMax().

◆ _procLateSampleCacheSize

unsigned int nidas::dynld::RawSampleService::_procLateSampleCacheSize
private

◆ _procSorterLength

float nidas::dynld::RawSampleService::_procSorterLength
private

◆ _rawHeapMax

size_t nidas::dynld::RawSampleService::_rawHeapMax
private

Referenced by getRawHeapMax(), and setRawHeapMax().

◆ _rawLateSampleCacheSize

unsigned int nidas::dynld::RawSampleService::_rawLateSampleCacheSize
private

◆ _rawSorterLength

float nidas::dynld::RawSampleService::_rawSorterLength
private

◆ _server

DSMServer* nidas::core::DSMService::_server
protectedinherited

◆ _subThreadMutex

nidas::util::Mutex nidas::core::DSMService::_subThreadMutex
protectedinherited

◆ _subThreads

std::set<nidas::util::Thread*> nidas::core::DSMService::_subThreads
protectedinherited

◆ _threadPolicy

nidas::util::Thread::SchedPolicy nidas::core::DSMService::_threadPolicy
protectedinherited

◆ _threadPriority

int nidas::core::DSMService::_threadPriority
protectedinherited

◆ _workerMutex

nidas::util::Mutex nidas::dynld::RawSampleService::_workerMutex
private

Referenced by printStatus().

◆ _workers

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

Keep track of the Worker for each SampleInput.

◆ namespaceURI

XMLCh * DOMable::namespaceURI = 0
staticprivateinherited

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