The Gaudi Framework  master (594c33fa)
ServiceHistory Class Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/ServiceHistory.h>

Inheritance diagram for ServiceHistory:
Collaboration diagram for ServiceHistory:

Public Member Functions

 ServiceHistory ()
 
 ServiceHistory (const IService *, const JobHistory *)
 
 ServiceHistory (const IService &, const JobHistory *)
 
const CLIDclID () const override
 Retrieve reference to class definition structure. More...
 
const PropertyListproperties () const override
 
const IServiceservice () const
 
const JobHistoryjobHistory () const
 
std::ostreamdump (std::ostream &, const bool isXML, int indent) const override
 
const std::stringname () const override
 
const std::stringtype () const override
 
const std::stringversion () const override
 
- Public Member Functions inherited from HistoryObj
virtual ~HistoryObj ()=default
 
- Public Member Functions inherited from DataObject
 DataObject ()
 Standard Constructor. More...
 
 DataObject (const DataObject &rhs)
 Copy Constructor. More...
 
DataObjectoperator= (const DataObject &rhs)
 Assignment Operator. More...
 
 DataObject (DataObject &&rhs)
 Move Constructor. More...
 
DataObjectoperator= (DataObject &&rhs)
 Move Assignment Operator. More...
 
virtual ~DataObject ()
 Standard Destructor. More...
 
virtual unsigned long addRef ()
 Add reference to object. More...
 
virtual unsigned long release ()
 release reference to object More...
 
const std::stringname () const
 Retreive DataObject name. It is the name when registered in the store. More...
 
virtual StatusCode update ()
 Provide empty placeholder for internal object reconfiguration callback. More...
 
void setRegistry (IRegistry *pRegistry)
 Set pointer to Registry. More...
 
IRegistryregistry () const
 Get pointer to Registry. More...
 
LinkManagerlinkMgr ()
 Retrieve Link manager. More...
 
const LinkManagerlinkMgr () const
 
unsigned char version () const
 Retrieve version number of this object representation. More...
 
void setVersion (unsigned char vsn)
 Set version number of this object representation. More...
 
unsigned long refCount () const
 Return the refcount. More...
 
virtual std::ostreamfillStream (std::ostream &s) const
 Fill the output stream (ASCII) More...
 
- Public Member Functions inherited from IVersHistoryObj
virtual ~IVersHistoryObj ()=default
 

Static Public Member Functions

static const CLIDclassID ()
 
- Static Public Member Functions inherited from HistoryObj
static const CLIDclassID ()
 
static std::string convert_string (const std::string &)
 
- Static Public Member Functions inherited from DataObject
static const CLIDclassID ()
 Retrieve reference to class definition structure (static access) More...
 

Private Attributes

const IServicem_pService
 
const JobHistorym_jobHistory { nullptr }
 
std::string m_name
 
std::string m_type
 
std::string m_version
 
PropertyList m_properties
 

Friends

std::ostreamoperator<< (std::ostream &lhs, const ServiceHistory &rhs)
 

Additional Inherited Members

- Public Types inherited from IVersHistoryObj
typedef std::vector< Gaudi::Details::PropertyBase * > PropertyList
 
- Protected Member Functions inherited from HistoryObj
virtual void indent (std::ostream &, int) const
 

Detailed Description

ServiceHistory class definition

Author
: Charles Leggett

Definition at line 31 of file ServiceHistory.h.

Constructor & Destructor Documentation

◆ ServiceHistory() [1/3]

ServiceHistory::ServiceHistory ( )

Definition at line 35 of file ServiceHistory.cpp.

36  : // HistoryObj(),
37  m_pService( nullptr )
38  , m_name( "none" )
39  , m_type( "none" )
40  , m_version( "none" ) {}

◆ ServiceHistory() [2/3]

ServiceHistory::ServiceHistory ( const IService isv,
const JobHistory job 
)

Definition at line 43 of file ServiceHistory.cpp.

44  : // HistoryObj(),
45  m_pService( isv )
46  , m_jobHistory( job )
47  , m_name( isv->name() )
48  , m_version( "none" ) {
49 
50  const Service* svc = dynamic_cast<const Service*>( isv );
51  if ( !svc ) throw GaudiException( "Cannot dynamic cast to Service class", name(), StatusCode::FAILURE );
52  m_type = System::typeinfoName( typeid( *svc ) );
53  m_properties = svc->getProperties();
54 }

◆ ServiceHistory() [3/3]

ServiceHistory::ServiceHistory ( const IService isv,
const JobHistory job 
)

Definition at line 58 of file ServiceHistory.cpp.

59  : // HistoryObj(),
60  m_pService( &isv )
61  , m_jobHistory( job )
62  , m_name( isv.name() )
63  , m_version( "none" ) {
64 
65  const Service* svc = dynamic_cast<const Service*>( &isv );
66  if ( svc ) {
67  m_type = System::typeinfoName( typeid( *svc ) );
68  m_properties = svc->getProperties();
69  } else {
70  throw GaudiException( "Cannot dynamic cast to Service class", name(), StatusCode::FAILURE );
71  }
72 }

Member Function Documentation

◆ classID()

const CLID & ServiceHistory::classID ( )
static

Definition at line 76 of file ServiceHistory.cpp.

76  {
77 
78  static const CLID CLID_ServiceHistory = 187225489; // from `clid ServiceHistory`
79  return CLID_ServiceHistory;
80 }

◆ clID()

const CLID& ServiceHistory::clID ( ) const
inlineoverridevirtual

Retrieve reference to class definition structure.

Retrieve Pointer to class definition structure.

Reimplemented from HistoryObj.

Definition at line 39 of file ServiceHistory.h.

39 { return classID(); }

◆ dump()

std::ostream & ServiceHistory::dump ( std::ostream ost,
const bool  isXML,
int  indent 
) const
overridevirtual

Implements HistoryObj.

Definition at line 84 of file ServiceHistory.cpp.

84  {
85 
86  if ( !isXML ) {
87 
88  ost << "Name: " << name() << endl;
89  ost << "Type: " << type() << endl;
90  ost << "Version: " << version() << endl;
91 
92  // Properties
93  ost << "Properties: [" << endl;
94 
95  for ( const auto& ipprop : properties() ) {
96  const PropertyBase& prop = *ipprop;
97  prop.fillStream( ost );
98  ost << endl;
99  }
100  ost << "]" << endl;
101 
102  } else {
103 
104  ind += 2;
105  indent( ost, ind );
106  ost << "<COMPONENT name=\"" << name() << "\" class=\"" << convert_string( type() ) << "\" version=\""
107  << convert_string( version() ) << "\">" << endl;
108 
109  for ( const auto& ipprop : properties() ) {
110  const PropertyBase& prop = *ipprop;
111 
112  indent( ost, ind + 2 );
113  ost << "<PROPERTY name=\"" << prop.name() << "\" value=\"" << convert_string( prop.toString() )
114  << "\" documentation=\"" << convert_string( prop.documentation() ) << "\">" << endl;
115  }
116 
117  indent( ost, ind );
118  ost << "</COMPONENT>" << endl;
119  }
120  return ost;
121 }

◆ jobHistory()

const JobHistory* ServiceHistory::jobHistory ( ) const
inline

Definition at line 47 of file ServiceHistory.h.

47 { return m_jobHistory; }

◆ name()

const std::string& ServiceHistory::name ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 51 of file ServiceHistory.h.

51 { return m_name; }

◆ properties()

const PropertyList& ServiceHistory::properties ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 43 of file ServiceHistory.h.

43 { return m_properties; }

◆ service()

const IService* ServiceHistory::service ( ) const
inline

Definition at line 45 of file ServiceHistory.h.

45 { return m_pService; }

◆ type()

const std::string& ServiceHistory::type ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 52 of file ServiceHistory.h.

52 { return m_type; }

◆ version()

const std::string& ServiceHistory::version ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 53 of file ServiceHistory.h.

53 { return m_version; }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream lhs,
const ServiceHistory rhs 
)
friend

Definition at line 56 of file ServiceHistory.h.

56 { return rhs.dump( lhs, false, 0 ); }

Member Data Documentation

◆ m_jobHistory

const JobHistory* ServiceHistory::m_jobHistory { nullptr }
private

Definition at line 60 of file ServiceHistory.h.

◆ m_name

std::string ServiceHistory::m_name
private

Definition at line 61 of file ServiceHistory.h.

◆ m_properties

PropertyList ServiceHistory::m_properties
private

Definition at line 62 of file ServiceHistory.h.

◆ m_pService

const IService* ServiceHistory::m_pService
private

Definition at line 59 of file ServiceHistory.h.

◆ m_type

std::string ServiceHistory::m_type
private

Definition at line 61 of file ServiceHistory.h.

◆ m_version

std::string ServiceHistory::m_version
private

Definition at line 61 of file ServiceHistory.h.


The documentation for this class was generated from the following files:
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: PropertyBase.h:35
ServiceHistory::classID
static const CLID & classID()
Definition: ServiceHistory.cpp:76
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: PropertyBase.h:39
ServiceHistory::m_properties
PropertyList m_properties
Definition: ServiceHistory.h:62
Gaudi::Details::PropertyBase::documentation
std::string documentation() const
property documentation
Definition: PropertyBase.h:41
GaudiException
Definition: GaudiException.h:31
ServiceHistory::m_name
std::string m_name
Definition: ServiceHistory.h:61
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:313
ServiceHistory::m_type
std::string m_type
Definition: ServiceHistory.h:61
Gaudi::Details::PropertyBase::fillStream
virtual std::ostream & fillStream(std::ostream &) const
the printout of the property value
Definition: Property.cpp:60
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:56
ServiceHistory::type
const std::string & type() const override
Definition: ServiceHistory.h:52
HistoryObj::convert_string
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:30
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
ServiceHistory::m_jobHistory
const JobHistory * m_jobHistory
Definition: ServiceHistory.h:60
std::endl
T endl(T... args)
ServiceHistory::dump
std::ostream & dump(std::ostream &, const bool isXML, int indent) const override
Definition: ServiceHistory.cpp:84
Gaudi::Details::PropertyBase::toString
virtual std::string toString() const =0
value -> string
ServiceHistory::name
const std::string & name() const override
Definition: ServiceHistory.h:51
ServiceHistory::version
const std::string & version() const override
Definition: ServiceHistory.h:53
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
ServiceHistory::m_pService
const IService * m_pService
Definition: ServiceHistory.h:59
ServiceHistory::properties
const PropertyList & properties() const override
Definition: ServiceHistory.h:43
ServiceHistory::m_version
std::string m_version
Definition: ServiceHistory.h:61