Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
CLBDataGram Class Reference

#include <clb_datagram.hh>

Inheritance diagram for CLBDataGram:
benchmark::chronometrable

Public Member Functions

 CLBDataGram ()
 
 ~CLBDataGram ()
 
size_t size () const
 
void resize (size_t s)
 
void clear ()
 
char * raw ()
 
const char * raw () const
 
size_t capacity () const
 
uint32_t getUDPSequenceNumber () const
 
uint32_t getRunNumber () const
 
const CLBCommonHeadergetCLBCommonHeader () const
 
const char * getPayload () const
 
bool isOptical () const
 
bool isAcoustic () const
 
bool hasInfoWord () const
 
size_t getPayloadSize () const
 
bool hasValidTimeStamp () const
 
bool isTrailer () const
 

Static Public Attributes

static const size_t DGRAM_CAPACITY = 10000
 
static boost::atomic< unsigned int > n_obj
 

Private Member Functions

 CLBDataGram (const CLBDataGram &)
 
CLBDataGramoperator= (const CLBDataGram &)
 

Private Attributes

char m_block [DGRAM_CAPACITY]
 
size_t m_size
 

Detailed Description

Author
cpellegrino

Definition at line 15 of file clb_datagram.hh.

Constructor & Destructor Documentation

◆ CLBDataGram() [1/2]

CLBDataGram::CLBDataGram ( const CLBDataGram & )
private

◆ CLBDataGram() [2/2]

CLBDataGram::CLBDataGram ( )
inline

Definition at line 37 of file clb_datagram.hh.

38 :
39 m_size(0)
40 {
41 ++n_obj;
42 }
static boost::atomic< unsigned int > n_obj

◆ ~CLBDataGram()

CLBDataGram::~CLBDataGram ( )
inline

Definition at line 44 of file clb_datagram.hh.

45 {
46 --n_obj;
47 }

Member Function Documentation

◆ operator=()

CLBDataGram & CLBDataGram::operator= ( const CLBDataGram & )
private

◆ size()

size_t CLBDataGram::size ( ) const
inline

Definition at line 49 of file clb_datagram.hh.

50 {
51 return m_size;
52 }

◆ resize()

void CLBDataGram::resize ( size_t s)
inline

Definition at line 54 of file clb_datagram.hh.

55 {
56 assert(s <= DGRAM_CAPACITY);
57 m_size = s;
58 }
static const size_t DGRAM_CAPACITY

◆ clear()

void CLBDataGram::clear ( )
inline

Definition at line 60 of file clb_datagram.hh.

61 {
62 m_size = 0;
63 }

◆ raw() [1/2]

char * CLBDataGram::raw ( )
inline

Definition at line 65 of file clb_datagram.hh.

66 {
67 return m_block;
68 }
char m_block[DGRAM_CAPACITY]

◆ raw() [2/2]

const char * CLBDataGram::raw ( ) const
inline

Definition at line 70 of file clb_datagram.hh.

71 {
72 return m_block;
73 }

◆ capacity()

size_t CLBDataGram::capacity ( ) const
inline

Definition at line 75 of file clb_datagram.hh.

76 {
77 return DGRAM_CAPACITY;
78 }

◆ getUDPSequenceNumber()

uint32_t CLBDataGram::getUDPSequenceNumber ( ) const
inline

Definition at line 80 of file clb_datagram.hh.

81 {
83 }
const CLBCommonHeader * getCLBCommonHeader() const
uint32_t udpSequenceNumber() const

◆ getRunNumber()

uint32_t CLBDataGram::getRunNumber ( ) const
inline

Definition at line 85 of file clb_datagram.hh.

86 {
87 return getCLBCommonHeader()->runNumber();
88 }
uint32_t runNumber() const

◆ getCLBCommonHeader()

const CLBCommonHeader * CLBDataGram::getCLBCommonHeader ( ) const
inline

Definition at line 90 of file clb_datagram.hh.

91 {
92 return static_cast<const CLBCommonHeader*>(
93 static_cast<const void*>(m_block));
94 }

◆ getPayload()

const char * CLBDataGram::getPayload ( ) const
inline

Definition at line 96 of file clb_datagram.hh.

97 {
98 return m_block + sizeof(CLBCommonHeader);
99 }

◆ isOptical()

bool CLBDataGram::isOptical ( ) const
inline

Definition at line 101 of file clb_datagram.hh.

102 {
103 return is_optical(getCLBCommonHeader()->dataType());
104 }
bool is_optical(unsigned int dt)

◆ isAcoustic()

bool CLBDataGram::isAcoustic ( ) const
inline

Definition at line 106 of file clb_datagram.hh.

107 {
108 return is_acoustic(getCLBCommonHeader()->dataType());
109 }
bool is_acoustic(unsigned int dt)

◆ hasInfoWord()

bool CLBDataGram::hasInfoWord ( ) const
inline

Definition at line 111 of file clb_datagram.hh.

112 {
113 return isAcoustic() && is_infoword(getPayload());
114 }
bool isAcoustic() const
const char * getPayload() const
bool is_infoword(const void *const data)
Definition infoword.hh:93

◆ getPayloadSize()

size_t CLBDataGram::getPayloadSize ( ) const
inline

Definition at line 116 of file clb_datagram.hh.

117 {
118 return m_size <= sizeof(CLBCommonHeader) ?
119 0 :
120 (m_size - sizeof(CLBCommonHeader));
121 }

◆ hasValidTimeStamp()

bool CLBDataGram::hasValidTimeStamp ( ) const
inline

Definition at line 123 of file clb_datagram.hh.

124 {
126 }
bool validTimeStamp(CLBCommonHeader const &header)

◆ isTrailer()

bool CLBDataGram::isTrailer ( ) const
inline

Definition at line 128 of file clb_datagram.hh.

129 {
131 }
bool isTrailer() const
bool isOptical() const

Member Data Documentation

◆ DGRAM_CAPACITY

const size_t CLBDataGram::DGRAM_CAPACITY = 10000
static

Definition at line 20 of file clb_datagram.hh.

◆ m_block

char CLBDataGram::m_block[DGRAM_CAPACITY]
private

Definition at line 27 of file clb_datagram.hh.

◆ m_size

size_t CLBDataGram::m_size
private

Definition at line 28 of file clb_datagram.hh.

◆ n_obj

boost::atomic< unsigned int > CLBDataGram::n_obj
static
Author
cpellegrino

Definition at line 35 of file clb_datagram.hh.


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