Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
daqdataformats::DataBlockConstructor Class Reference

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

Inheritance diagram for daqdataformats::DataBlockConstructor:
daqdataformats::RawDAQDataConstructor

Public Member Functions

 DataBlockConstructor ()
 
 ~DataBlockConstructor ()
 
daqdataformats::RawDAQDatagetFilledDataFormat (const daqdataformats::version_t) const
 
daqdataformats::RawDAQDatagetEmptyDataFormat (const daqdataformats::version_t) const
 method to create an empty dataformat with a given version More...
 
bool fillDataFormat (daqdataformats::RawDAQData *) const
 method to Fill the input dataformat More...
 
version_t getDataBlockVersion (const RawDataBlock *) const
 Gets the DataBlock version. More...
 
version_t getVersion (const daqdataformats::RawDAQData *inver) const
 Get version of the input dataformat. More...
 
version_t getMaximumVersion () const
 Get maximum version for the dataformat. More...
 

Public Attributes

datablockheader::DataBlockHeaderConstructor _DataBlockHeaderConstructor
 
TriggerConstructor _TriggerConstructor
 
microblock::MicroBlockConstructor _MicroBlockConstructor
 
MilliSliceConstructor _MilliSliceConstructor
 

Protected Member Functions

uint32_t boolToUint32_t (const bool number) const
 Bool to uint abd backwards conversions. More...
 
bool uint32_tToBool (const uint32_t number) const
 

Protected Attributes

version_t _maximumVersion
 Maximum version of the dataformat. More...
 

Private Member Functions

daqdataformats::RawDataBlockconstructDataBlock (const daqdataformats::version_t) const
 

Detailed Description

Definition at line 36 of file DataBlockConstructor.h.

Constructor & Destructor Documentation

daqdataformats::DataBlockConstructor::DataBlockConstructor ( )
daqdataformats::DataBlockConstructor::~DataBlockConstructor ( )

Definition at line 35 of file DataBlockConstructor.cpp.

35 { }

Member Function Documentation

uint32_t daqdataformats::RawDAQDataConstructor::boolToUint32_t ( const bool  number) const
inlineprotectedinherited

Bool to uint abd backwards conversions.

Definition at line 156 of file RawDAQDataConstructor.h.

156 { return ((number) ? 1 : 0); }
daqdataformats::RawDataBlock * daqdataformats::DataBlockConstructor::constructDataBlock ( const daqdataformats::version_t  ver) const
private

Definition at line 57 of file DataBlockConstructor.cpp.

References DBSIZE.

Referenced by getEmptyDataFormat(), getFilledDataFormat(), and getVersion().

57  {
58  return new daqdataformats::RawDataBlock(DBSIZE, (const uint32_t)0, ver);
59 }
#define DBSIZE
bool daqdataformats::DataBlockConstructor::fillDataFormat ( daqdataformats::RawDAQData ) const
virtual

method to Fill the input dataformat

initialize DB header

adding microblock 2

adding microblock 1

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 62 of file DataBlockConstructor.cpp.

References _DataBlockHeaderConstructor, _MicroBlockConstructor, _MilliSliceConstructor, daqdataformats::RawDataBlock::addMicroBlock(), daqdataformats::RawDataBlock::close(), daqdataformats::RawDAQData::getBuffer(), daqdataformats::MilliSliceConstructor::getFilledDataFormat(), daqdataformats::RawMilliSlice::getFloatingMicroSlice(), daqdataformats::RawMilliSlice::getMicrosliceNumber(), daqdataformats::microblock::RAWMICROBLOCK_LATEST_VERSION, and daqdataformats::RawMilliSlice::setFloatingMicroSlice().

Referenced by getFilledDataFormat().

62  {
64  _DataBlockHeaderConstructor.fillDataFormat(datablock->getHeader());
65 
66  /// initialize DB header
67  datablock->getHeader()->init();
68 
70 
71  /// adding microblock 2
72  for(uint32_t imicroslice = 0; imicroslice < millislice->getMicrosliceNumber(); ++imicroslice){
73  millislice->setFloatingMicroSlice(imicroslice);
74  datablock->addMicroBlock(millislice->getBuffer(), millislice->getFloatingMicroSlice()->getBuffer());
75  }
76 
77  /// adding microblock 1
78  RawMicroBlock* microblock1 = (RawMicroBlock*)_MicroBlockConstructor.getFilledDataFormat(microblock::RAWMICROBLOCK_LATEST_VERSION);
79  datablock->addMicroBlock(microblock1->getBuffer());
80 
81 
82  datablock->close();
83 
84  delete millislice;
85  delete microblock1;
86 
87  return true;
88 }
microblock::MicroBlockConstructor _MicroBlockConstructor
daqdataformats::RawDAQData * getFilledDataFormat(const daqdataformats::version_t) const
bool setFloatingMicroSlice(const uint32_t) const
static const version_t RAWMICROBLOCK_LATEST_VERSION
daqdataformats::RawMicroSlice * getFloatingMicroSlice() const
Definition: RawMilliSlice.h:48
void * getBuffer() const
Definition: RawDAQData.h:131
datablockheader::DataBlockHeaderConstructor _DataBlockHeaderConstructor
uint32_t getMicrosliceNumber() const
Definition: RawMilliSlice.h:63
bool close(bool produce_crc=false)
Definition: RawDataBlock.h:80
bool addMicroBlock(const void *microblock_buffer, const bool check_mc_flag=true)
Definition: RawDataBlock.h:42
version_t daqdataformats::DataBlockConstructor::getDataBlockVersion ( const RawDataBlock nano) const

Gets the DataBlock version.

Definition at line 92 of file DataBlockConstructor.cpp.

92  {
93  return (version_t) nano->getHeader()->getVersion();
94 }
int32_t version_t
Definition: RawDAQData.h:72
daqdataformats::RawDAQData * daqdataformats::DataBlockConstructor::getEmptyDataFormat ( const daqdataformats::version_t  ) const
virtual

method to create an empty dataformat with a given version

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 45 of file DataBlockConstructor.cpp.

References daqdataformats::RawDataBlock::close(), constructDataBlock(), and daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION.

Referenced by daqdataformats::DataBlockUnitTest::~DataBlockUnitTest().

45  {
46 
47  RawDataBlock* datablock = constructDataBlock(ver);
48 
50  datablock->close();
51 
52 
53  return datablock;
54 }
daqdataformats::RawDataBlock * constructDataBlock(const daqdataformats::version_t) const
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
daqdataformats::RawDAQData * daqdataformats::DataBlockConstructor::getFilledDataFormat ( const daqdataformats::version_t  ) const
virtual

method to create a filled dataformat with a given version

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 38 of file DataBlockConstructor.cpp.

References constructDataBlock(), and fillDataFormat().

Referenced by daqdataformats::EventConstructor::fillDataFormat().

38  {
39  RawDataBlock* datablock = constructDataBlock(ver);
40  fillDataFormat(datablock);
41  return datablock;
42 }
daqdataformats::RawDataBlock * constructDataBlock(const daqdataformats::version_t) const
bool fillDataFormat(daqdataformats::RawDAQData *) const
method to Fill the input dataformat
version_t daqdataformats::RawDAQDataConstructor::getMaximumVersion ( ) const
inlineinherited

Get maximum version for the dataformat.

Definition at line 152 of file RawDAQDataConstructor.h.

References daqdataformats::RawDAQDataConstructor::_maximumVersion.

152 {return _maximumVersion;}
version_t _maximumVersion
Maximum version of the dataformat.
version_t daqdataformats::DataBlockConstructor::getVersion ( const daqdataformats::RawDAQData ) const
inlinevirtual

Get version of the input dataformat.

Reimplemented from daqdataformats::RawDAQDataConstructor.

Definition at line 48 of file DataBlockConstructor.h.

References constructDataBlock().

48  {
49  const RawDataBlock* nano_ver = (const RawDataBlock*)inver;
50  return nano_ver->getHeader()->getVersion();
51  }
bool daqdataformats::RawDAQDataConstructor::uint32_tToBool ( const uint32_t  number) const
inlineprotectedinherited

Definition at line 157 of file RawDAQDataConstructor.h.

157 { return ((number) ? true : false); }

Member Data Documentation

datablockheader::DataBlockHeaderConstructor daqdataformats::DataBlockConstructor::_DataBlockHeaderConstructor

Definition at line 57 of file DataBlockConstructor.h.

Referenced by fillDataFormat().

version_t daqdataformats::RawDAQDataConstructor::_maximumVersion
protectedinherited

Maximum version of the dataformat.

Definition at line 162 of file RawDAQDataConstructor.h.

Referenced by daqdataformats::RawDAQDataConstructor::getMaximumVersion().

microblock::MicroBlockConstructor daqdataformats::DataBlockConstructor::_MicroBlockConstructor

Definition at line 59 of file DataBlockConstructor.h.

Referenced by fillDataFormat().

MilliSliceConstructor daqdataformats::DataBlockConstructor::_MilliSliceConstructor

Definition at line 60 of file DataBlockConstructor.h.

Referenced by fillDataFormat().

TriggerConstructor daqdataformats::DataBlockConstructor::_TriggerConstructor

Definition at line 58 of file DataBlockConstructor.h.


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