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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/DAQDataFormats/cxx/unittest/ConfigurationNameConstructor.h"

Inheritance diagram for daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor:
daqdataformats::RawDAQDataConstructor

Public Member Functions

 ConfigurationNameConstructor ()
 
 ~ConfigurationNameConstructor ()
 
bool setFieldToTestValue_Name (daqdataformats::CURRENT_CLASS *dataformat) const
 
bool setFieldToZeroValue_Name (daqdataformats::CURRENT_CLASS *dataformat) const
 
std::string getFieldValue_Name (const daqdataformats::CURRENT_CLASS *dataformat) const
 
bool checkField_Name (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 34 of file ConfigurationNameConstructor.h.

Constructor & Destructor Documentation

daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor::ConfigurationNameConstructor ( )
daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor::~ConfigurationNameConstructor ( )

Definition at line 33 of file ConfigurationNameConstructor.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::ConfigurationNameConstructor::checkField_Name ( daqdataformats::CURRENT_CLASS dataformat) const

Definition at line 56 of file ConfigurationNameConstructor.cpp.

References daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, allTimeWatchdog::endl, getFieldValue_Name(), getVersion(), LOG_DEBUG, LOG_ERROR, setFieldToTestValue_Name(), setFieldToZeroValue_Name(), gen_flatrecord::size, string, and daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::TEST_VALUE_Name.

Referenced by getFieldValue_Name().

56  {
57 
58  if(!setFieldToTestValue_Name(dataformat)) {
59  LOG_ERROR("UNITTEST") << std::endl<< __PRETTY_FUNCTION__
60  <<"\nsetFieldToTestValue_"<<"Name"<<" failed.\n"
61  <<"Test value = "<<TEST_VALUE_Name<<"\n";
63  LOG_ERROR("UNITTEST")<<"version = "<<getVersion(dataformat)<<"\n";
64  return false;
65  }
66 
67  if(TEST_VALUE_Name.compare(getFieldValue_Name(dataformat)) != 0 ){
68  LOG_ERROR("UNITTEST") << std::endl<< __PRETTY_FUNCTION__
69  <<"\ngetFieldToTestValue_"<<"Name"<<" failed.\n"
70  <<"Test value = "<<TEST_VALUE_Name<<"!"
71  <<" but get is "
72  << getFieldValue_Name(dataformat)<<"!\n";
74  LOG_ERROR("UNITTEST")<<"version = "<<getVersion(dataformat)<<"\n";
75  return false;
76  }
77 
78  std::string suceed_string = "Checking BitField in ";
79  suceed_string.append(__PRETTY_FUNCTION__);
80  suceed_string.append(" field ");
81  suceed_string.append("Name");
82  suceed_string.append(" suceeded for version = ");
83  suceed_string.append(boost::lexical_cast<std::string>(getVersion(dataformat)));
84  suceed_string.append(" (set to ");
85  suceed_string.append(boost::lexical_cast<std::string>(TEST_VALUE_Name));
86  suceed_string.append(" received ");
87  suceed_string.append(boost::lexical_cast<std::string>(getFieldValue_Name(dataformat)));
88  suceed_string.append(").");
89 
90  if(!setFieldToZeroValue_Name(dataformat)){
91  LOG_ERROR("UNITTEST")<<"\nsetFieldToZeroValue_"<<"Name"<<" failed.\n"
92  <<"version = "<<getVersion(dataformat)<<"\n";
93  return false;
94  }
95  if(getFieldValue_Name(dataformat).size() != 0) {
96  LOG_ERROR("UNITTEST")<<"\ngetFieldValue_"<<"Name"<<" failed.\n"
97  <<"Should be zero"
98  <<" but get is "<<getFieldValue_Name(dataformat)<<"\n"
99  <<"version = "<<getVersion(dataformat)<<"\n";
100  return false;
101  }
102  LOG_DEBUG("UNITTEST")<< suceed_string;
103  return true;
104 }
bool setFieldToZeroValue_Name(daqdataformats::CURRENT_CLASS *dataformat) const
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
bool setFieldToTestValue_Name(daqdataformats::CURRENT_CLASS *dataformat) const
version_t getVersion(const daqdataformats::RawDAQData *inver) const
Get version of the input dataformat.
std::string getFieldValue_Name(const daqdataformats::CURRENT_CLASS *dataformat) const
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
#define LOG_ERROR(stream)
Definition: Messenger.h:129
enum BeamMode string
bool daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor::fillDataFormat ( daqdataformats::RawDAQData ) const
virtual

method to Fill the input dataformat

Implements daqdataformats::RawDAQDataConstructor.

Definition at line 48 of file ConfigurationNameConstructor.cpp.

References setFieldToTestValue_Name().

Referenced by getFieldValue_Name(), and getFilledDataFormat().

daqdataformats::RawDAQData * daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor::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 ConfigurationNameConstructor.cpp.

Referenced by getFieldValue_Name(), and getFilledDataFormat().

std::string daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor::getFieldValue_Name ( const daqdataformats::CURRENT_CLASS dataformat) const
inline

Definition at line 41 of file ConfigurationNameConstructor.h.

References checkField_Name(), CURRENT_CLASS, fillDataFormat(), getEmptyDataFormat(), getFilledDataFormat(), and string.

Referenced by checkField_Name().

41 {std::string name; dataformat->getName(name); return name;}
const XML_Char * name
Definition: expat.h:151
enum BeamMode string
daqdataformats::RawDAQData * daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor::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 ConfigurationNameConstructor.cpp.

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

Referenced by getFieldValue_Name().

36  {
37  RawConfigurationName* out = (RawConfigurationName*)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::ConfigurationNameConstructor::getVersion ( const daqdataformats::RawDAQData ) const
inlinevirtual

Get version of the input dataformat.

Reimplemented from daqdataformats::RawDAQDataConstructor.

Definition at line 49 of file ConfigurationNameConstructor.h.

Referenced by checkField_Name().

49  {
50  const RawConfigurationName* nano_ver = (const RawConfigurationName*)inver;
51  return nano_ver->getVersion();
52  }
bool daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor::setFieldToTestValue_Name ( daqdataformats::CURRENT_CLASS dataformat) const
inline

Definition at line 39 of file ConfigurationNameConstructor.h.

Referenced by checkField_Name(), and fillDataFormat().

39 {return dataformat->setName(TEST_VALUE_Name);}
bool daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::ConfigurationNameConstructor::setFieldToZeroValue_Name ( daqdataformats::CURRENT_CLASS dataformat) const
inline

Definition at line 40 of file ConfigurationNameConstructor.h.

References string.

Referenced by checkField_Name().

40 {const std::string null_str; return dataformat->setName(null_str);}
enum BeamMode string
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: