The Gaudi Framework  v29r0 (ff2e7097)
ServiceHistory Class Reference

ServiceHistory class definition. More...

#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 *)
 
virtual ~ServiceHistory ()=default
 
const CLIDclID () const override
 Retrieve reference to class definition structure. More...
 
const PropertyListproperties () const override
 
const IServiceservice () const
 
const JobHistoryjobHistory () const
 
void dump (std::ostream &, const bool isXML=false, int indent=0) const override
 
const std::stringname () const override
 
const std::stringtype () const override
 
const std::stringversion () const override
 
- Public Member Functions inherited from HistoryObj
 HistoryObj ()=default
 
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 () const
 Retrieve Link manager. More...
 
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
 
std::string m_name
 
std::string m_type
 
std::string m_version
 
PropertyList m_properties
 

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 21 of file ServiceHistory.h.

Constructor & Destructor Documentation

ServiceHistory::ServiceHistory ( )

Definition at line 25 of file ServiceHistory.cpp.

26  : // HistoryObj(),
27  m_pService( nullptr )
28  , m_name( "none" )
29  , m_type( "none" )
30  , m_version( "none" )
31 {
32 }
std::string m_name
std::string m_type
std::string m_version
const IService * m_pService
ServiceHistory::ServiceHistory ( const IService isv,
const JobHistory job 
)

Definition at line 35 of file ServiceHistory.cpp.

36  : // HistoryObj(),
37  m_pService( isv )
38  , m_jobHistory( job )
39  , m_name( isv->name() )
40  , m_version( "none" )
41 {
42 
43  const Service* svc = dynamic_cast<const Service*>( isv );
44  m_type = System::typeinfoName( typeid( *svc ) );
45  m_properties = svc->getProperties();
46 }
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
std::string m_name
PropertyList m_properties
std::string m_type
const JobHistory * m_jobHistory
std::string m_version
Base class for all services.
Definition: Service.h:36
const IService * m_pService
ServiceHistory::ServiceHistory ( const IService isv,
const JobHistory job 
)

Definition at line 50 of file ServiceHistory.cpp.

51  : // HistoryObj(),
52  m_pService( &isv )
53  , m_jobHistory( job )
54  , m_name( isv.name() )
55  , m_version( "none" )
56 {
57 
58  const Service* svc = dynamic_cast<const Service*>( &isv );
59  m_type = System::typeinfoName( typeid( *svc ) );
60  m_properties = svc->getProperties();
61 }
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
std::string m_name
PropertyList m_properties
std::string m_type
const JobHistory * m_jobHistory
std::string m_version
Base class for all services.
Definition: Service.h:36
const IService * m_pService
virtual ServiceHistory::~ServiceHistory ( )
virtualdefault

Member Function Documentation

const CLID & ServiceHistory::classID ( )
static

Definition at line 65 of file ServiceHistory.cpp.

66 {
67 
68  static const CLID CLID_ServiceHistory = 187225489; // from `clid ServiceHistory`
69  return CLID_ServiceHistory;
70 }
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
const CLID& ServiceHistory::clID ( ) const
inlineoverridevirtual

Retrieve reference to class definition structure.

Retrieve Pointer to class definition structure.

Reimplemented from HistoryObj.

Definition at line 32 of file ServiceHistory.h.

32 { return classID(); }
static const CLID & classID()
void ServiceHistory::dump ( std::ostream ost,
const bool  isXML = false,
int  indent = 0 
) const
overridevirtual

Implements HistoryObj.

Definition at line 74 of file ServiceHistory.cpp.

75 {
76 
77  if ( !isXML ) {
78 
79  ost << "Name: " << name() << endl;
80  ost << "Type: " << type() << endl;
81  ost << "Version: " << version() << endl;
82 
83  // Properties
84  ost << "Properties: [" << endl;
85 
86  for ( const auto& ipprop : properties() ) {
87  const PropertyBase& prop = *ipprop;
88  prop.fillStream( ost );
89  ost << endl;
90  }
91  ost << "]" << endl;
92 
93  } else {
94 
95  ind += 2;
96  indent( ost, ind );
97  ost << "<COMPONENT name=\"" << name() << "\" class=\"" << convert_string( type() ) << "\" version=\""
98  << convert_string( version() ) << "\">" << endl;
99 
100  for ( const auto& ipprop : properties() ) {
101  const PropertyBase& prop = *ipprop;
102 
103  indent( ost, ind + 2 );
104  ost << "<PROPERTY name=\"" << prop.name() << "\" value=\"" << convert_string( prop.toString() )
105  << "\" documentation=\"" << convert_string( prop.documentation() ) << "\">" << endl;
106  }
107 
108  indent( ost, ind );
109  ost << "</COMPONENT>" << endl;
110  }
111 }
const std::string name() const
property name
Definition: Property.h:40
T endl(T...args)
virtual std::string toString() const =0
value -> string
const PropertyList & properties() const override
const std::string & name() const override
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:49
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
virtual std::ostream & fillStream(std::ostream &) const
the printout of the property value
Definition: Property.cpp:52
const std::string & version() const override
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:20
std::string documentation() const
property documentation
Definition: Property.h:42
const std::string & type() const override
const JobHistory* ServiceHistory::jobHistory ( ) const
inline

Definition at line 40 of file ServiceHistory.h.

40 { return m_jobHistory; }
const JobHistory * m_jobHistory
const std::string& ServiceHistory::name ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 44 of file ServiceHistory.h.

44 { return m_name; }
std::string m_name
const PropertyList& ServiceHistory::properties ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 36 of file ServiceHistory.h.

36 { return m_properties; }
PropertyList m_properties
const IService* ServiceHistory::service ( ) const
inline

Definition at line 38 of file ServiceHistory.h.

38 { return m_pService; }
const IService * m_pService
const std::string& ServiceHistory::type ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 45 of file ServiceHistory.h.

45 { return m_type; }
std::string m_type
const std::string& ServiceHistory::version ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 46 of file ServiceHistory.h.

46 { return m_version; }
std::string m_version

Member Data Documentation

const JobHistory* ServiceHistory::m_jobHistory
private

Definition at line 50 of file ServiceHistory.h.

std::string ServiceHistory::m_name
private

Definition at line 51 of file ServiceHistory.h.

PropertyList ServiceHistory::m_properties
private

Definition at line 52 of file ServiceHistory.h.

const IService* ServiceHistory::m_pService
private

Definition at line 49 of file ServiceHistory.h.

std::string ServiceHistory::m_type
private

Definition at line 51 of file ServiceHistory.h.

std::string ServiceHistory::m_version
private

Definition at line 51 of file ServiceHistory.h.


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