nidas  v1.2-1520
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
nidas::core::SampleHeader Class Reference

The gcc buildin atomic operations are not supported on arm, and one must use -march=i686 for them to work on 32 bit x86. More...

#include <Sample.h>

Public Member Functions

 SampleHeader (sampleType t=CHAR_ST)
 
dsm_time_t getTimeTag () const
 
void setTimeTag (dsm_time_t val)
 
unsigned int getDataByteLength () const
 Get the value of the length member of the header. More...
 
void setDataByteLength (unsigned int val)
 Set the length member of the header. More...
 
dsm_sample_id_t getId () const
 
void setId (dsm_sample_id_t val)
 
dsm_sample_id_t getRawId () const
 
void setRawId (dsm_sample_id_t val)
 
unsigned int getDSMId () const
 Get the DSM identifier for the sample. More...
 
void setDSMId (unsigned int val)
 
unsigned int getSpSId () const
 Get the sample identifier for the sample. More...
 
void setSpSId (unsigned int val)
 
unsigned char getType () const
 Get the data type of this sample. More...
 

Static Public Member Functions

static unsigned int getSizeOf ()
 
static unsigned int getMaxDataLength ()
 

Protected Attributes

dsm_time_t _tt
 Time-tag in non-leap microseconds since Jan 1, 1970 00:00 GMT. More...
 
dsm_sample_length_t _length
 Length of data (# of bytes) in the sample - does not include header fields. More...
 
dsm_sample_id_t _tid
 An identifier for this sample consisting of packed bit fields. More...
 

Detailed Description

The gcc buildin atomic operations are not supported on arm, and one must use -march=i686 for them to work on 32 bit x86.

The header fields of a Sample: a time_tag, a data length field, and an identifier.

Constructor & Destructor Documentation

nidas::core::SampleHeader::SampleHeader ( sampleType  t = CHAR_ST)
inline

Member Function Documentation

unsigned int nidas::core::SampleHeader::getDataByteLength ( ) const
inline

Get the value of the length member of the header.

This is the length in bytes of the data portion of the sample.

References _length.

Referenced by PacketReader::checkPacket(), nidas::core::Sample::getDataByteLength(), nidas::core::BadSampleFilter::invalidSampleHeader(), nidas::core::operator<<(), and nidas::dynld::SampleInputStream::sampleFromHeader().

unsigned int nidas::core::SampleHeader::getDSMId ( ) const
inline

Get the DSM identifier for the sample.

References _tid, and GET_DSM_ID.

Referenced by nidas::core::Sample::getDSMId().

dsm_sample_id_t nidas::core::SampleHeader::getId ( ) const
inline
static unsigned int nidas::core::SampleHeader::getMaxDataLength ( )
inlinestatic
dsm_sample_id_t nidas::core::SampleHeader::getRawId ( ) const
inline

References _tid.

Referenced by nidas::core::Sample::getRawId().

static unsigned int nidas::core::SampleHeader::getSizeOf ( )
inlinestatic
unsigned int nidas::core::SampleHeader::getSpSId ( ) const
inline

Get the sample identifier for the sample.

References _tid, and GET_SPS_ID.

Referenced by nidas::core::Sample::getSpSId().

dsm_time_t nidas::core::SampleHeader::getTimeTag ( ) const
inline
unsigned char nidas::core::SampleHeader::getType ( ) const
inline

Get the data type of this sample.

The type can only be set in the constructor.

References _tid, and GET_SAMPLE_TYPE.

Referenced by PacketReader::checkPacket(), nidas::core::BadSampleFilter::invalidSampleHeader(), nidas::core::operator<<(), and nidas::dynld::SampleInputStream::sampleFromHeader().

void nidas::core::SampleHeader::setDataByteLength ( unsigned int  val)
inline

Set the length member of the header.

This is the length in bytes.

References _length.

Referenced by nidas::dynld::UDPSampleOutput::receive(), and nidas::core::SampleT< char >::setDataLength().

void nidas::core::SampleHeader::setDSMId ( unsigned int  val)
inline

References _tid, and SET_DSM_ID.

Referenced by nidas::core::Sample::setDSMId().

void nidas::core::SampleHeader::setId ( dsm_sample_id_t  val)
inline

References _tid, and SET_FULL_ID.

Referenced by nidas::core::Sample::setId().

void nidas::core::SampleHeader::setRawId ( dsm_sample_id_t  val)
inline
void nidas::core::SampleHeader::setSpSId ( unsigned int  val)
inline

References _tid, and SET_SPS_ID.

Referenced by nidas::core::Sample::setSpSId().

void nidas::core::SampleHeader::setTimeTag ( dsm_time_t  val)
inline

Member Data Documentation

dsm_sample_length_t nidas::core::SampleHeader::_length
protected

Length of data (# of bytes) in the sample - does not include header fields.

Referenced by getDataByteLength(), and setDataByteLength().

dsm_sample_id_t nidas::core::SampleHeader::_tid
protected

An identifier for this sample consisting of packed bit fields.

The most significant 6 bits are a data type enumeration (float, double etc), which is accessed with set/getType().

The other 26 bits are the sample identifier, which is further broken into 10 bits of a DSM identifier, acccessed with get/setDSMId(), and 16 bits of a sensor/sample identifier, accessed with get/setSpSId().

Referenced by getDSMId(), getId(), getRawId(), getSpSId(), getType(), setDSMId(), setId(), setRawId(), and setSpSId().

dsm_time_t nidas::core::SampleHeader::_tt
protected

Time-tag in non-leap microseconds since Jan 1, 1970 00:00 GMT.

Referenced by getTimeTag(), and setTimeTag().


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