Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/DAQDataFormats/cxx/include/RawMicroBlockHeaderV0.h"

Inheritance diagram for daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader:

Public Member Functions

 RawMicroBlockHeader (const version_t)
 
 RawMicroBlockHeader (const RawMicroBlockHeader &)
 
 ~RawMicroBlockHeader ()
 
void init ()
 
void print (std::ostream &os=std::cout) const
 
uint32_t sizeofdata () const
 
bool setBufferSource (const void *pointer)
 
voidreadData (const void *pointer)
 
daqdataformats::RawDCMChangetDCMChan ()
 
bool setAllParameters (const void *)
 
uint32_t getDiblockId () const
 
uint32_t getDCMId () const
 
uint32_t getDetId () const
 
uint32_t getGlobalDCMID () const
 
bool setDiblockId (const uint32_t a)
 
bool setDCMId (const uint32_t a)
 
bool setDetId (const uint32_t a)
 
bool setGlobalDCMID (const uint32_t a)
 
uint32_t getV1 () const
 
bool setV1 (const uint32_t)
 
 RawMicroBlockHeader (const version_t version)
 
 RawMicroBlockHeader (const RawMicroBlockHeader &)
 
 ~RawMicroBlockHeader ()
 
void print (std::ostream &os=std::cout) const
 
uint32_t sizeofdata () const
 
uint32_t getVersion () const
 
bool setVersion (uint32_t)
 
 IMPLEMENT_GET_AND_SET (DestBuffID, uint32_t)
 
 IMPLEMENT_FIRST_GET_AND_SET (V1, uint32_t)
 

Protected Member Functions

 IMPLEMENT_FIRST_GET_AND_SET (DestBuffID, uint32_t)
 
 IMPLEMENT_FIRST_GET_AND_SET (Partition, uint32_t)
 
 IMPLEMENT_FIRST_GET_AND_SET (V0, uint32_t)
 
 INIT_FIRST (getVersion, const, uint32_t,)
 
 INIT_FIRST (setVersion,, bool, uint32_t)
 

Protected Attributes

daqdataformats::RawDCMChan_DCMChan
 

Detailed Description

Definition at line 51 of file RawMicroBlockHeaderV0.h.

Constructor & Destructor Documentation

daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::RawMicroBlockHeader ( const version_t  version)

Definition at line 24 of file RawMicroBlockHeaderV0.cpp.

24  :
25  PREVIOUS_VERSION_CLASS_NAME(version)
26  ,ZEROOUT_GET_AND_SET(DestBuffID)
27  ,ZEROOUT_GET_AND_SET(Partition)
29  ,ZEROOUT_GET_AND_SET(Version)
30  ,_DCMChan(NULL)
31 {}
#define ZEROOUT_GET_AND_SET(FUNC)
Definition: FunctionBind.h:56
const XML_Char * version
Definition: expat.h:187
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::RawMicroBlockHeader ( const RawMicroBlockHeader copyin)

Definition at line 34 of file RawMicroBlockHeaderV0.cpp.

34  :
35  PREVIOUS_VERSION_CLASS_NAME(copyin)
36  ,DEEPCOPY_GET_AND_SET(DestBuffID)
37  ,DEEPCOPY_GET_AND_SET(Partition)
39  ,DEEPCOPY_GET_AND_SET(Version)
40  ,_DCMChan(NULL)
41 {}
#define DEEPCOPY_GET_AND_SET(FUNC)
Definition: FunctionBind.h:44
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::~RawMicroBlockHeader ( )

Definition at line 45 of file RawMicroBlockHeaderV0.cpp.

References _DCMChan.

45  {
46  if(_DCMChan)
47  delete _DCMChan;
48 }
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::RawMicroBlockHeader ( const version_t  version)
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::RawMicroBlockHeader ( const RawMicroBlockHeader )
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::~RawMicroBlockHeader ( )

Member Function Documentation

daqdataformats::RawDCMChan* daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::getDCMChan ( )
inline

Definition at line 70 of file RawMicroBlockHeaderV0.h.

uint32_t daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::getDCMId ( ) const
inline

Definition at line 75 of file RawMicroBlockHeaderV0.h.

Referenced by print().

75 {return _DCMChan->getDCMId();}
uint32_t daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::getDetId ( ) const
inline

Definition at line 76 of file RawMicroBlockHeaderV0.h.

Referenced by print().

76 {return _DCMChan->getDetId();}
uint32_t daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::getDiblockId ( ) const
inline

Definition at line 74 of file RawMicroBlockHeaderV0.h.

Referenced by print().

74 {return _DCMChan->getDiblockId();}
uint32_t daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::getGlobalDCMID ( ) const
inline

Definition at line 77 of file RawMicroBlockHeaderV0.h.

77 {return _DCMChan->getGlobalDCMID();}
uint32_t daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::getV1 ( ) const
inline

Definition at line 85 of file RawMicroBlockHeaderV0.h.

References GENERATE_FUNCTION_IS_NOT_ALLOWED.

#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
uint32_t daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::getVersion ( ) const

Definition at line 58 of file RawMicroBlockHeaderV0.cpp.

References RETURN_FUNCTION.

Referenced by init(), and print().

58 { RETURN_FUNCTION(getV0)();}
#define RETURN_FUNCTION(FULLFUNCTIONNAME)
Definition: Macros.h:57
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::IMPLEMENT_FIRST_GET_AND_SET ( V1  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::IMPLEMENT_FIRST_GET_AND_SET ( DestBuffID  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::IMPLEMENT_FIRST_GET_AND_SET ( Partition  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::IMPLEMENT_FIRST_GET_AND_SET ( V0  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::IMPLEMENT_GET_AND_SET ( DestBuffID  ,
uint32_t   
)
void daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::init ( )

Definition at line 52 of file RawMicroBlockHeaderV0.cpp.

References samweb_client.client::_version, EXECUTE_FUNCTION, getVersion(), PRINT_ON_DEBUG, and setVersion().

Referenced by demo.App::__init__(), testem0.App::__init__(), Lesson1.App::__init__(), and ExN03.App::__init__().

52  {
54  PRINT_ON_DEBUG("version is set to "<<getVersion());
55 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
#define PRINT_ON_DEBUG(x)
Definition: RawDAQData.h:35
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::INIT_FIRST ( getVersion  ,
const  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::INIT_FIRST ( setVersion  ,
bool  ,
uint32_t   
)
protected
void daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::print ( std::ostream &  os = std::cout) const
void daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::print ( std::ostream &  os = std::cout) const

Destination buffer node

Partition

Destination buffer node

Partition

Definition at line 97 of file RawMicroBlockHeaderV0.cpp.

References samweb_client.client::_version, allTimeWatchdog::endl, EXECUTE_FUNCTION, novadaq::HexUtils::format(), getDCMId(), getDetId(), getDiblockId(), getVersion(), MECModelEnuComparisons::i, and sizeofdata().

97  {
98  const uint32_t size_of_data = EXECUTE_FUNCTION(sizeofdata)();
99 
100  os<<boost::format("\nMicroBlock Header(size=%u, version=%u):") % size_of_data % _version ;
101  os<<boost::format(" getDiblockId=%u")% getDiblockId();
102  os<<boost::format(" DCMId=%u" )% getDCMId();
103  os<<boost::format(" DetId=%u" )% getDetId();
104  os<<boost::format(" DestBuff=%u" )% EXECUTE_FUNCTION(getDestBuffID)(); //! Destination buffer node
105  os<<boost::format(" Partition=%u" )% EXECUTE_FUNCTION(getPartition)(); //! Partition
106  os<<boost::format(" V0=%u" )% EXECUTE_FUNCTION(getV0)();
107  os<<boost::format(" Version=%u" )% EXECUTE_FUNCTION(getVersion)();
108  os<<"\n";
109 
110  printBuffer(os);
111 
112  os<<"\nMicroBlockHeader RAW 32bit words (converted, if required, to native endian format):";
113  for(uint32_t i = 0; i < size_of_data; ++i){
114  os<<" ";
115  printWord(i,false, os);
116  }
117 
118  os<<"\nMicroBlockHeader RAW bits (converted, if required, to native endian format):";
119  for(uint32_t i = 0; i < size_of_data; ++i){
120  os<<std::endl;
121  printWord(i,true, os);
122  }
123 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
void* daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::readData ( const void pointer)
inline

Definition at line 68 of file RawMicroBlockHeaderV0.h.

References daqdataformats::RawDAQData::readDataGeneral().

Referenced by PandAna.core.core.loader::Go().

68 {return RawDAQData::readDataGeneral(pointer);};
void * readDataGeneral(const void *buffer)
General ReadData method when the sizeofdata is known.
Definition: RawDAQData.cpp:186
bool daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setAllParameters ( const void millislice_buffer)

Definition at line 62 of file RawMicroBlockHeaderV0.cpp.

References EXECUTE_FUNCTION, RETURN_FUNCTION, and setGlobalDCMID().

62  {
63 
64  const RawMilliSliceHeader millislice_header(millislice_buffer);
65 
66  setGlobalDCMID(millislice_header.getGlobalDCMID());
67  EXECUTE_FUNCTION(setDestBuffID)(millislice_header.getDestBuffID());
68  RETURN_FUNCTION(setPartition)(millislice_header.getPartition());
69 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
#define RETURN_FUNCTION(FULLFUNCTIONNAME)
Definition: Macros.h:57
bool daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setBufferSource ( const void pointer)

Check if the internal buffer is too small

Pointer to the word of the DCMChan

If it exists, set its buffer source

Since it does not exist, create a new

< version of the NanoSliceHeader equals the version of the NanoSlice

Definition at line 73 of file RawMicroBlockHeaderV0.cpp.

References _DCMChan, daqdataformats::RawDAQData::setBufferSource(), and daqdataformats::VERSION_NAMESPACE::CURRENT_FIELDS_SUB_NAMESPACE::WORD_DCMChan.

73  {
74  _Buffer = (void*)pointer;
75 
76  /// Check if the internal buffer is too small
77 #pragma GCC diagnostic push
78 #pragma GCC diagnostic ignored "-Wtype-limits"
79  if(isInternalBuffer() && _InternalBuffer.size() < rawmicroblockhdr::WORD_DCMChan){
80  _InternalBuffer.assign(rawmicroblockhdr::WORD_DCMChan + 1, 0);
81  }// end of checking if the internal buffer is too small
82 #pragma GCC diagnostic pop
83  /// Pointer to the word of the DCMChan
84  const uint32_t* pp = (uint32_t*)pointer + rawmicroblockhdr::WORD_DCMChan;
85 
86  /// If it exists, set its buffer source
87  if(_DCMChan) return _DCMChan->setBufferSource(pp);
88 
89  /// Since it does not exist, create a new
90  _DCMChan = new RawDCMChan(pointer); ///< version of the NanoSliceHeader equals the version of the NanoSlice
91 
92  return true;
93 }
bool setBufferSource(const void *)
We are not going to overload these funtions, so no need to declare them virtual.
Definition: RawDAQData.cpp:880
bool daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setDCMId ( const uint32_t  a)
inline

Definition at line 80 of file RawMicroBlockHeaderV0.h.

80 {return _DCMChan->setDCMId(a);}
const double a
bool daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setDetId ( const uint32_t  a)
inline

Definition at line 81 of file RawMicroBlockHeaderV0.h.

81 {return _DCMChan->setDetId(a);}
const double a
bool daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setDiblockId ( const uint32_t  a)
inline

Definition at line 79 of file RawMicroBlockHeaderV0.h.

79 {return _DCMChan->setDiblockId(a);}
const double a
bool daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setGlobalDCMID ( const uint32_t  a)
inline

Definition at line 82 of file RawMicroBlockHeaderV0.h.

Referenced by setAllParameters().

82 {return _DCMChan->setGlobalDCMID(a);}
const double a
bool daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setV1 ( const uint32_t  )
inline

Definition at line 86 of file RawMicroBlockHeaderV0.h.

References GENERATE_FUNCTION_IS_NOT_ALLOWED, IMPLEMENT_FIRST_GET_AND_SET, and INIT_FIRST.

#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
bool daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setVersion ( uint32_t  a)

At this point, version cannot be zero

Definition at line 59 of file RawMicroBlockHeaderV0.cpp.

References a, and RETURN_FUNCTION.

Referenced by init().

59 { RETURN_FUNCTION(setV0)(a);}
#define RETURN_FUNCTION(FULLFUNCTIONNAME)
Definition: Macros.h:57
const double a
uint32_t daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::sizeofdata ( ) const
inline
uint32_t daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::sizeofdata ( ) const
inline

Member Data Documentation

daqdataformats::RawDCMChan* daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::_DCMChan
protected

Definition at line 99 of file RawMicroBlockHeaderV0.h.

Referenced by setBufferSource(), and ~RawMicroBlockHeader().


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