Public Member Functions | Private Attributes | List of all members
dbutils::daqappmgr::ApplicationInstance Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/DatabaseUtils/cxx/include/DAQAppMgr/ApplicationInstance.h"

Public Member Functions

 ApplicationInstance (const std::string &appName, const std::string &typeName, const std::string &hostName, boost::shared_ptr< ApplicationType > typePtr=boost::shared_ptr< ApplicationType >(), boost::shared_ptr< Host > hostPtr=boost::shared_ptr< Host >(), const bool &isEnabled=true, const int &monitorMSec=10000)
 
 ApplicationInstance (const ApplicationInstance &appInstance)
 
std::string getAppName () const
 
std::string getTypeName () const
 
std::string getHostName () const
 
boost::shared_ptr< ApplicationTypegetTypePtr () const
 
boost::shared_ptr< HostgetHostPtr () const
 
bool isEnabled () const
 
template<class T >
bool getParameter (const std::string &key, T &resultValue) const
 
int getMonitorMSec () const
 
void setTypePtr (boost::shared_ptr< ApplicationType > typePtr)
 
void setHostPtr (boost::shared_ptr< Host > hostPtr)
 
void setParameterSet (boost::shared_ptr< dbutils::SimpleParameterSet > additionalParams)
 
bool operator== (const ApplicationInstance &other) const
 
bool operator!= (const ApplicationInstance &other) const
 
bool operator< (const ApplicationInstance &other) const
 

Private Attributes

std::string _appName
 
std::string _typeName
 
std::string _hostName
 
boost::shared_ptr< ApplicationType_typePtr
 
boost::shared_ptr< Host_hostPtr
 
boost::shared_ptr< dbutils::SimpleParameterSet_additionalParams
 
bool _isEnabled
 
int _monitorMSec
 

Detailed Description

Simple container class for the information that describes an instance of a DAQ application.

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

Definition at line 21 of file ApplicationInstance.h.

Constructor & Destructor Documentation

dbutils::daqappmgr::ApplicationInstance::ApplicationInstance ( const std::string appName,
const std::string typeName,
const std::string hostName,
boost::shared_ptr< ApplicationType typePtr = boost::shared_ptr<ApplicationType>(),
boost::shared_ptr< Host hostPtr = boost::shared_ptr<Host>(),
const bool &  isEnabled = true,
const int monitorMSec = 10000 
)

Creates an instance from the specified values.

Definition at line 10 of file ApplicationInstance.cpp.

dbutils::daqappmgr::ApplicationInstance::ApplicationInstance ( const ApplicationInstance appInstance)

Creates a copy.

Definition at line 27 of file ApplicationInstance.cpp.

References _additionalParams, _appName, _hostName, _hostPtr, _isEnabled, _monitorMSec, _typeName, _typePtr, and operator==().

28 {
29  _appName = appInstance._appName;
30  _typeName = appInstance._typeName;
31  _hostName = appInstance._hostName;
32  _typePtr = appInstance._typePtr;
33  _hostPtr = appInstance._hostPtr;
34  _isEnabled = appInstance._isEnabled;
35  _additionalParams = appInstance._additionalParams;
36  _monitorMSec = appInstance._monitorMSec;
37 }
boost::shared_ptr< ApplicationType > _typePtr
boost::shared_ptr< dbutils::SimpleParameterSet > _additionalParams

Member Function Documentation

std::string dbutils::daqappmgr::ApplicationInstance::getAppName ( ) const
inline

Definition at line 45 of file ApplicationInstance.h.

References _appName.

std::string dbutils::daqappmgr::ApplicationInstance::getHostName ( ) const
inline
boost::shared_ptr<Host> dbutils::daqappmgr::ApplicationInstance::getHostPtr ( ) const
inline

Definition at line 51 of file ApplicationInstance.h.

References _hostPtr.

51  {
52  return _hostPtr;
53  }
int dbutils::daqappmgr::ApplicationInstance::getMonitorMSec ( ) const
inline

Definition at line 62 of file ApplicationInstance.h.

References _monitorMSec.

template<class T >
bool dbutils::daqappmgr::ApplicationInstance::getParameter ( const std::string key,
T resultValue 
) const
inline

Definition at line 57 of file ApplicationInstance.h.

References _additionalParams.

57  {
58  if (_additionalParams.get() == 0) {return false;}
59  return _additionalParams->get(key, resultValue);
60  }
boost::shared_ptr< dbutils::SimpleParameterSet > _additionalParams
std::string dbutils::daqappmgr::ApplicationInstance::getTypeName ( ) const
inline
boost::shared_ptr<ApplicationType> dbutils::daqappmgr::ApplicationInstance::getTypePtr ( ) const
inline

Definition at line 48 of file ApplicationInstance.h.

References _typePtr.

48  {
49  return _typePtr;
50  }
boost::shared_ptr< ApplicationType > _typePtr
bool dbutils::daqappmgr::ApplicationInstance::isEnabled ( ) const
inline

Definition at line 54 of file ApplicationInstance.h.

References _isEnabled.

bool dbutils::daqappmgr::ApplicationInstance::operator!= ( const ApplicationInstance other) const

Tests if the specified set is not equal to this one.

Definition at line 59 of file ApplicationInstance.cpp.

References operator<(), and fhicl::other.

Referenced by operator==(), and setParameterSet().

60 {
61  return !(*this==other);
62 }
bool dbutils::daqappmgr::ApplicationInstance::operator< ( const ApplicationInstance other) const

Tests if the specified instance is less than this one.

Definition at line 68 of file ApplicationInstance.cpp.

References _appName, _hostName, _isEnabled, and _typeName.

Referenced by operator!=(), and setParameterSet().

69 {
70  if (this->_appName > other._appName) {return false;}
71  if (this->_appName < other._appName) {return true;}
72  // else _appName is equal
73 
74  if (this->_typeName > other._typeName) {return false;}
75  if (this->_typeName < other._typeName) {return true;}
76  // else _typeName is equal
77 
78  if (this->_hostName > other._hostName) {return false;}
79  if (this->_hostName < other._hostName) {return true;}
80  // else _hostName is equal
81 
82  if (! this->_isEnabled && other._isEnabled) {return true;}
83  else {return false;}
84 }
bool dbutils::daqappmgr::ApplicationInstance::operator== ( const ApplicationInstance other) const

Tests if the specified instance is equal to this one.

Definition at line 43 of file ApplicationInstance.cpp.

References _appName, _hostName, _isEnabled, _typeName, and operator!=().

Referenced by ApplicationInstance(), and setParameterSet().

44 {
45  if (other._isEnabled && ! this->_isEnabled) {return false;}
46  if (! other._isEnabled && this->_isEnabled) {return false;}
47 
48  // we leave typePtr and hostPtr out of the comparison, for now...
49 
50  return (other._appName == this->_appName &&
51  other._typeName == this->_typeName &&
52  other._hostName == this->_hostName);
53 }
void dbutils::daqappmgr::ApplicationInstance::setHostPtr ( boost::shared_ptr< Host hostPtr)
inline

Definition at line 71 of file ApplicationInstance.h.

References _hostPtr.

71  {
72  _hostPtr = hostPtr;
73  }
void dbutils::daqappmgr::ApplicationInstance::setParameterSet ( boost::shared_ptr< dbutils::SimpleParameterSet additionalParams)
inline

Definition at line 74 of file ApplicationInstance.h.

References _additionalParams, operator!=(), operator<(), operator==(), and fhicl::other.

Referenced by dbutils::daqappmgr::ConfiguredProcessList::_fetchProcessData().

75  {
76  _additionalParams = additionalParams;
77  }
boost::shared_ptr< dbutils::SimpleParameterSet > _additionalParams
void dbutils::daqappmgr::ApplicationInstance::setTypePtr ( boost::shared_ptr< ApplicationType typePtr)
inline

Definition at line 68 of file ApplicationInstance.h.

References _typePtr.

68  {
69  _typePtr = typePtr;
70  }
boost::shared_ptr< ApplicationType > _typePtr

Member Data Documentation

boost::shared_ptr<dbutils::SimpleParameterSet> dbutils::daqappmgr::ApplicationInstance::_additionalParams
private

Definition at line 94 of file ApplicationInstance.h.

Referenced by ApplicationInstance(), getParameter(), and setParameterSet().

std::string dbutils::daqappmgr::ApplicationInstance::_appName
private

Definition at line 89 of file ApplicationInstance.h.

Referenced by ApplicationInstance(), getAppName(), operator<(), and operator==().

std::string dbutils::daqappmgr::ApplicationInstance::_hostName
private

Definition at line 91 of file ApplicationInstance.h.

Referenced by ApplicationInstance(), getHostName(), operator<(), and operator==().

boost::shared_ptr<Host> dbutils::daqappmgr::ApplicationInstance::_hostPtr
private

Definition at line 93 of file ApplicationInstance.h.

Referenced by ApplicationInstance(), getHostPtr(), and setHostPtr().

bool dbutils::daqappmgr::ApplicationInstance::_isEnabled
private

Definition at line 95 of file ApplicationInstance.h.

Referenced by ApplicationInstance(), isEnabled(), operator<(), and operator==().

int dbutils::daqappmgr::ApplicationInstance::_monitorMSec
private

Definition at line 96 of file ApplicationInstance.h.

Referenced by ApplicationInstance(), and getMonitorMSec().

std::string dbutils::daqappmgr::ApplicationInstance::_typeName
private

Definition at line 90 of file ApplicationInstance.h.

Referenced by ApplicationInstance(), getTypeName(), operator<(), and operator==().

boost::shared_ptr<ApplicationType> dbutils::daqappmgr::ApplicationInstance::_typePtr
private

Definition at line 92 of file ApplicationInstance.h.

Referenced by ApplicationInstance(), getTypePtr(), and setTypePtr().


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