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

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

Inheritance diagram for daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID:

Public Member Functions

 RawConfigurationSystemID (const version_t version)
 
 RawConfigurationSystemID (const RawConfigurationSystemID &copyin)
 The default constructor. More...
 
 ~RawConfigurationSystemID ()
 Destructor. More...
 
void init ()
 
void print (std::ostream &os=std::cout) const
 
uint32_t sizeofdata () const
 
bool setBufferSource (const void *)
 
voidreadData (const void *)
 

Protected Member Functions

 IMPLEMENT_FIRST_GET_AND_SET (Version, uint32_t)
 
 IMPLEMENT_FIRST_GET_AND_SET (DAQSystemID, uint32_t)
 
 IMPLEMENT_FIRST_GET_AND_SET (DAQSubSystemID, uint32_t)
 
 INIT_FIRST (getVersionName, const, uint32_t, std::string &)
 Set name. More...
 
 INIT_FIRST (setVersionName,, uint32_t, const std::string &)
 
 INIT_FIRST (getHeaderSize, const, uint32_t,)
 
bool setConfigurationNameVersion ()
 
uint32_t getPredefinedSize () const
 

Protected Attributes

RawConfigurationName_versionName
 SubSystem's version name. More...
 
version_t _configurationName_version
 

Detailed Description

Definition at line 51 of file RawConfigurationSystemIDV0.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file RawConfigurationSystemIDV0.cpp.

25  :
27  ,ZEROOUT_GET_AND_SET(Version)
28  ,ZEROOUT_GET_AND_SET(DAQSystemID)
29  ,ZEROOUT_GET_AND_SET(DAQSubSystemID)
30  ,ZEROOUT_GET_AND_SET(VersionName)
31  ,ZEROOUT_FUNCTION(getHeaderSize)
32  ,_versionName(NULL)
34 {}
#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
RawConfigurationName * _versionName
SubSystem's version name.
const XML_Char * version
Definition: expat.h:187
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::RawConfigurationSystemID ( const RawConfigurationSystemID copyin)

The default constructor.

Definition at line 36 of file RawConfigurationSystemIDV0.cpp.

36  :
37  RawDAQData(copyin)
38  ,DEEPCOPY_GET_AND_SET(Version)
39  ,DEEPCOPY_GET_AND_SET(DAQSystemID)
40  ,DEEPCOPY_GET_AND_SET(DAQSubSystemID)
41  ,DEEPCOPY_GET_AND_SET(VersionName)
42  ,DEEPCOPY_FUNCTION(getHeaderSize)
43  ,_versionName(NULL)
44  ,_configurationName_version(copyin._configurationName_version)
45 
46 { }
#define DEEPCOPY_FUNCTION(FUNC)
Definition: FunctionBind.h:40
#define DEEPCOPY_GET_AND_SET(FUNC)
Definition: FunctionBind.h:44
RawConfigurationName * _versionName
SubSystem's version name.
daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::~RawConfigurationSystemID ( )

Destructor.

Definition at line 50 of file RawConfigurationSystemIDV0.cpp.

50 { }

Member Function Documentation

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

Definition at line 89 of file RawConfigurationSystemIDV0.h.

89 {return 2;}
daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::IMPLEMENT_FIRST_GET_AND_SET ( Version  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::IMPLEMENT_FIRST_GET_AND_SET ( DAQSystemID  ,
uint32_t   
)
protected
daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::IMPLEMENT_FIRST_GET_AND_SET ( DAQSubSystemID  ,
uint32_t   
)
protected
void daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::init ( )

Definition at line 54 of file RawConfigurationSystemIDV0.cpp.

References samweb_client.client::_version, and EXECUTE_FUNCTION.

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

54  {
55  EXECUTE_FUNCTION(setVersion)(_version);
56 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::INIT_FIRST ( getVersionName  ,
const  ,
uint32_t  ,
std::string  
)
protected

Set name.

daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::INIT_FIRST ( setVersionName  ,
uint32_t  ,
const std::string  
)
protected
daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::INIT_FIRST ( getHeaderSize  ,
const  ,
uint32_t   
)
protected
void daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::print ( std::ostream &  os = std::cout) const

Definition at line 60 of file RawConfigurationSystemIDV0.cpp.

References _versionName, EXECUTE_FUNCTION, novadaq::HexUtils::format(), daqdataformats::VERSION_NAMESPACE::CURRENT_FIELDS_SUB_NAMESPACE::HEADER_SIZE, sizeofdata(), submit_syst::str, and string.

60  {
61 
62  //printBuffer(os,true,true,true,true,true);
63  //if(_versionName)_versionName->print(os);
64 
65 
66  os<<boost::format("\n---RawConfigurationSystemID---------------------------------------------Version =%u, Size is %u words\n")
67  % getVersion()% sizeofdata();
68 
69  printBuffer(os);
70 
71 
72  os<<boost::format("DAQSystemID=%u " ) % EXECUTE_FUNCTION(getDAQSystemID)();
73  os<<boost::format("DAQSubSystemID=%u " ) % EXECUTE_FUNCTION(getDAQSubSystemID)();
74 
75  if(_versionName){
76  std::string version_name;
77  EXECUTE_FUNCTION(getVersionName)(version_name);
78  os<<boost::format("DAQSystemVersion=\"%s\"") % version_name.c_str();
79  }
80 
81  os<<"\n";
82 
83 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
RawConfigurationName * _versionName
SubSystem&#39;s version name.
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
enum BeamMode string
void * daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::readData ( const void buffer)

Read SystemID header and Configuration Name header

Now we know sizeofdata

Check pointers after each read or resize buffer

Definition at line 158 of file RawConfigurationSystemIDV0.cpp.

References _versionName, EXECUTE_FUNCTION, and sizeofdata().

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

159 {
160  /// Read SystemID header and Configuration Name header
161  const uint32_t header_stuff = EXECUTE_FUNCTION(getHeaderSize)() + _versionName->getHeaderSize();
162 
163  void* buffer_new = readDataGeneral(buffer, header_stuff, 0);
164 
165  /// Now we know sizeofdata
166  buffer_new = readDataGeneral(buffer_new, EXECUTE_FUNCTION(sizeofdata)() - header_stuff, header_stuff);
167  /// Check pointers after each read or resize buffer
168  checkBufferInternalness();
169 
170  return buffer_new;
171 }// 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
RawConfigurationName * _versionName
SubSystem&#39;s version name.
bool daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::setBufferSource ( const void pointer)

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

Figure out the minimum RawConfigurationName size

Check pointers after each read or resize buffer

Need to initialize to set the size. For internal buffers only and only if it's non-zero

Definition at line 114 of file RawConfigurationSystemIDV0.cpp.

References _configurationName_version, _versionName, EXECUTE_FUNCTION, daqdataformats::VERSION_NAMESPACE::RawConfigurationName::init(), daqdataformats::VERSION_NAMESPACE::RawConfigurationName::setBufferSource(), sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawConfigurationName::sizeofdata(), and sizeofdata_t.

114  {
115 
116  _Buffer = (void*)pointer;
117  _shouldBufferBeInternal = isInternalBuffer();
118 
119  const uint32_t* version_name_pointer = (uint32_t*)(_Buffer) + EXECUTE_FUNCTION(getHeaderSize)();
120 
121  /// If _versionName is already defined, then set its buffer source
122  /// Otherwise, need to construct it
123  if(_versionName){
124  return _versionName->setBufferSource(version_name_pointer);
125  }
126 
127  if(_shouldBufferBeInternal){
128 
129  /// Figure out the minimum RawConfigurationName size
131 
132  resizeInternalBuffer(EXECUTE_FUNCTION(getHeaderSize)() + confname_tmp.sizeofdata());
133 
134  /// Check pointers after each read or resize buffer
135  checkBufferInternalness();
136 
138 
139  /// Need to initialize to set the size.
140  /// For internal buffers only and only if it's non-zero
141  if(_versionName->sizeofdata() < _versionName->getHeaderSize())
142  _versionName->init();
143  }
144  else{
146  }
147 
148 
149  _function_sizeofdata = (sizeofdata_t)&RawConfigurationSystemID::sizeofdata;
150 
151  return true;
152 }
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
#define sizeofdata_t
Definition: FunctionBind.h:30
RawConfigurationName * _versionName
SubSystem&#39;s version name.
bool daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::setConfigurationNameVersion ( )
inlineprotected
uint32_t daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::sizeofdata ( ) const

Definition at line 110 of file RawConfigurationSystemIDV0.cpp.

References _versionName, EXECUTE_FUNCTION, and daqdataformats::VERSION_NAMESPACE::RawConfigurationName::sizeofdata().

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

110 { return EXECUTE_FUNCTION(getHeaderSize)() + _versionName->sizeofdata();}
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
RawConfigurationName * _versionName
SubSystem&#39;s version name.

Member Data Documentation

version_t daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::_configurationName_version
protected

Definition at line 93 of file RawConfigurationSystemIDV0.h.

Referenced by setBufferSource().

RawConfigurationName* daqdataformats::VERSION_NAMESPACE::RawConfigurationSystemID::_versionName
protected

SubSystem's version name.

Definition at line 92 of file RawConfigurationSystemIDV0.h.

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


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