The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
ServiceHistory Class Reference

ServiceHistory class definition. More...

#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.
 
const PropertyListproperties () const override
 
const IServiceservice () const
 
const JobHistoryjobHistory () const
 
std::ostream & dump (std::ostream &, const bool isXML, int indent) const override
 
const std::string & name () const override
 
const std::string & type () const override
 
const std::string & version () const override
 
- Public Member Functions inherited from HistoryObj
virtual ~HistoryObj ()=default
 
- Public Member Functions inherited from DataObject
 DataObject ()
 Standard Constructor.
 
 DataObject (const DataObject &rhs)
 Copy Constructor.
 
DataObjectoperator= (const DataObject &rhs)
 Assignment Operator.
 
 DataObject (DataObject &&rhs)
 Move Constructor.
 
DataObjectoperator= (DataObject &&rhs)
 Move Assignment Operator.
 
virtual ~DataObject ()
 Standard Destructor.
 
virtual unsigned long addRef ()
 Add reference to object.
 
virtual unsigned long release ()
 release reference to object
 
const std::string & name () const
 Retreive DataObject name. It is the name when registered in the store.
 
virtual StatusCode update ()
 Provide empty placeholder for internal object reconfiguration callback.
 
void setRegistry (IRegistry *pRegistry)
 Set pointer to Registry.
 
IRegistryregistry () const
 Get pointer to Registry.
 
LinkManagerlinkMgr ()
 Retrieve Link manager.
 
const LinkManagerlinkMgr () const
 
unsigned char version () const
 Retrieve version number of this object representation.
 
void setVersion (unsigned char vsn)
 Set version number of this object representation.
 
unsigned long refCount () const
 Return the refcount.
 
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the output stream (ASCII)
 
- 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)
 

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::ostream & operator<< (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 30 of file ServiceHistory.h.

Constructor & Destructor Documentation

◆ ServiceHistory() [1/3]

ServiceHistory::ServiceHistory ( )

Definition at line 20 of file ServiceHistory.cpp.

20: m_pService( nullptr ), m_name( "none" ), m_type( "none" ), m_version( "none" ) {}
std::string m_type
std::string m_name
std::string m_version
const IService * m_pService

◆ ServiceHistory() [2/3]

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

Definition at line 22 of file ServiceHistory.cpp.

23 : m_pService( isv ), m_jobHistory( job ), m_name( isv->name() ), m_version( "none" ) {
24
25 const Service* svc = dynamic_cast<const Service*>( isv );
26 if ( !svc ) throw GaudiException( "Cannot dynamic cast to Service class", name(), StatusCode::FAILURE );
27 m_type = System::typeinfoName( typeid( *svc ) );
29}
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
PropertyList m_properties
const JobHistory * m_jobHistory
const std::string & name() const override
constexpr static const auto FAILURE
Definition StatusCode.h:100
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition System.cpp:260

◆ ServiceHistory() [3/3]

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

Definition at line 31 of file ServiceHistory.cpp.

32 : m_pService( &isv ), m_jobHistory( job ), m_name( isv.name() ), m_version( "none" ) {
33
34 const Service* svc = dynamic_cast<const Service*>( &isv );
35 if ( svc ) {
36 m_type = System::typeinfoName( typeid( *svc ) );
38 } else {
39 throw GaudiException( "Cannot dynamic cast to Service class", name(), StatusCode::FAILURE );
40 }
41}

Member Function Documentation

◆ classID()

const CLID & ServiceHistory::classID ( )
static

Definition at line 43 of file ServiceHistory.cpp.

43 {
44 static const CLID CLID_ServiceHistory = 187225489; // from `clid ServiceHistory`
45 return CLID_ServiceHistory;
46}
unsigned int CLID
Class ID definition.
Definition ClassID.h:16

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

38{ return classID(); }
static const CLID & classID()

◆ dump()

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

Implements HistoryObj.

Definition at line 48 of file ServiceHistory.cpp.

48 {
49
50 if ( !isXML ) {
51
52 ost << "Name: " << name() << endl;
53 ost << "Type: " << type() << endl;
54 ost << "Version: " << version() << endl;
55
56 // Properties
57 ost << "Properties: [" << endl;
58
59 for ( const auto& ipprop : properties() ) {
60 const PropertyBase& prop = *ipprop;
61 prop.fillStream( ost );
62 ost << endl;
63 }
64 ost << "]" << endl;
65
66 } else {
67
68 ind += 2;
69 indent( ost, ind );
70 ost << "<COMPONENT name=\"" << name() << "\" class=\"" << convert_string( type() ) << "\" version=\""
71 << convert_string( version() ) << "\">" << endl;
72
73 for ( const auto& ipprop : properties() ) {
74 const PropertyBase& prop = *ipprop;
75
76 indent( ost, ind + 2 );
77 ost << "<PROPERTY name=\"" << prop.name() << "\" value=\"" << convert_string( prop.toString() )
78 << "\" documentation=\"" << convert_string( prop.documentation() ) << "\">" << endl;
79 }
80
81 indent( ost, ind );
82 ost << "</COMPONENT>" << endl;
83 }
84 return ost;
85}
std::string documentation() const
property documentation
virtual std::string toString() const =0
value -> string
virtual std::ostream & fillStream(std::ostream &) const
the printout of the property value
Definition Property.cpp:45
const std::string name() const
property name
virtual void indent(std::ostream &, int) const
static std::string convert_string(const std::string &)
const std::string & type() const override
const PropertyList & properties() const override
const std::string & version() const override

◆ jobHistory()

const JobHistory * ServiceHistory::jobHistory ( ) const
inline

Definition at line 46 of file ServiceHistory.h.

46{ return m_jobHistory; }

◆ name()

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

Implements IVersHistoryObj.

Definition at line 50 of file ServiceHistory.h.

50{ return m_name; }

◆ properties()

const PropertyList & ServiceHistory::properties ( ) const
inlineoverridevirtual

Implements IVersHistoryObj.

Definition at line 42 of file ServiceHistory.h.

42{ return m_properties; }

◆ service()

const IService * ServiceHistory::service ( ) const
inline

Definition at line 44 of file ServiceHistory.h.

44{ return m_pService; }

◆ type()

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

Implements IVersHistoryObj.

Definition at line 51 of file ServiceHistory.h.

51{ return m_type; }

◆ version()

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

Implements IVersHistoryObj.

Definition at line 52 of file ServiceHistory.h.

52{ return m_version; }

Friends And Related Symbol Documentation

◆ operator<<

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

Definition at line 55 of file ServiceHistory.h.

55{ return rhs.dump( lhs, false, 0 ); }
std::ostream & dump(std::ostream &, const bool isXML, int indent) const override

Member Data Documentation

◆ m_jobHistory

const JobHistory* ServiceHistory::m_jobHistory { nullptr }
private

Definition at line 59 of file ServiceHistory.h.

59{ nullptr };

◆ m_name

std::string ServiceHistory::m_name
private

Definition at line 60 of file ServiceHistory.h.

◆ m_properties

PropertyList ServiceHistory::m_properties
private

Definition at line 61 of file ServiceHistory.h.

◆ m_pService

const IService* ServiceHistory::m_pService
private

Definition at line 58 of file ServiceHistory.h.

◆ m_type

std::string ServiceHistory::m_type
private

Definition at line 60 of file ServiceHistory.h.

◆ m_version

std::string ServiceHistory::m_version
private

Definition at line 60 of file ServiceHistory.h.


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