Public Member Functions | Private Member Functions | Private Attributes | List of all members
dbutils::daqconfig::GlobalNameSpec Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/DatabaseUtils/cxx/include/DAQConfig/GlobalNameSpec.h"

Public Member Functions

 GlobalNameSpec (const std::string &configName, const std::string &dcmOperatingMode, const std::string &detectorId)
 
 GlobalNameSpec (const std::string &configName, const std::string &dcmOperatingMode, const std::string &detectorId, const std::string &timestamp)
 
std::string getConfigName () const
 
std::string getDCMOpMode () const
 
std::string getDetectorId () const
 
std::string getDetectorName () const
 
bool hasTimestamp () const
 
std::string getTimestamp () const
 
bool skipInvalidStateTest () const
 
bool isSlowControlsConfiguration () const
 
bool isDAQConfiguration () const
 
int getUsageCount () const
 
std::string toString (int overallIndent=0) const
 
void skipInvalidStateTest (bool setting)
 
void isSlowControlsConfiguration (bool setting)
 
void isDAQConfiguration (bool setting)
 
void setUsageCount (int value)
 
void setSortIndex (int value)
 
bool operator< (const GlobalNameSpec &other) const
 

Private Member Functions

void _addSpaces (std::string &workString, int count) const
 

Private Attributes

std::string _configName
 
std::string _dcmOperatingMode
 
std::string _detectorId
 
bool _hasTimestamp
 
std::string _timestamp
 
bool _skipInvalidStateTest
 
bool _isSlowControlsConfig
 
int _usageCount
 
int _sortIndex
 

Detailed Description

Simple container class to hold the identifiers that specify a particular named global configuration.

Author
Kurt Biery
Version
Revision
1.7.24.1
Date
2019/09/27 00:07:03

Definition at line 17 of file GlobalNameSpec.h.

Constructor & Destructor Documentation

dbutils::daqconfig::GlobalNameSpec::GlobalNameSpec ( const std::string configName,
const std::string dcmOperatingMode,
const std::string detectorId 
)

Creates a global name specification object from the specified configuration name DCM operating mode, and detector ID.

Parameters
configNameThe named global configuration of interest.
dcmOperatingModeThe operating mode of interest (e.g. DCS or DSO).
detectorIdThe detector of interest (e.g. NDOS or FarDet).

Definition at line 16 of file GlobalNameSpec.cpp.

dbutils::daqconfig::GlobalNameSpec::GlobalNameSpec ( const std::string configName,
const std::string dcmOperatingMode,
const std::string detectorId,
const std::string timestamp 
)

Creates a global name specification object from the specified configuration name, DCM operating mode, detector ID, and timestamp.

Parameters
configNameThe named global configuration of interest.
dcmOperatingModeThe operating mode of interest (e.g. DCS or DSO).
detectorIdThe detector of interest (e.g. NDOS or FarDet).
timestampThe date/time string that should be used to determine the time-based validity context for the named configuration. Supported formats include "yyyy-mm-dd HH:MM:SS".

Definition at line 38 of file GlobalNameSpec.cpp.

Member Function Documentation

void dbutils::daqconfig::GlobalNameSpec::_addSpaces ( std::string workString,
int  count 
) const
private

Adds a specified number of spaces to a string.

Definition at line 126 of file GlobalNameSpec.cpp.

References confusionMatrixTree::count, and compare_h5_caf::idx.

Referenced by setSortIndex(), and toString().

127 {
128  for (int idx = 0; idx < count; ++idx) {
129  workString.append(" ");
130  }
131 }
std::string dbutils::daqconfig::GlobalNameSpec::getConfigName ( ) const
inline
std::string dbutils::daqconfig::GlobalNameSpec::getDCMOpMode ( ) const
inline
std::string dbutils::daqconfig::GlobalNameSpec::getDetectorId ( ) const
inline
std::string dbutils::daqconfig::GlobalNameSpec::getDetectorName ( ) const
inline

Definition at line 41 of file GlobalNameSpec.h.

References _detectorId.

Referenced by dbutils::gui::SettingsDisplay::updateNamedConfiguration().

std::string dbutils::daqconfig::GlobalNameSpec::getTimestamp ( ) const
inline
int dbutils::daqconfig::GlobalNameSpec::getUsageCount ( ) const
inline

Definition at line 50 of file GlobalNameSpec.h.

References _usageCount, string, and toString().

bool dbutils::daqconfig::GlobalNameSpec::hasTimestamp ( ) const
inline
bool dbutils::daqconfig::GlobalNameSpec::isDAQConfiguration ( ) const
inline

Definition at line 48 of file GlobalNameSpec.h.

References _isSlowControlsConfig.

void dbutils::daqconfig::GlobalNameSpec::isDAQConfiguration ( bool  setting)
inline

Definition at line 64 of file GlobalNameSpec.h.

References _isSlowControlsConfig.

64  {
65  _isSlowControlsConfig = (! setting);
66  }
bool dbutils::daqconfig::GlobalNameSpec::isSlowControlsConfiguration ( ) const
inline
void dbutils::daqconfig::GlobalNameSpec::isSlowControlsConfiguration ( bool  setting)
inline

Definition at line 61 of file GlobalNameSpec.h.

References _isSlowControlsConfig.

61  {
62  _isSlowControlsConfig = setting;
63  }
bool dbutils::daqconfig::GlobalNameSpec::operator< ( const GlobalNameSpec other) const

Tests if this instance is less than the specified one.

Definition at line 94 of file GlobalNameSpec.cpp.

References _configName, _dcmOperatingMode, _detectorId, _sortIndex, _timestamp, and _usageCount.

Referenced by setSortIndex(), and toString().

95 {
96  if (this->_sortIndex > -1 && other._sortIndex > -1) {
97  return (this->_sortIndex < other._sortIndex);
98  }
99 
100  if (this->_usageCount > other._usageCount) {return false;}
101  if (this->_usageCount < other._usageCount) {return true;}
102  // else _usageCount is equal
103 
104  if (this->_detectorId > other._detectorId) {return false;}
105  if (this->_detectorId < other._detectorId) {return true;}
106  // else _detectorId is equal
107 
108  if (this->_configName > other._configName) {return false;}
109  if (this->_configName < other._configName) {return true;}
110  // else _configName is equal
111 
112  if (this->_dcmOperatingMode > other._dcmOperatingMode) {return false;}
113  if (this->_dcmOperatingMode < other._dcmOperatingMode) {return true;}
114  // else _dcmOperatingMode is equal
115 
116  if (this->_timestamp > other._timestamp) {return false;}
117  if (this->_timestamp < other._timestamp) {return true;}
118  // else _timestamp is equal
119 
120  return false;
121 }
void dbutils::daqconfig::GlobalNameSpec::setSortIndex ( int  value)
inline
void dbutils::daqconfig::GlobalNameSpec::setUsageCount ( int  value)
inline

Definition at line 67 of file GlobalNameSpec.h.

References _usageCount.

Referenced by dbutils::daqconfig::NamedConfigUtils::getAvailableGlobalConfigs().

67 {_usageCount = value;}
const XML_Char int const XML_Char * value
Definition: expat.h:331
bool dbutils::daqconfig::GlobalNameSpec::skipInvalidStateTest ( ) const
inline
void dbutils::daqconfig::GlobalNameSpec::skipInvalidStateTest ( bool  setting)
inline

Definition at line 58 of file GlobalNameSpec.h.

References _skipInvalidStateTest.

58  {
59  _skipInvalidStateTest = setting;
60  }
std::string dbutils::daqconfig::GlobalNameSpec::toString ( int  overallIndent = 0) const

Creates a string representation of the name specification.

Definition at line 52 of file GlobalNameSpec.cpp.

References _addSpaces(), _configName, _dcmOperatingMode, _detectorId, _hasTimestamp, _isSlowControlsConfig, _skipInvalidStateTest, _timestamp, _usageCount, operator<(), and string.

Referenced by getUsageCount().

53 {
54  std::string workString;
55  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
56  workString.append("Named Global Configuration:\n");
57  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
58  workString.append(" configuration name: " + _configName + "\n");
59  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
60  workString.append(" DCM operating mode: " + _dcmOperatingMode + "\n");
61  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
62  workString.append(" detector name: " + _detectorId + "\n");
63 
64  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
65  if (_hasTimestamp) {
66  workString.append(" timestamp: " + _timestamp);
67  }
68  else {
69  workString.append(" no timestamp");
70  }
71  workString.append("\n");
72 
73  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
74  workString.append(" usage count: " +
75  boost::lexical_cast<std::string>(_usageCount) + "\n");
76 
77  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
78  workString.append(" DAQ or Slow Controls: ");
79  workString.append((_isSlowControlsConfig ? "Slow Controls" : "DAQ"));
80 
82  workString.append("\n");
83  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
84  workString.append(" Skipping the Invalid State tests");
85  }
86 
87  return workString;
88 }
void _addSpaces(std::string &workString, int count) const
enum BeamMode string

Member Data Documentation

std::string dbutils::daqconfig::GlobalNameSpec::_configName
private

Definition at line 80 of file GlobalNameSpec.h.

Referenced by getConfigName(), operator<(), and toString().

std::string dbutils::daqconfig::GlobalNameSpec::_dcmOperatingMode
private

Definition at line 81 of file GlobalNameSpec.h.

Referenced by getDCMOpMode(), operator<(), and toString().

std::string dbutils::daqconfig::GlobalNameSpec::_detectorId
private

Definition at line 82 of file GlobalNameSpec.h.

Referenced by getDetectorId(), getDetectorName(), operator<(), and toString().

bool dbutils::daqconfig::GlobalNameSpec::_hasTimestamp
private

Definition at line 84 of file GlobalNameSpec.h.

Referenced by hasTimestamp(), and toString().

bool dbutils::daqconfig::GlobalNameSpec::_isSlowControlsConfig
private

Definition at line 88 of file GlobalNameSpec.h.

Referenced by isDAQConfiguration(), isSlowControlsConfiguration(), and toString().

bool dbutils::daqconfig::GlobalNameSpec::_skipInvalidStateTest
private

Definition at line 87 of file GlobalNameSpec.h.

Referenced by skipInvalidStateTest(), and toString().

int dbutils::daqconfig::GlobalNameSpec::_sortIndex
private

Definition at line 91 of file GlobalNameSpec.h.

Referenced by operator<(), and setSortIndex().

std::string dbutils::daqconfig::GlobalNameSpec::_timestamp
private

Definition at line 85 of file GlobalNameSpec.h.

Referenced by getTimestamp(), operator<(), and toString().

int dbutils::daqconfig::GlobalNameSpec::_usageCount
private

Definition at line 90 of file GlobalNameSpec.h.

Referenced by getUsageCount(), operator<(), setUsageCount(), and toString().


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