nidas v1.2.3
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.
 
void setDataByteLength (unsigned int val)
 Set the length member of the header.
 
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.
 
void setDSMId (unsigned int val)
 
unsigned int getSpSId () const
 Get the sample identifier for the sample.
 
void setSpSId (unsigned int val)
 
unsigned char getType () const
 Get the data type of this sample.
 

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.
 
dsm_sample_length_t _length
 Length of data (# of bytes) in the sample - does not include header fields.
 
dsm_sample_id_t _tid
 An identifier for this sample consisting of packed bit fields.
 

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

◆ SampleHeader()

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

Member Function Documentation

◆ getDataByteLength()

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::dynld::SampleInputStream::nextSample(), nidas::core::operator<<(), and nidas::dynld::SampleInputStream::sampleFromHeader().

◆ getDSMId()

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

◆ getId()

dsm_sample_id_t nidas::core::SampleHeader::getId ( ) const
inline

◆ getMaxDataLength()

static unsigned int nidas::core::SampleHeader::getMaxDataLength ( )
inlinestatic

◆ getRawId()

dsm_sample_id_t nidas::core::SampleHeader::getRawId ( ) const
inline

◆ getSizeOf()

static unsigned int nidas::core::SampleHeader::getSizeOf ( )
inlinestatic

◆ getSpSId()

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

◆ getTimeTag()

dsm_time_t nidas::core::SampleHeader::getTimeTag ( ) const
inline

◆ getType()

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::operator<<(), and nidas::dynld::SampleInputStream::sampleFromHeader().

◆ setDataByteLength()

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

Set the length member of the header.

This is the length in bytes.

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

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

◆ setDSMId()

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

References _tid, and SET_DSM_ID.

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

◆ setId()

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

References _tid, and SET_FULL_ID.

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

◆ setRawId()

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

◆ setSpSId()

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

References _tid, and SET_SPS_ID.

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

◆ setTimeTag()

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

Member Data Documentation

◆ _length

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

◆ _tid

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

◆ _tt

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: