1 #include "DAQDataFormats/RawConfigurationBlockV0.h" 2 #include "DAQDataFormats/RawConfigurationBlock.h" 3 #include "DAQDataFormats/RawConfigurationTail.h" 4 #include "DAQDataFormats/RawConfigurationSystemID.h" 5 #include <boost/format.hpp> 15 #include "DAQDataFormats/DataFormatFirst.inc" 16 #define CURRENT_CLASS RawConfigurationBlock 17 #define CURRENT_CLASS_VERSION 0 18 #define CURRENT_FIELDS_SUB_NAMESPACE configurationblock 19 #include "DAQDataFormats/DataFormatLast.inc" 56 ,_floatingSystemID (NULL)
57 ,_floatingSystemIDNumber (-1)
113 if(isInternalBuffer()){
114 _InternalBuffer.resize(
_header->sizeofdata() + 1);
115 checkBufferInternalness();
156 uint32_t RawConfigurationBlock::getMarkerHi1()
const {
return _header->getMarkerHi1();}
157 uint32_t RawConfigurationBlock::getMarkerHi2()
const {
return _header->getMarkerHi2();}
158 uint32_t RawConfigurationBlock::getMarkerLo1()
const {
RETURN_FUNCTION(getTailConst)()->getMarkerLo1();}
159 uint32_t RawConfigurationBlock::getMarkerLo2()
const {
RETURN_FUNCTION(getTailConst)()->getMarkerLo2();}
160 uint32_t RawConfigurationBlock::getConfigurationVersion()
const {
return _header->getConfigurationHeaderVersion();}
161 uint32_t RawConfigurationBlock::getDetectorID()
const {
return _header->getDetectorID();}
162 uint32_t RawConfigurationBlock::getConfigurationBlockSize()
const {
return _header->getConfigurationBlockSize();}
163 uint32_t RawConfigurationBlock::getResourceManagerID()
const {
return _header->getResourceManagerID();}
164 uint32_t RawConfigurationBlock::getRunNumber()
const {
return _header->getRunNumber();}
165 uint32_t RawConfigurationBlock::getRunType()
const {
return _header->getRunType();}
166 uint32_t RawConfigurationBlock::getPartition()
const {
return _header->getPartition();}
167 uint32_t RawConfigurationBlock::getSubrun()
const {
return _header->getSubrun();}
168 uint32_t RawConfigurationBlock::getSystemNumber()
const {
return _header->getSystemNumber();}
169 uint32_t RawConfigurationBlock::getSystemVersionIDX()
const {
return _header->getSystemVersionIDX();}
172 bool RawConfigurationBlock::setDetectorID (
const uint32_t
a){
return _header->setDetectorID(a);}
173 bool RawConfigurationBlock::setResourceManagerID(
const uint32_t a){
return _header->setResourceManagerID(a);}
174 bool RawConfigurationBlock::setRunNumber (
const uint32_t a){
return _header->setRunNumber(a);}
175 bool RawConfigurationBlock::setRunType (
const uint32_t a){
return _header->setRunType(a);}
176 bool RawConfigurationBlock::setPartition (
const uint32_t a){
return _header->setPartition(a);}
177 bool RawConfigurationBlock::setSubrun (
const uint32_t a){
return _header->setSubrun(a);}
178 bool RawConfigurationBlock::setSystemVersionIDX (
const uint32_t a){
return _header->setSystemVersionIDX(a);}
181 bool RawConfigurationBlock::addSystemID(
const void* system_pointer){
185 const uint32_t sysid_size = input_system.sizeofdata();
188 if(_shouldBufferBeInternal){
189 resizeInternalBuffer(
_header->getConfigurationBlockSize() + sysid_size);
190 checkBufferInternalness();
201 _header->setSystemNumber(system_number + 1);
202 return _header->setConfigurationBlockSize(
_header->getConfigurationBlockSize() + sysid_size);
206 bool RawConfigurationBlock::setFloatingSystemIDToBufferSource(
const void* buffer_pointer)
const {
218 bool RawConfigurationBlock::setFloatingSystemID(
const uint32_t isysid)
const {
252 if (pointer >= end_of_buffer_pointer)
265 if(_shouldBufferBeInternal){
266 resizeInternalBuffer(
_header->getConfigurationBlockSize() +
_tail->sizeofdata());
267 checkBufferInternalness();
271 _header->setConfigurationBlockSize(
_header->getConfigurationBlockSize() +
_tail->sizeofdata());
278 _tail->setCRC(calculateCheckSum(1));
287 const uint32_t* old_buffer = (uint32_t*)_Buffer;
288 _Buffer = (
void*)pointer;
289 _shouldBufferBeInternal = isInternalBuffer();
294 _header->setBufferSource(_Buffer);
308 const uint32_t* floating_sysid_pointer =((uint32_t*)_Buffer) + ((uint32_t*)
_floatingSystemID->getBuffer() - old_buffer);
309 RETURN_FUNCTION(setFloatingSystemIDToBufferSource)(floating_sysid_pointer);
328 const uint32_t header_size =
_header->sizeofdata();
331 if(_shouldBufferBeInternal){
332 resizeInternalBuffer(header_size);
333 checkBufferInternalness();
337 void* buffer_new =
_header->readData(buffer);
340 if(_shouldBufferBeInternal){
342 checkBufferInternalness();
348 checkBufferInternalness();
362 os<<
"\nNumber of systems = "<<nsystems<<
"\n";
368 for(uint32_t isystem = 0; isystem < nsystems; ++isystem){
380 os<<
"Configuration Block is not closed\n";
#define ZEROOUT_FUNCTION(FUNC)
#define DEEPCOPY_FUNCTION(FUNC)
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
#define DEEPCOPY_GET_AND_SET(FUNC)
#define VERSION_NAMESPACE
::xsd::cxx::tree::buffer< char > buffer
#define ZEROOUT_GET_AND_SET(FUNC)
#define RETURN_FUNCTION(FULLFUNCTIONNAME)
def tail(path, window=20)
#define PRINT_ON_DEBUG(x)