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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/DAQDataFormats/cxx/include/RawConfigurationBlockV0.h"

Inheritance diagram for daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock:

Public Member Functions

 RawConfigurationBlock (const version_t)
 The default constructor. More...
 
 RawConfigurationBlock (const RawConfigurationBlock &)
 
 ~RawConfigurationBlock ()
 Destructor. More...
 
void init ()
 
void print (std::ostream &os=std::cout) const
 
uint32_t sizeofdata () const
 
bool setBufferSource (const void *pointer)
 
voidreadData (const void *)
 
 INIT_FIRST (close,, bool, const bool)
 
 INIT_FIRST (getHeader,, daqdataformats::RawConfigurationHeader *,)
 
 INIT_FIRST (getTail,, daqdataformats::RawConfigurationTail *,)
 
 INIT_FIRST (getTailConst, const, daqdataformats::RawConfigurationTail *,)
 
 INIT_FIRST (getSystemID,, daqdataformats::RawConfigurationSystemID *,)
 
 INIT_FIRST (getSystemIDConst, const, daqdataformats::RawConfigurationSystemID *,)
 
 INIT_FIRST (getSystemIDWithInput,, daqdataformats::RawConfigurationSystemID *, const uint32_t)
 
 INIT_FIRST (getSystemIDConstWithInput, const, daqdataformats::RawConfigurationSystemID *, const uint32_t)
 
 INIT_FIRST (setFloatingSystemIDToBufferSource, const, bool, const void *)
 
 INIT_FIRST (setFloatingSystemID, const, bool, const uint32_t)
 
 INIT_FIRST (addSystemID,, bool, const void *)
 
 INIT_FIRST (getMarkerHi1, const, uint32_t,)
 
 INIT_FIRST (getMarkerHi2, const, uint32_t,)
 
 INIT_FIRST (getMarkerLo1, const, uint32_t,)
 
 INIT_FIRST (getMarkerLo2, const, uint32_t,)
 
 INIT_FIRST (getConfigurationVersion, const, uint32_t,)
 
 INIT_FIRST (getConfigurationBlockSize, const, uint32_t,)
 
 INIT_FIRST (getSystemNumber, const, uint32_t,)
 
 INIT_FIRST_GET_AND_SET (DetectorID, uint32_t)
 
 INIT_FIRST_GET_AND_SET (ResourceManagerID, uint32_t)
 
 INIT_FIRST_GET_AND_SET (RunNumber, uint32_t)
 
 INIT_FIRST_GET_AND_SET (RunType, uint32_t)
 
 INIT_FIRST_GET_AND_SET (Partition, uint32_t)
 
 INIT_FIRST_GET_AND_SET (Subrun, uint32_t)
 
 INIT_FIRST_GET_AND_SET (SystemVersionIDX, uint32_t)
 
 RawConfigurationBlock (const version_t)
 The default constructor. More...
 
 RawConfigurationBlock (const RawConfigurationBlock &)
 
 ~RawConfigurationBlock ()
 Destructor. More...
 

Protected Member Functions

bool setVersions ()
 Setting versions. More...
 
uint32_t getPredefinedSize () const
 

Protected Attributes

daqdataformats::RawConfigurationTail_tail
 
daqdataformats::RawConfigurationHeader_header
 
daqdataformats::RawConfigurationSystemID_floatingSystemID
 
int _floatingSystemIDNumber
 
version_t _version_ConfigurationSystemID
 
version_t _version_ConfigurationTail
 

Detailed Description

Definition at line 38 of file RawConfigurationBlockV0.h.

Constructor & Destructor Documentation

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

The default constructor.

Definition at line 27 of file RawConfigurationBlockV0.cpp.

27  :
30  ,ZEROOUT_FUNCTION(getHeader)
31  ,ZEROOUT_FUNCTION(getTail)
32  ,ZEROOUT_FUNCTION(getTailConst)
33  ,ZEROOUT_FUNCTION(getSystemID)
34  ,ZEROOUT_FUNCTION(getSystemIDConst)
35  ,ZEROOUT_FUNCTION(getSystemIDWithInput)
36  ,ZEROOUT_FUNCTION(getSystemIDConstWithInput)
37  ,ZEROOUT_FUNCTION(setFloatingSystemIDToBufferSource)
38  ,ZEROOUT_FUNCTION(setFloatingSystemID)
39  ,ZEROOUT_FUNCTION(addSystemID)
40  ,ZEROOUT_FUNCTION(getMarkerHi1)
41  ,ZEROOUT_FUNCTION(getMarkerHi2)
42  ,ZEROOUT_FUNCTION(getMarkerLo1)
43  ,ZEROOUT_FUNCTION(getMarkerLo2)
44  ,ZEROOUT_FUNCTION(getConfigurationVersion)
45  ,ZEROOUT_FUNCTION(getConfigurationBlockSize)
46  ,ZEROOUT_FUNCTION(getSystemNumber)
47  ,ZEROOUT_GET_AND_SET(DetectorID)
48  ,ZEROOUT_GET_AND_SET(ResourceManagerID)
49  ,ZEROOUT_GET_AND_SET(RunNumber)
51  ,ZEROOUT_GET_AND_SET(Partition)
52  ,ZEROOUT_GET_AND_SET(Subrun)
53  ,ZEROOUT_GET_AND_SET(SystemVersionIDX)
54  ,_tail (NULL)
55  ,_header (NULL)
56  ,_floatingSystemID (NULL)
60 { }
#define ZEROOUT_FUNCTION(FUNC)
Definition: FunctionBind.h:52
#define sizeofdata_t
Definition: FunctionBind.h:30
#define ZEROOUT_GET_AND_SET(FUNC)
Definition: FunctionBind.h:56
const XML_Char * version
Definition: expat.h:187
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
daqdataformats::RawConfigurationSystemID * _floatingSystemID
procfile close()
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::RawConfigurationBlock ( const RawConfigurationBlock copyin)

Definition at line 63 of file RawConfigurationBlockV0.cpp.

63  :
64  RawDAQData(copyin)
66  ,DEEPCOPY_FUNCTION(getHeader)
67  ,DEEPCOPY_FUNCTION(getTail)
68  ,DEEPCOPY_FUNCTION(getTailConst)
69  ,DEEPCOPY_FUNCTION(getSystemID)
70  ,DEEPCOPY_FUNCTION(getSystemIDConst)
71  ,DEEPCOPY_FUNCTION(getSystemIDWithInput)
72  ,DEEPCOPY_FUNCTION(getSystemIDConstWithInput)
73  ,DEEPCOPY_FUNCTION(setFloatingSystemIDToBufferSource)
74  ,DEEPCOPY_FUNCTION(setFloatingSystemID)
75  ,DEEPCOPY_FUNCTION(addSystemID)
76  ,DEEPCOPY_FUNCTION(getMarkerHi1)
77  ,DEEPCOPY_FUNCTION(getMarkerHi2)
78  ,DEEPCOPY_FUNCTION(getMarkerLo1)
79  ,DEEPCOPY_FUNCTION(getMarkerLo2)
80  ,DEEPCOPY_FUNCTION(getConfigurationVersion)
81  ,DEEPCOPY_FUNCTION(getConfigurationBlockSize)
82  ,DEEPCOPY_FUNCTION(getSystemNumber)
83  ,DEEPCOPY_GET_AND_SET(DetectorID)
84  ,DEEPCOPY_GET_AND_SET(ResourceManagerID)
85  ,DEEPCOPY_GET_AND_SET(RunNumber)
87  ,DEEPCOPY_GET_AND_SET(Partition)
88  ,DEEPCOPY_GET_AND_SET(Subrun)
89  ,DEEPCOPY_GET_AND_SET(SystemVersionIDX)
90  ,_tail (NULL)
91  ,_header (NULL)
92  ,_floatingSystemID (NULL)
96 {}
#define DEEPCOPY_FUNCTION(FUNC)
Definition: FunctionBind.h:40
#define DEEPCOPY_GET_AND_SET(FUNC)
Definition: FunctionBind.h:44
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
daqdataformats::RawConfigurationSystemID * _floatingSystemID
procfile close()
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::~RawConfigurationBlock ( )

Destructor.

Definition at line 101 of file RawConfigurationBlockV0.cpp.

References _floatingSystemID, _header, and _tail.

101  {
102  if(_header) delete _header;
103  if(_tail) delete _tail;
105 }
daqdataformats::RawConfigurationSystemID * _floatingSystemID
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::RawConfigurationBlock ( const version_t  )

The default constructor.

daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::RawConfigurationBlock ( const RawConfigurationBlock )
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::~RawConfigurationBlock ( )

Destructor.

Member Function Documentation

uint32_t daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::getPredefinedSize ( ) const
inlineprotected

Definition at line 91 of file RawConfigurationBlockV0.h.

91 {return 1;}
void daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::init ( )

This is needed for the formats with variable size If buffer is internal, need to resize it

header + crc

Initialize _floatingSystemIDNumber

Definition at line 109 of file RawConfigurationBlockV0.cpp.

References _floatingSystemID, _floatingSystemIDNumber, _header, _tail, _version_ConfigurationSystemID, a, daqdataformats::RawConfigurationBlock::close(), EXECUTE_FUNCTION, daqdataformats::RawConfigurationBlock::getSystemID(), daqdataformats::RawConfigurationBlock::getSystemIDConst(), makeTrainCVSamples::int, RAWBUFF32, RETURN_FUNCTION, and sizeofdata().

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

109  {
110 
111  /// This is needed for the formats with variable size
112  /// If buffer is internal, need to resize it
113  if(isInternalBuffer()){
114  _InternalBuffer.resize(_header->sizeofdata() + 1);
115  checkBufferInternalness();
116  }
117 
118  _header->init();
119 
120  /// header + crc
121  _header->setConfigurationBlockSize(_header->sizeofdata() + 1);
122 
123 
124  //PRINT_ON_DEBUG("Adresses "<<getBuffer()<<" header"<<_header->getBuffer())
125  /// Initialize _floatingSystemIDNumber
127 }
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( close  ,
bool  ,
const bool   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getHeader  ,
daqdataformats::RawConfigurationHeader  
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getTail  ,
daqdataformats::RawConfigurationTail  
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getTailConst  ,
const  ,
daqdataformats::RawConfigurationTail  
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getSystemID  ,
daqdataformats::RawConfigurationSystemID  
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getSystemIDConst  ,
const  ,
daqdataformats::RawConfigurationSystemID  
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getSystemIDWithInput  ,
daqdataformats::RawConfigurationSystemID ,
const uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getSystemIDConstWithInput  ,
const  ,
daqdataformats::RawConfigurationSystemID ,
const uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( setFloatingSystemIDToBufferSource  ,
const  ,
bool  ,
const void  
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( setFloatingSystemID  ,
const  ,
bool  ,
const uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( addSystemID  ,
bool  ,
const void  
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getMarkerHi1  ,
const  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getMarkerHi2  ,
const  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getMarkerLo1  ,
const  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getMarkerLo2  ,
const  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getConfigurationVersion  ,
const  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getConfigurationBlockSize  ,
const  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST ( getSystemNumber  ,
const  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST_GET_AND_SET ( DetectorID  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST_GET_AND_SET ( ResourceManagerID  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST_GET_AND_SET ( RunNumber  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST_GET_AND_SET ( RunType  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST_GET_AND_SET ( Partition  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST_GET_AND_SET ( Subrun  ,
uint32_t   
)
daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::INIT_FIRST_GET_AND_SET ( SystemVersionIDX  ,
uint32_t   
)
void daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::print ( std::ostream &  os = std::cout) const

see if the tail is valid

Definition at line 355 of file RawConfigurationBlockV0.cpp.

References _header, samweb_client.client::_version, EXECUTE_FUNCTION, daqdataformats::RawConfigurationBlock::getSystemID(), daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::Marker_value, sizeofdata(), and log_trawl::tail().

355  {
356 
357  os<<"----------ConfigurationBlock----------------------------------------size="<<EXECUTE_FUNCTION(sizeofdata)();
358  _header->print(os);
359 
360  const uint32_t nsystems = EXECUTE_FUNCTION(getSystemNumber)();
361 
362  os<<"\nNumber of systems = "<<nsystems<<"\n";
363 
364 
365  daqdataformats::RawConfigurationBlock confblock_copy(_Buffer, _version);
366 
367  if(nsystems){
368  for(uint32_t isystem = 0; isystem < nsystems; ++isystem){
369  confblock_copy.getSystemID(isystem)->print(os);
370  }
371  }
372 
373  daqdataformats::RawConfigurationTail* tail = confblock_copy.getTail();
374 
375  /// see if the tail is valid
376  if(tail->getMarkerLo1() == daqdataformats::rawconftail::Marker_value[0] && tail->getMarkerLo2() == daqdataformats::rawconftail::Marker_value[1]){
377  tail->print(os);
378  }
379  else
380  os<<"Configuration Block is not closed\n";
381 
382 
383 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
def tail(path, window=20)
Definition: log_trawl.py:24
void * daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::readData ( const void buffer)

If internal buffer, need to adjust the size

Read the header

If internal buffer, need to adjust the size

Now, read the rest of the configuration block

Definition at line 326 of file RawConfigurationBlockV0.cpp.

References _header, EXECUTE_FUNCTION, and sizeofdata().

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

327 {
328  const uint32_t header_size = _header->sizeofdata();
329 
330  /// If internal buffer, need to adjust the size
331  if(_shouldBufferBeInternal){
332  resizeInternalBuffer(header_size);
333  checkBufferInternalness();
334  }
335 
336  /// Read the header
337  void* buffer_new = _header->readData(buffer);
338 
339  /// If internal buffer, need to adjust the size
340  if(_shouldBufferBeInternal){
341  resizeInternalBuffer(EXECUTE_FUNCTION(sizeofdata)());
342  checkBufferInternalness();
343  }
344 
345  /// Now, read the rest of the configuration block
346  buffer_new = readDataGeneral(buffer_new, EXECUTE_FUNCTION(sizeofdata)() - header_size, header_size);
347 
348  checkBufferInternalness();
349 
350  return buffer_new;
351  }// end of readData(void*)
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
::xsd::cxx::tree::buffer< char > buffer
Definition: Database.h:179
bool daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::setBufferSource ( const void pointer)

If Header is already defined, then set its buffer source Otherwise, need to construct it

It's possible that Floating Microblock was already constructed. If so, need to reassign its pointer

See how many Microblocks in the new buffer. If it's greater, then make the floating MicroBlock non-valid.

New Floating MicroBlock pointer

< version of the DataBlockSliceHeader equals the version of the DataBlockSlice

Definition at line 285 of file RawConfigurationBlockV0.cpp.

References _floatingSystemID, _floatingSystemIDNumber, _header, samweb_client.client::_version, PRINT_ON_DEBUG, RETURN_FUNCTION, sizeofdata(), and sizeofdata_t.

285  {
286 
287  const uint32_t* old_buffer = (uint32_t*)_Buffer;
288  _Buffer = (void*)pointer;
289  _shouldBufferBeInternal = isInternalBuffer();
290 
291  /// If Header is already defined, then set its buffer source
292  /// Otherwise, need to construct it
293  if(_header){
294  _header->setBufferSource(_Buffer);
295 
296  /// It's possible that Floating Microblock was already constructed.
297  /// If so, need to reassign its pointer
298  if(_floatingSystemIDNumber > -1){
299 
300  /// See how many Microblocks in the new buffer.
301  /// If it's greater, then make the floating MicroBlock non-valid.
302  if(_floatingSystemIDNumber > (int)_header->getSystemNumber()){
304  return true;
305  }// end of checking number of microblocks
306 
307  /// New Floating MicroBlock pointer
308  const uint32_t* floating_sysid_pointer =((uint32_t*)_Buffer) + ((uint32_t*)_floatingSystemID->getBuffer() - old_buffer);
309  RETURN_FUNCTION(setFloatingSystemIDToBufferSource)(floating_sysid_pointer);
310  }// end of setting new floating MicroBlock pointer
311 
312  return true;
313 
314  }
315 
316  _header = new daqdataformats::RawConfigurationHeader(_Buffer, _version); ///< version of the DataBlockSliceHeader equals the version of the DataBlockSlice
317 
318  PRINT_ON_DEBUG("Constructed _header with version"<<_version);
319 
320  _function_sizeofdata = (sizeofdata_t) &RawConfigurationBlock::sizeofdata;
321  return true;
322 }
#define sizeofdata_t
Definition: FunctionBind.h:30
#define RETURN_FUNCTION(FULLFUNCTIONNAME)
Definition: Macros.h:57
#define PRINT_ON_DEBUG(x)
Definition: RawDAQData.h:35
daqdataformats::RawConfigurationSystemID * _floatingSystemID
bool daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::setVersions ( )
inlineprotected
uint32_t daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::sizeofdata ( ) const
inline

Definition at line 48 of file RawConfigurationBlockV0.h.

References close(), INIT_FIRST, and INIT_FIRST_GET_AND_SET.

Referenced by init(), print(), readData(), and setBufferSource().

48 { return _header->getConfigurationBlockSize(); }

Member Data Documentation

daqdataformats::RawConfigurationSystemID* daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::_floatingSystemID
mutableprotected

Definition at line 96 of file RawConfigurationBlockV0.h.

Referenced by init(), setBufferSource(), and ~RawConfigurationBlock().

int daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::_floatingSystemIDNumber
mutableprotected

Definition at line 97 of file RawConfigurationBlockV0.h.

Referenced by init(), and setBufferSource().

daqdataformats::RawConfigurationHeader* daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::_header
protected
daqdataformats::RawConfigurationTail* daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::_tail
mutableprotected

Definition at line 94 of file RawConfigurationBlockV0.h.

Referenced by init(), and ~RawConfigurationBlock().

version_t daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::_version_ConfigurationSystemID
protected

Definition at line 99 of file RawConfigurationBlockV0.h.

Referenced by init().

version_t daqdataformats::VERSION_NAMESPACE::RawConfigurationBlock::_version_ConfigurationTail
protected

Definition at line 100 of file RawConfigurationBlockV0.h.


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