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

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

Public Member Functions

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

Static Public Attributes

static const std::string DAQMONITOR_SUBSYSTEM_NAME
 
static const std::string DCM_SUBSYSTEM_NAME
 
static const std::string DL_SUBSYSTEM_NAME
 
static const std::string GT_SUBSYSTEM_NAME
 
static const std::string SM_SUBSYSTEM_NAME
 
static const std::string DDT_SUBSYSTEM_NAME
 
static const std::string TDUMANAGER_SUBSYSTEM_NAME
 
static const std::string BNEVB_SUBSYSTEM_NAME
 
static const std::string CONNECT_CONFIG_TYPE
 
static const std::string HARDWARE_CONFIG_TYPE
 
static const std::string RUN_CONFIG_TYPE
 

Private Member Functions

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

Private Attributes

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

Detailed Description

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

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

Definition at line 17 of file SubsystemNameSpec.h.

Constructor & Destructor Documentation

dbutils::daqconfig::SubsystemNameSpec::SubsystemNameSpec ( const std::string configName,
const std::string dcmOperatingMode,
const std::string detectorId,
const std::string subsystemName,
const std::string configType 
)

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

Parameters
configNameThe named subsystem configuration of interest.
dcmOperatingModeThe operating mode of interest (e.g. DCS or DSO).
detectorIdThe detector of interest (e.g. NDOS or FarDet).
subsystemNameThe name of the subsystem of interest (e.g. DCMApplication or GlobalTrigger).
configTypeThe type of the configuration data (e.g. run or hardware).

Definition at line 33 of file SubsystemNameSpec.cpp.

dbutils::daqconfig::SubsystemNameSpec::SubsystemNameSpec ( const std::string configName,
const std::string dcmOperatingMode,
const std::string detectorId,
const std::string subsystemName,
const std::string configType,
const std::string timestamp 
)

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

Parameters
configNameThe named subsystem configuration of interest.
dcmOperatingModeThe operating mode of interest (e.g. DCS or DSO).
detectorIdThe detector of interest (e.g. NDOS or FarDet).
subsystemNameThe name of the subsystem of interest (e.g. DCMApplication or GlobalTrigger).
configTypeThe type of the configuration data (e.g. run or hardware).
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 62 of file SubsystemNameSpec.cpp.

Member Function Documentation

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

Adds a specified number of spaces to a string.

Definition at line 158 of file SubsystemNameSpec.cpp.

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

Referenced by setSortIndex(), and toString().

159 {
160  for (int idx = 0; idx < count; ++idx) {
161  workString.append(" ");
162  }
163 }
std::string dbutils::daqconfig::SubsystemNameSpec::getConfigName ( ) const
inline
std::string dbutils::daqconfig::SubsystemNameSpec::getConfigType ( ) const
inline
std::string dbutils::daqconfig::SubsystemNameSpec::getDCMOpMode ( ) const
inline
std::string dbutils::daqconfig::SubsystemNameSpec::getDetectorId ( ) const
inline
std::string dbutils::daqconfig::SubsystemNameSpec::getDetectorName ( ) const
inline

Definition at line 57 of file SubsystemNameSpec.h.

References _detectorId.

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

Definition at line 68 of file SubsystemNameSpec.h.

References _usageCount, string, and toString().

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

Definition at line 66 of file SubsystemNameSpec.h.

References _isSlowControlsConfig.

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

Definition at line 79 of file SubsystemNameSpec.h.

References _isSlowControlsConfig.

79  {
80  _isSlowControlsConfig = (! setting);
81  }
bool dbutils::daqconfig::SubsystemNameSpec::isSlowControlsConfiguration ( ) const
inline
void dbutils::daqconfig::SubsystemNameSpec::isSlowControlsConfiguration ( bool  setting)
inline

Definition at line 76 of file SubsystemNameSpec.h.

References _isSlowControlsConfig.

76  {
77  _isSlowControlsConfig = setting;
78  }
bool dbutils::daqconfig::SubsystemNameSpec::operator< ( const SubsystemNameSpec other) const

Tests if this instance is less than the specified one.

Definition at line 118 of file SubsystemNameSpec.cpp.

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

Referenced by setSortIndex(), and toString().

119 {
120  if (this->_sortIndex > -1 && other._sortIndex > -1) {
121  return (this->_sortIndex < other._sortIndex);
122  }
123 
124  if (this->_usageCount > other._usageCount) {return false;}
125  if (this->_usageCount < other._usageCount) {return true;}
126  // else _usageCount is equal
127 
128  if (this->_detectorId > other._detectorId) {return false;}
129  if (this->_detectorId < other._detectorId) {return true;}
130  // else _detectorId is equal
131 
132  if (this->_subsystemName > other._subsystemName) {return false;}
133  if (this->_subsystemName < other._subsystemName) {return true;}
134  // else _subsystemName is equal
135 
136  if (this->_configType > other._configType) {return false;}
137  if (this->_configType < other._configType) {return true;}
138  // else _configType is equal
139 
140  if (this->_configName > other._configName) {return false;}
141  if (this->_configName < other._configName) {return true;}
142  // else _configName is equal
143 
144  if (this->_dcmOperatingMode > other._dcmOperatingMode) {return false;}
145  if (this->_dcmOperatingMode < other._dcmOperatingMode) {return true;}
146  // else _dcmOperatingMode is equal
147 
148  if (this->_timestamp > other._timestamp) {return false;}
149  if (this->_timestamp < other._timestamp) {return true;}
150  // else _timestamp is equal
151 
152  return false;
153 }
void dbutils::daqconfig::SubsystemNameSpec::setSortIndex ( int  value)
inline
void dbutils::daqconfig::SubsystemNameSpec::setUsageCount ( int  value)
inline

Definition at line 82 of file SubsystemNameSpec.h.

References _usageCount.

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

82 {_usageCount = value;}
const XML_Char int const XML_Char * value
Definition: expat.h:331
std::string dbutils::daqconfig::SubsystemNameSpec::toString ( int  overallIndent = 0) const

Creates a string representation of the name specification.

Definition at line 78 of file SubsystemNameSpec.cpp.

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

Referenced by getUsageCount().

79 {
80  std::string workString;
81  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
82  workString.append("Named Subsystem Configuration:\n");
83  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
84  workString.append(" configuration name: " + _configName + "\n");
85  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
86  workString.append(" DCM operating mode: " + _dcmOperatingMode + "\n");
87  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
88  workString.append(" detector name: " + _detectorId + "\n");
89  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
90  workString.append(" subsystem name: " + _subsystemName + "\n");
91  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
92  workString.append(" configuration type: " + _configType + "\n");
93 
94  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
95  if (_hasTimestamp) {
96  workString.append(" timestamp: " + _timestamp);
97  }
98  else {
99  workString.append(" no timestamp");
100  }
101  workString.append("\n");
102 
103  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
104  workString.append(" usage count: " +
105  boost::lexical_cast<std::string>(_usageCount) + "\n");
106 
107  if (overallIndent > 0) {_addSpaces(workString, overallIndent);}
108  workString.append(" DAQ or Slow Controls: ");
109  workString.append((_isSlowControlsConfig ? "Slow Controls" : "DAQ"));
110 
111  return workString;
112 }
void _addSpaces(std::string &workString, int count) const
enum BeamMode string

Member Data Documentation

std::string dbutils::daqconfig::SubsystemNameSpec::_configName
private

Definition at line 95 of file SubsystemNameSpec.h.

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

std::string dbutils::daqconfig::SubsystemNameSpec::_configType
private

Definition at line 100 of file SubsystemNameSpec.h.

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

std::string dbutils::daqconfig::SubsystemNameSpec::_dcmOperatingMode
private

Definition at line 96 of file SubsystemNameSpec.h.

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

std::string dbutils::daqconfig::SubsystemNameSpec::_detectorId
private

Definition at line 97 of file SubsystemNameSpec.h.

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

bool dbutils::daqconfig::SubsystemNameSpec::_hasTimestamp
private

Definition at line 102 of file SubsystemNameSpec.h.

Referenced by hasTimestamp(), and toString().

bool dbutils::daqconfig::SubsystemNameSpec::_isSlowControlsConfig
private

Definition at line 105 of file SubsystemNameSpec.h.

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

int dbutils::daqconfig::SubsystemNameSpec::_sortIndex
private

Definition at line 108 of file SubsystemNameSpec.h.

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

std::string dbutils::daqconfig::SubsystemNameSpec::_subsystemName
private

Definition at line 99 of file SubsystemNameSpec.h.

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

std::string dbutils::daqconfig::SubsystemNameSpec::_timestamp
private

Definition at line 103 of file SubsystemNameSpec.h.

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

int dbutils::daqconfig::SubsystemNameSpec::_usageCount
private

Definition at line 107 of file SubsystemNameSpec.h.

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

const std::string dbutils::daqconfig::SubsystemNameSpec::BNEVB_SUBSYSTEM_NAME
static

Definition at line 28 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::CONNECT_CONFIG_TYPE
static

Definition at line 29 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::DAQMONITOR_SUBSYSTEM_NAME
static

Definition at line 21 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::DCM_SUBSYSTEM_NAME
static

Definition at line 22 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::DDT_SUBSYSTEM_NAME
static

Definition at line 26 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::DL_SUBSYSTEM_NAME
static

Definition at line 23 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::GT_SUBSYSTEM_NAME
static

Definition at line 24 of file SubsystemNameSpec.h.

Referenced by dbutils::daqconfig::GTRunConfig::GTRunConfig().

const std::string dbutils::daqconfig::SubsystemNameSpec::HARDWARE_CONFIG_TYPE
static

Definition at line 30 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::RUN_CONFIG_TYPE
static

Definition at line 31 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::SM_SUBSYSTEM_NAME
static

Definition at line 25 of file SubsystemNameSpec.h.

const std::string dbutils::daqconfig::SubsystemNameSpec::TDUMANAGER_SUBSYSTEM_NAME
static

Definition at line 27 of file SubsystemNameSpec.h.


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