Jpp  pmt_effective_area_update
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
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::CLBDataGram ( const CLBDataGram )
private
CLBDataGram::CLBDataGram ( )
inline

Definition at line 37 of file clb_datagram.hh.

38  :
39  m_size(0)
40  {
41  ++n_obj;
42  }
size_t m_size
Definition: clb_datagram.hh:28
static boost::atomic< unsigned int > n_obj
Definition: clb_datagram.hh:35
CLBDataGram::~CLBDataGram ( )
inline

Definition at line 44 of file clb_datagram.hh.

45  {
46  --n_obj;
47  }
static boost::atomic< unsigned int > n_obj
Definition: clb_datagram.hh:35

Member Function Documentation

CLBDataGram& CLBDataGram::operator= ( const CLBDataGram )
private
size_t CLBDataGram::size ( ) const
inline

Definition at line 49 of file clb_datagram.hh.

50  {
51  return m_size;
52  }
size_t m_size
Definition: clb_datagram.hh:28
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
Definition: clb_datagram.hh:20
size_t m_size
Definition: clb_datagram.hh:28
void CLBDataGram::clear ( )
inline

Definition at line 60 of file clb_datagram.hh.

61  {
62  m_size = 0;
63  }
size_t m_size
Definition: clb_datagram.hh:28
char* CLBDataGram::raw ( )
inline

Definition at line 65 of file clb_datagram.hh.

66  {
67  return m_block;
68  }
char m_block[DGRAM_CAPACITY]
Definition: clb_datagram.hh:27
const char* CLBDataGram::raw ( ) const
inline

Definition at line 70 of file clb_datagram.hh.

71  {
72  return m_block;
73  }
char m_block[DGRAM_CAPACITY]
Definition: clb_datagram.hh:27
size_t CLBDataGram::capacity ( ) const
inline

Definition at line 75 of file clb_datagram.hh.

76  {
77  return DGRAM_CAPACITY;
78  }
static const size_t DGRAM_CAPACITY
Definition: clb_datagram.hh:20
uint32_t CLBDataGram::getUDPSequenceNumber ( ) const
inline

Definition at line 80 of file clb_datagram.hh.

81  {
83  }
const CLBCommonHeader * getCLBCommonHeader() const
Definition: clb_datagram.hh:90
uint32_t udpSequenceNumber() const
uint32_t CLBDataGram::getRunNumber ( ) const
inline

Definition at line 85 of file clb_datagram.hh.

86  {
87  return getCLBCommonHeader()->runNumber();
88  }
const CLBCommonHeader * getCLBCommonHeader() const
Definition: clb_datagram.hh:90
uint32_t runNumber() const
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  }
char m_block[DGRAM_CAPACITY]
Definition: clb_datagram.hh:27
const char* CLBDataGram::getPayload ( ) const
inline

Definition at line 96 of file clb_datagram.hh.

97  {
98  return m_block + sizeof(CLBCommonHeader);
99  }
char m_block[DGRAM_CAPACITY]
Definition: clb_datagram.hh:27
bool CLBDataGram::isOptical ( ) const
inline

Definition at line 101 of file clb_datagram.hh.

102  {
103  return is_optical(getCLBCommonHeader()->dataType());
104  }
const CLBCommonHeader * getCLBCommonHeader() const
Definition: clb_datagram.hh:90
bool is_optical(unsigned int dt)
Definition: datatypespec.hh:12
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)
Definition: datatypespec.hh:17
const CLBCommonHeader * getCLBCommonHeader() const
Definition: clb_datagram.hh:90
bool CLBDataGram::hasInfoWord ( ) const
inline

Definition at line 111 of file clb_datagram.hh.

112  {
113  return isAcoustic() && is_infoword(getPayload());
114  }
const char * getPayload() const
Definition: clb_datagram.hh:96
bool is_infoword(const void *const data)
Definition: infoword.hh:93
bool isAcoustic() const
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  }
size_t m_size
Definition: clb_datagram.hh:28
bool CLBDataGram::hasValidTimeStamp ( ) const
inline

Definition at line 123 of file clb_datagram.hh.

124  {
126  }
const CLBCommonHeader * getCLBCommonHeader() const
Definition: clb_datagram.hh:90
bool validTimeStamp(CLBCommonHeader const &header)
bool CLBDataGram::isTrailer ( ) const
inline

Definition at line 128 of file clb_datagram.hh.

129  {
130  return isOptical() && ::isTrailer(*getCLBCommonHeader());
131  }
const CLBCommonHeader * getCLBCommonHeader() const
Definition: clb_datagram.hh:90
bool isTrailer() const
bool isOptical() const

Member Data Documentation

const size_t CLBDataGram::DGRAM_CAPACITY = 10000
static

Definition at line 20 of file clb_datagram.hh.

char CLBDataGram::m_block[DGRAM_CAPACITY]
private

Definition at line 27 of file clb_datagram.hh.

size_t CLBDataGram::m_size
private

Definition at line 28 of file clb_datagram.hh.

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: