Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-09-17/DAQDataFormats/cxx/unittest/ConfigurationSystemIDConstructor.h"

Inheritance diagram for daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor:
daqdataformats::RawDAQDataConstructor

Public Member Functions

 ConfigurationSystemIDConstructor ()
 
 ~ConfigurationSystemIDConstructor ()
 
 DEFINE_TESTVALUE (DAQSystemID)
 
 DEFINE_TESTVALUE (DAQSubSystemID)
 
bool setFieldToTestValue_VersionName (daqdataformats::CURRENT_CLASS *dataformat) const
 
bool setFieldToZeroValue_VersionName (daqdataformats::CURRENT_CLASS *dataformat) const
 
std::string getFieldValue_VersionName (const daqdataformats::CURRENT_CLASS *dataformat) const
 
bool checkField_VersionName (daqdataformats::CURRENT_CLASS *dataformat) const
 
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 getVersion (const daqdataformats::RawDAQData *inver) const
 Get version of the input dataformat. More...
 
version_t getMaximumVersion () const
 Get maximum version for the dataformat. More...
 

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...
 

Detailed Description

Definition at line 38 of file ConfigurationSystemIDConstructor.h.

Constructor & Destructor Documentation

daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::ConfigurationSystemIDConstructor ( )
daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::~ConfigurationSystemIDConstructor ( )

Definition at line 33 of file ConfigurationSystemIDConstructor.cpp.

33 { }

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); }
bool daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::checkField_VersionName ( daqdataformats::CURRENT_CLASS dataformat) const

Definition at line 59 of file ConfigurationSystemIDConstructor.cpp.

References daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, allTimeWatchdog::endl, getFieldValue_VersionName(), getVersion(), LOG_DEBUG, LOG_ERROR, setFieldToTestValue_VersionName(), setFieldToZeroValue_VersionName(), gen_flatrecord::size, and daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::TEST_VALUE_VersionName.

Referenced by getFieldValue_VersionName().

59  {
60 
61  if(!setFieldToTestValue_VersionName(dataformat)) {
62  LOG_ERROR("UNITTEST") << std::endl<< __PRETTY_FUNCTION__
63  <<"\nsetFieldToTestValue_"<<"Name"<<" failed.\n"
64  <<"Test value = "<<TEST_VALUE_VersionName<<"\n";
66  LOG_ERROR("UNITTEST")<<"version = "<<getVersion(dataformat)<<"\n";
67  return false;
68  }
69 
70  if(TEST_VALUE_VersionName.compare(getFieldValue_VersionName(dataformat)) != 0 ){
71  LOG_ERROR("UNITTEST") << std::endl<< __PRETTY_FUNCTION__
72  <<"\ngetFieldToTestValue_"<<"Name"<<" failed.\n"
73  <<"Test value = "<<TEST_VALUE_VersionName<<"!"
74  <<" but get is "
75  << getFieldValue_VersionName(dataformat)<<"!\n";
77  LOG_ERROR("UNITTEST")<<"version = "<<getVersion(dataformat)<<"\n";
78  return false;
79  }
80 
81  std::string suceed_string = "Checking BitField in ";
82  suceed_string.append(__PRETTY_FUNCTION__);
83  suceed_string.append(" field ");
84  suceed_string.append("Name");
85  suceed_string.append(" suceeded for version = ");
86  suceed_string.append(boost::lexical_cast<std::string>(getVersion(dataformat)));
87  suceed_string.append(" (set to ");
88  suceed_string.append(boost::lexical_cast<std::string>(TEST_VALUE_VersionName));
89  suceed_string.append(" received ");
90  suceed_string.append(boost::lexical_cast<std::string>(getFieldValue_VersionName(dataformat)));
91  suceed_string.append(").");
92 
93  if(!setFieldToZeroValue_VersionName(dataformat)){
94  LOG_ERROR("UNITTEST")<<"\nsetFieldToZeroValue_"<<"Name"<<" failed.\n"
95  <<"version = "<<getVersion(dataformat)<<"\n";
96  return false;
97  }
98  if(getFieldValue_VersionName(dataformat).size() != 0) {
99  LOG_ERROR("UNITTEST")<<"\ngetFieldValue_"<<"Name"<<" failed.\n"
100  <<"Should be zero"
101  <<" but get is "<<getFieldValue_VersionName(dataformat)<<"\n"
102  <<"version = "<<getVersion(dataformat)<<"\n";
103  return false;
104  }
105  LOG_DEBUG("UNITTEST")<< suceed_string;
106  return true;
107 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
std::string getFieldValue_VersionName(const daqdataformats::CURRENT_CLASS *dataformat) const
#define LOG_ERROR(stream)
Definition: Messenger.h:129
version_t getVersion(const daqdataformats::RawDAQData *inver) const
Get version of the input dataformat.
daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::DEFINE_TESTVALUE ( DAQSystemID  )
daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::DEFINE_TESTVALUE ( DAQSubSystemID  )
bool daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::fillDataFormat ( daqdataformats::RawDAQData ) const
virtual

method to Fill the input dataformat

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 48 of file ConfigurationSystemIDConstructor.cpp.

References setFieldToTestValue_VersionName().

Referenced by getFieldValue_VersionName(), and getFilledDataFormat().

48  {
50  setFieldToTestValue_DAQSystemID(cname);
51  setFieldToTestValue_DAQSubSystemID(cname);
53 
54  return true;
55 }
daqdataformats::RawDAQData * daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::getEmptyDataFormat ( const daqdataformats::version_t  ) const
virtual

method to create an empty dataformat with a given version

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 43 of file ConfigurationSystemIDConstructor.cpp.

Referenced by getFieldValue_VersionName(), and getFilledDataFormat().

std::string daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::getFieldValue_VersionName ( const daqdataformats::CURRENT_CLASS dataformat) const
inline

Definition at line 47 of file ConfigurationSystemIDConstructor.h.

References checkField_VersionName(), CURRENT_CLASS, fillDataFormat(), getEmptyDataFormat(), and getFilledDataFormat().

Referenced by checkField_VersionName().

47 {std::string name; dataformat->getVersionName(name); return name;}
const XML_Char * name
Definition: expat.h:151
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
daqdataformats::RawDAQData * daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::getFilledDataFormat ( const daqdataformats::version_t  ) const
virtual

method to create a filled dataformat with a given version

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 36 of file ConfigurationSystemIDConstructor.cpp.

References fillDataFormat(), getEmptyDataFormat(), and confusionMatrixTree::out.

Referenced by getFieldValue_VersionName().

36  {
37  RawConfigurationSystemID* out = (RawConfigurationSystemID*)getEmptyDataFormat(ver);
38  fillDataFormat(out);
39  return out;
40 }
bool fillDataFormat(daqdataformats::RawDAQData *) const
method to Fill the input dataformat
daqdataformats::RawDAQData * getEmptyDataFormat(const daqdataformats::version_t) const
method to create an empty dataformat with a given version
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::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::getVersion ( const daqdataformats::RawDAQData ) const
inlinevirtual

Get version of the input dataformat.

Reimplemented from daqdataformats::RawDAQDataConstructor.

Definition at line 55 of file ConfigurationSystemIDConstructor.h.

Referenced by checkField_VersionName().

55  {
56  const RawConfigurationSystemID* nano_ver = (const RawConfigurationSystemID*)inver;
57  return nano_ver->getVersion();
58  }
bool daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::setFieldToTestValue_VersionName ( daqdataformats::CURRENT_CLASS dataformat) const
inline

Definition at line 45 of file ConfigurationSystemIDConstructor.h.

Referenced by checkField_VersionName(), and fillDataFormat().

45 {return dataformat->setVersionName(TEST_VALUE_VersionName);}
bool daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationSystemIDConstructor::setFieldToZeroValue_VersionName ( daqdataformats::CURRENT_CLASS dataformat) const
inline

Definition at line 46 of file ConfigurationSystemIDConstructor.h.

Referenced by checkField_VersionName().

46 {const std::string null_str; return dataformat->setVersionName(null_str);}
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
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

version_t daqdataformats::RawDAQDataConstructor::_maximumVersion
protectedinherited

Maximum version of the dataformat.

Definition at line 162 of file RawDAQDataConstructor.h.

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


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