| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Auditor Class Reference

Base class from which all concrete auditor classes should be derived. More...

`#include <GaudiKernel/Auditor.h>`

Inheritance diagram for Auditor:
[legend]
Collaboration diagram for Auditor:
[legend]

## Public Types
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from CommonMessaging< implements< IAuditor, IProperty > >
using | base_class = CommonMessaging

## Public Member Functions
| Auditor (const std::string &name, ISvcLocator *svcloc)
| Constructor. More...
| ~Auditor () override=default
| Destructor. More...
StatusCode | sysInitialize () override
| Initialization method invoked by the framework. More...
StatusCode | sysFinalize () override
| Finalization method invoked by the framework. More...
void | before (StandardEventType, INamedInterface *) override
| The following methods are meant to be implemented by the child class... More...
void | before (StandardEventType, const std::string &) override
void | before (CustomEventTypeRef, INamedInterface *) override
void | before (CustomEventTypeRef, const std::string &) override
void | after (StandardEventType, INamedInterface *, const StatusCode &) override
void | after (StandardEventType, const std::string &, const StatusCode &) override
void | after (CustomEventTypeRef, INamedInterface *, const StatusCode &) override
void | after (CustomEventTypeRef, const std::string &, const StatusCode &) override
void | beforeInitialize (INamedInterface *) override
void | afterInitialize (INamedInterface *) override
void | beforeReinitialize (INamedInterface *) override
void | afterReinitialize (INamedInterface *) override
void | beforeExecute (INamedInterface *) override
void | afterExecute (INamedInterface *, const StatusCode &) override
void | beforeFinalize (INamedInterface *) override
void | afterFinalize (INamedInterface *) override
void | beforeBeginRun (INamedInterface *) override
void | afterBeginRun (INamedInterface *) override
void | beforeEndRun (INamedInterface *) override
void | afterEndRun (INamedInterface *) override
virtual StatusCode | initialize ()
virtual StatusCode | finalize ()
const std::string & | name () const override
bool | isEnabled () const override
SmartIF< ISvcLocator > & | serviceLocator () const
| The standard service locator. More...
template<class T >
StatusCode | service (const std::string &name, T *&svc, bool createIf=false) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T = IService>
SmartIF< T > | service (const std::string &name, bool createIf=false) const
StatusCode | setProperty (const Property &p) override
| Set a value of a property of an auditor. More...
StatusCode | setProperty (const std::string &s) override
| Implementation of IProperty::setProperty. More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| Implementation of IProperty::setProperty. More...
StatusCode | getProperty (Property *p) const override
| Get the value of a property. More...
const Property & | getProperty (const std::string &name) const override
| Get the property by name. More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| Implementation of IProperty::getProperty. More...
const std::vector< Property * > & | getProperties () const override
| Get all properties. More...
bool | hasProperty (const std::string &name) const override
| Implementation of IProperty::hasProperty. More...
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | setProperties ()
| Set the auditor's properties. More...
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...

## Private Member Functions
| Auditor (const Auditor &a)
Auditor & | operator= (const Auditor &rhs)

## Private Attributes
std::string | m_name
| Auditor's name for identification. More...
SmartIF< ISvcLocator > | m_pSvcLocator
| Pointer to service locator service. More...
SmartIF< PropertyMgr > | m_PropertyMgr
| For management of properties. More...
int | m_outputLevel
| Auditor output level. More...
bool | m_isEnabled
| Auditor is enabled flag. More...
bool | m_isInitialized
| Auditor has been initialized flag. More...
bool | m_isFinalized
| Auditor has been finalized flag. More...

## Additional Inherited Members
Protected Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Detailed Description

Base class from which all concrete auditor classes should be derived.

The only base class functionality which may be used in the constructor of a concrete auditor is the declaration of member variables as properties. All other functionality, i.e. the use of services, may be used only in initialize() and afterwards.

Author
  David Quarrie

Date
  2000

Author
  Marco Clemencic

Date
  2008-03

Definition at line 35 of file Auditor.h.

## Member Typedef Documentation

typedef Gaudi::PluginService::Factory<IAuditor*, const std::string&, ISvcLocator*> Auditor::Factory

Definition at line 41 of file Auditor.h.

## Constructor & Destructor Documentation

Auditor::Auditor | ( | const std::string & | name,
|  | ISvcLocator * | svcloc
| ) |  |

Constructor.

Parameters

  name | The algorithm object's name
  svcloc | A pointer to a service location service

Definition at line 12 of file Auditor.cpp.

13 : m_name(name),
14 m_pSvcLocator(pSvcLocator),
15 m_PropertyMgr{ new PropertyMgr() },
16 m_isEnabled(true),
17 m_isInitialized(false),
18 m_isFinalized(false)
19 {
20
21 // Declare common Auditor properties with their defaults
22 declareProperty( "OutputLevel", m_outputLevel = MSG::NIL)->declareUpdateHandler([this](Property&) { this->updateMsgStreamOutputLevel(this->m_outputLevel); } );
23 declareProperty( "Enable", m_isEnabled = true);
24 }
Auditor::m_isEnabled
bool m_isEnabled
Auditor is enabled flag.
Definition: Auditor.h:244
Property::declareUpdateHandler
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
PropertyMgr
Property manager helper class.
Definition: PropertyMgr.h:37
Auditor::m_name
std::string m_name
Auditor's name for identification.
Definition: Auditor.h:239
Auditor::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:232
Auditor::m_isInitialized
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:245
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:241
CommonMessaging< implements< IAuditor, IProperty > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:187
MSG::NIL
Definition: IMessageSvc.h:16
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242
Auditor::m_outputLevel
int m_outputLevel
Auditor output level.
Definition: Auditor.h:243
Auditor::m_isFinalized
bool m_isFinalized
Auditor has been finalized flag.
Definition: Auditor.h:246

Auditor::~Auditor | ( |  | ) |
| override default

Destructor.

Auditor::Auditor | ( | const Auditor & | a | ) |
| private

## Member Function Documentation

void Auditor::after | ( | StandardEventType | evt,
|  | INamedInterface * | obj,
|  | const StatusCode & | sc
| ) |  |
| override

Definition at line 107 of file Auditor.cpp.

107 {
108 switch (evt) {
109 case Initialize: afterInitialize(obj); break;
110 case ReInitialize: afterReinitialize(obj); break;
111 case Execute: afterExecute(obj, sc); break;
112 case BeginRun: afterBeginRun(obj); break;
113 case EndRun: afterEndRun(obj); break;
114 case Finalize: afterFinalize(obj); break;
115 case Start: break;
116 case Stop: break;
117 case ReStart: break;
118 default: break ;// do nothing
119 }
120 }
Auditor::afterEndRun
void afterEndRun(INamedInterface *) override
Definition: Auditor.cpp:144
Auditor::afterBeginRun
void afterBeginRun(INamedInterface *) override
Definition: Auditor.cpp:140
Auditor::afterExecute
void afterExecute(INamedInterface *, const StatusCode &) override
Definition: Auditor.cpp:136
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
Auditor::afterInitialize
void afterInitialize(INamedInterface *) override
Definition: Auditor.cpp:128
Auditor::afterFinalize
void afterFinalize(INamedInterface *) override
Definition: Auditor.cpp:148
Auditor::afterReinitialize
void afterReinitialize(INamedInterface *) override
Definition: Auditor.cpp:132

void Auditor::after | ( | StandardEventType | ,
|  | const std::string & | ,
|  | const StatusCode & |
| ) |  |
| override

Definition at line 121 of file Auditor.cpp.

121 {}

void Auditor::after | ( | CustomEventTypeRef | ,
|  | INamedInterface * | ,
|  | const StatusCode & |
| ) |  |
| override

Definition at line 123 of file Auditor.cpp.

123 {}

void Auditor::after | ( | CustomEventTypeRef | ,
|  | const std::string & | ,
|  | const StatusCode & |
| ) |  |
| override

Definition at line 124 of file Auditor.cpp.

124 {}

void Auditor::afterBeginRun | ( | INamedInterface * |  | ) |
| override

Definition at line 140 of file Auditor.cpp.

140 {}

void Auditor::afterEndRun | ( | INamedInterface * |  | ) |
| override

Definition at line 144 of file Auditor.cpp.

144 {}

void Auditor::afterExecute | ( | INamedInterface * | ,
|  | const StatusCode & |
| ) |  |
| override

Definition at line 136 of file Auditor.cpp.

136 {}

void Auditor::afterFinalize | ( | INamedInterface * |  | ) |
| override

Definition at line 148 of file Auditor.cpp.

148 {}

void Auditor::afterInitialize | ( | INamedInterface * |  | ) |
| override

Definition at line 128 of file Auditor.cpp.

128 {}

void Auditor::afterReinitialize | ( | INamedInterface * |  | ) |
| override

Definition at line 132 of file Auditor.cpp.

132 {}

void Auditor::before | ( | StandardEventType | evt,
|  | INamedInterface * | obj
| ) |  |
| override

The following methods are meant to be implemented by the child class...

Definition at line 87 of file Auditor.cpp.

87 {
88 switch (evt) {
89 case Initialize: beforeInitialize(obj); break;
90 case ReInitialize: beforeReinitialize(obj); break;
91 case Execute: beforeExecute(obj); break;
92 case BeginRun: beforeBeginRun(obj); break;
93 case EndRun: beforeEndRun(obj); break;
94 case Finalize: beforeFinalize(obj); break;
95 case Start: break;
96 case Stop: break;
97 case ReStart: break;
98 default: break ;// do nothing
99 }
100 }
Auditor::beforeInitialize
void beforeInitialize(INamedInterface *) override
Definition: Auditor.cpp:126
Auditor::beforeBeginRun
void beforeBeginRun(INamedInterface *) override
Definition: Auditor.cpp:138
Auditor::beforeExecute
void beforeExecute(INamedInterface *) override
Definition: Auditor.cpp:134
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
Auditor::beforeReinitialize
void beforeReinitialize(INamedInterface *) override
Definition: Auditor.cpp:130
Auditor::beforeFinalize
void beforeFinalize(INamedInterface *) override
Definition: Auditor.cpp:146
Auditor::beforeEndRun
void beforeEndRun(INamedInterface *) override
Definition: Auditor.cpp:142

void Auditor::before | ( | StandardEventType | ,
|  | const std::string & |
| ) |  |
| override

Definition at line 101 of file Auditor.cpp.

101 {}

void Auditor::before | ( | CustomEventTypeRef | ,
|  | INamedInterface * |
| ) |  |
| override

Definition at line 103 of file Auditor.cpp.

103 {}

void Auditor::before | ( | CustomEventTypeRef | ,
|  | const std::string & |
| ) |  |
| override

Definition at line 104 of file Auditor.cpp.

104 {}

void Auditor::beforeBeginRun | ( | INamedInterface * |  | ) |
| override

Definition at line 138 of file Auditor.cpp.

138 {}

void Auditor::beforeEndRun | ( | INamedInterface * |  | ) |
| override

Definition at line 142 of file Auditor.cpp.

142 {}

void Auditor::beforeExecute | ( | INamedInterface * |  | ) |
| override

Definition at line 134 of file Auditor.cpp.

134 {}

void Auditor::beforeFinalize | ( | INamedInterface * |  | ) |
| override

Definition at line 146 of file Auditor.cpp.

146 {}

void Auditor::beforeInitialize | ( | INamedInterface * |  | ) |
| override

Definition at line 126 of file Auditor.cpp.

126 {}

void Auditor::beforeReinitialize | ( | INamedInterface * |  | ) |
| override

Definition at line 130 of file Auditor.cpp.

130 {}
template<class T >

Property* Auditor::declareProperty | ( | const std::string & | name,
|  | T & | property,
|  | const std::string & | doc = `"none"`
| ) |  | const
| inline

Declare the named property.

MyAuditor( ... )
: Auditor ( ... )
, m_property1 ( ... )
, m_property2 ( ... )
{
// declare the property
declareProperty( "Property1" , m_property1 , "Doc for property #1" ) ;
// declare the property and attach the handler to it
declareProperty( "Property2" , m_property2 , "Doc for property #2" )
-> declareUpdateHandler( &MyAuditor::handler_2 ) ;
}

See also
  PropertyMgr
  PropertyMgr::declareProperty

Parameters

  name | the property name
  property | the property itself,
  doc | the documentation string

Returns
  the actual property objects

Definition at line 232 of file Auditor.h.

233 {
234 return m_PropertyMgr->declareProperty(name, property, doc);
235 }
PropertyMgr::declareProperty
Property * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
Definition: PropertyMgr.h:186
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242

StatusCode Auditor::finalize | ( |  | ) |
| virtual

Reimplemented in PerfMonAuditor, Google::AuditorBase, TimingAuditor, AlgContextAuditor, and AlgErrorAuditor.

Definition at line 198 of file Auditor.cpp.

198 {
199 return StatusCode::SUCCESS;
200 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

const std::vector< Property * > & Auditor::getProperties | ( |  | ) | const
| override

Get all properties.

Definition at line 245 of file Auditor.cpp.

245 {
246 return m_PropertyMgr->getProperties();
247 }
PropertyMgr::getProperties
const std::vector< Property * > & getProperties() const override
get all properties
Definition: PropertyMgr.cpp:186
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242

StatusCode Auditor::getProperty | ( | Property * | p | ) | const
| override

Get the value of a property.

Definition at line 236 of file Auditor.cpp.

236 {
237 return m_PropertyMgr->getProperty(p);
238 }
PropertyMgr::getProperty
StatusCode getProperty(Property *p) const override
get the property
Definition: PropertyMgr.cpp:144
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242

const Property & Auditor::getProperty | ( | const std::string & | name | ) | const
| override

Get the property by name.

Definition at line 239 of file Auditor.cpp.

239 {
240 return m_PropertyMgr->getProperty(name);
241 }
PropertyMgr::getProperty
StatusCode getProperty(Property *p) const override
get the property
Definition: PropertyMgr.cpp:144
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242

StatusCode Auditor::getProperty | ( | const std::string & | n,
|  | std::string & | v
| ) |  | const
| override

Implementation of IProperty::getProperty.

Definition at line 242 of file Auditor.cpp.

242 {
243 return m_PropertyMgr->getProperty(n,v);
244 }
PropertyMgr::getProperty
StatusCode getProperty(Property *p) const override
get the property
Definition: PropertyMgr.cpp:144
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242

bool Auditor::hasProperty | ( | const std::string & | name | ) | const
| override

Implementation of IProperty::hasProperty.

Definition at line 248 of file Auditor.cpp.

248 {
249 return m_PropertyMgr->hasProperty(name);
250 }
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242
PropertyMgr::hasProperty
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
Definition: PropertyMgr.cpp:201

StatusCode Auditor::initialize | ( |  | ) |
| virtual

Reimplemented in Google::HeapChecker, PerfMonAuditor, Google::AuditorBase, TimingAuditor, AlgContextAuditor, IntelProfilerAuditor, AlgErrorAuditor, ChronoAuditor, and MemStatAuditor.

Definition at line 82 of file Auditor.cpp.

82 {
83 return StatusCode::SUCCESS;
84 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

bool Auditor::isEnabled | ( |  | ) | const
| override

Definition at line 206 of file Auditor.cpp.

206 {
207 return m_isEnabled;
208 }
Auditor::m_isEnabled
bool m_isEnabled
Auditor is enabled flag.
Definition: Auditor.h:244

const std::string & Auditor::name | ( |  | ) | const
| override

Definition at line 202 of file Auditor.cpp.

202 {
203 return m_name;
204 }
Auditor::m_name
std::string m_name
Auditor's name for identification.
Definition: Auditor.h:239

Auditor& Auditor::operator= | ( | const Auditor & | rhs | ) |
| private

template<class T >

StatusCode Auditor::service | ( | const std::string & | name,
|  | T *& | svc,
|  | bool | createIf = `false`
| ) |  | const
| inline

Access a service by name, creating it if it doesn't already exist.

Definition at line 110 of file Auditor.h.

110 {
111 auto ptr = serviceLocator()->service<T>(name, createIf);
112 if (ptr) {
113 svc = ptr.get();
114 svc->addRef();
115 return StatusCode::SUCCESS;
116 }
117 svc = nullptr;
118 return StatusCode::FAILURE;
119 }
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:211
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
template<class T = IService>

SmartIF<T> Auditor::service | ( | const std::string & | name,
|  | bool | createIf = `false`
| ) |  | const
| inline

Definition at line 122 of file Auditor.h.

122 {
123 return serviceLocator()->service<T>(name, createIf);
124 }
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:211
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202

SmartIF< ISvcLocator > & Auditor::serviceLocator | ( |  | ) | const

The standard service locator.

Returns a pointer to the service locator service. This service may be used by an auditor to request any services it requires in addition to those provided by default.

Definition at line 211 of file Auditor.cpp.

211 {
212 return m_pSvcLocator;
213 }
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:241

StatusCode Auditor::setProperties | ( |  | ) |

Set the auditor's properties.

This method requests the job options service to set the values of any declared properties. The method is invoked from within sysInitialize() by the framework and does not need to be explicitly called by a concrete auditor.

Definition at line 216 of file Auditor.cpp.

216 {
217 if( !m_pSvcLocator ) return StatusCode::FAILURE;
218 auto jos = service<IJobOptionsSvc>("JobOptionsSvc");
219 if( !jos ) return StatusCode::FAILURE;
220 jos->setMyProperties( name(), this ).ignore();
221 updateMsgStreamOutputLevel( m_outputLevel );
222 return StatusCode::SUCCESS;
223 }
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:241
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
CommonMessaging< implements< IAuditor, IProperty > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:187
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
Auditor::m_outputLevel
int m_outputLevel
Auditor output level.
Definition: Auditor.h:243

StatusCode Auditor::setProperty | ( | const Property & | p | ) |
| override

Set a value of a property of an auditor.

Definition at line 227 of file Auditor.cpp.

227 {
228 return m_PropertyMgr->setProperty(p);
229 }
PropertyMgr::setProperty
StatusCode setProperty(const Property &p) override
set the property form another property
Definition: PropertyMgr.cpp:105
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242

StatusCode Auditor::setProperty | ( | const std::string & | s | ) |
| override

Implementation of IProperty::setProperty.

Definition at line 230 of file Auditor.cpp.

230 {
231 return m_PropertyMgr->setProperty(s);
232 }
PropertyMgr::setProperty
StatusCode setProperty(const Property &p) override
set the property form another property
Definition: PropertyMgr.cpp:105
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242

StatusCode Auditor::setProperty | ( | const std::string & | n,
|  | const std::string & | v
| ) |  |
| override

Implementation of IProperty::setProperty.

Definition at line 233 of file Auditor.cpp.

233 {
234 return m_PropertyMgr->setProperty(n,v);
235 }
PropertyMgr::setProperty
StatusCode setProperty(const Property &p) override
set the property form another property
Definition: PropertyMgr.cpp:105
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242
template<class TYPE >

StatusCode Auditor::setProperty | ( | const std::string & | name,
|  | const TYPE & | value
| ) |  |
| inline

set the property form the value

std::vector<double> data = ... ;
setProperty( "Data" , data ) ;
std::map<std::string,double> cuts = ... ;
setProperty( "Cuts" , cuts ) ;
std::map<std::string,std::string> dict = ... ;
setProperty( "Dictionary" , dict ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

This is very convenient in resetting of the default properties in the derived classes. E.g. without this method one needs to convert everything into strings to use IProperty::setProperty

setProperty ( "OutputLevel" , "1" ) ;
setProperty ( "Enable" , "True" ) ;
setProperty ( "ErrorMax" , "10" ) ;

For simple cases it is more or less ok, but for complicated properties it is just ugly..

Parameters

  name | name of the property
  value | value of the property

See also
  Gaudi::Utils::setProperty

Author
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2007-05-13

Definition at line 192 of file Auditor.h.

194 { return Gaudi::Utils::setProperty ( m_PropertyMgr.get() , name , value ) ; }
Gaudi::Utils::setProperty
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1187
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
Auditor::m_PropertyMgr
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
Definition: Auditor.h:242
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202

StatusCode Auditor::sysFinalize | ( |  | ) |
| override

Finalization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

RETURN !!!

catch GaudiExeption

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

catch std::exception

(1) perform the printout of message

(2) print the exception itself

catch unknown exception

(1) perform the printout

Definition at line 150 of file Auditor.cpp.

150 {
151 StatusCode sc = StatusCode::SUCCESS;
152 try{
153 //
154 // Invoke the finalize() method of the derived class if
155 // it has been initialized.
156 if ( m_isInitialized && ! m_isFinalized ) {
157 m_isFinalized = true;
158 sc = finalize();
159 if( !sc.isSuccess() ) return StatusCode::FAILURE;
160 }
161 return sc;
162 //
163 }
164 catch( const GaudiException& Exception )
165 {
167 MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
168 log << MSG::FATAL
169 << " Exception with tag=" << Exception.tag() << " is catched " << endmsg;
172 MsgStream logEx ( msgSvc() , Exception.tag() );
173 logEx << MSG::ERROR
174 << Exception << endmsg;
175 }
176 catch( const std::exception& Exception )
177 {
179 MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
180 log << MSG::FATAL
181 << " Standard std::exception is caught " << endmsg;
183 MsgStream logEx ( msgSvc() , name() + "*std::exception*" );
184 logEx << MSG::ERROR
185 << Exception.what() << endmsg;
186 }
187 catch( ... )
188 {
190 MsgStream log ( msgSvc() , name() + ".sysFinalize()" );
191 log << MSG::FATAL
192 << " UNKNOWN Exception is caught " << endmsg;
193 }
195 return StatusCode::FAILURE ;
196 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Auditor::finalize
virtual StatusCode finalize()
Definition: Auditor.cpp:198
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
MSG::FATAL
Definition: IMessageSvc.h:22
Auditor::m_isInitialized
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:245
StatusCode::FAILURE
Definition: StatusCode.h:29
std::exception::what
T what(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
std::exception
STL class.
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
MSG::ERROR
Definition: IMessageSvc.h:21
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Auditor::m_isFinalized
bool m_isFinalized
Auditor has been finalized flag.
Definition: Auditor.h:246

StatusCode Auditor::sysInitialize | ( |  | ) |
| override

Initialization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

RETURN !!!

catch Gaudi Exception

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

catch std::exception

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

(1) perform the printout

Definition at line 28 of file Auditor.cpp.

28 {
29 StatusCode sc;
30
31 // Bypass the initialization if the auditor is disabled or
32 // has already been initialized.
33 if ( isEnabled( ) && ! m_isInitialized ) {
34
35 // Setup the default service ... this should be upgraded so as to be configurable.
36 if( !m_pSvcLocator )
37 return StatusCode::FAILURE;
38
39 // Set the Auditor's properties
40 sc = setProperties();
41 if( !sc.isSuccess() ) return StatusCode::FAILURE;
42
43 {
44 try{
45 // Invoke the initialize() method of the derived class
46 sc = initialize();
47 if( !sc.isSuccess() ) return StatusCode::FAILURE;
48 m_isInitialized = true;
49
50 return sc;
51 }
52 catch ( const GaudiException& Exception )
53 {
55 MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
56 log << MSG::FATAL << " Exception with tag=" << Exception.tag() << " is caught " << endmsg;
58 MsgStream logEx ( msgSvc() , Exception.tag() );
59 logEx << MSG::ERROR << Exception << endmsg;
60 }
61 catch( const std::exception& Exception )
62 {
64 MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
65 log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
67 MsgStream logEx ( msgSvc() , name() + "*std::exception*" );
68 logEx << MSG::ERROR << Exception.what() << endmsg;
69 }
70 catch(...)
71 {
73 MsgStream log ( msgSvc() , name() + ".sysInitialize()" );
74 log << MSG::FATAL << " UNKNOWN Exception is caught " << endmsg;
75 }
76 }
77 }
79 return StatusCode::FAILURE;
80 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
Auditor::setProperties
StatusCode setProperties()
Set the auditor's properties.
Definition: Auditor.cpp:216
merge_files.sc
int sc
Definition: merge_files.py:167
MSG::FATAL
Definition: IMessageSvc.h:22
Auditor::m_isInitialized
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:245
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:241
StatusCode::FAILURE
Definition: StatusCode.h:29
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
std::exception
STL class.
Auditor::isEnabled
bool isEnabled() const override
Definition: Auditor.cpp:206
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
MSG::ERROR
Definition: IMessageSvc.h:21
Auditor::initialize
virtual StatusCode initialize()
Definition: Auditor.cpp:82
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

## Member Data Documentation

bool Auditor::m_isEnabled
| private

Auditor is enabled flag.

Definition at line 244 of file Auditor.h.

bool Auditor::m_isFinalized
| private

Auditor has been finalized flag.

Definition at line 246 of file Auditor.h.

bool Auditor::m_isInitialized
| private

Auditor has been initialized flag.

Definition at line 245 of file Auditor.h.

std::string Auditor::m_name
| private

Auditor's name for identification.

Definition at line 239 of file Auditor.h.

int Auditor::m_outputLevel
| private

Auditor output level.

Definition at line 243 of file Auditor.h.

SmartIF<PropertyMgr> Auditor::m_PropertyMgr
| private

For management of properties.

Definition at line 242 of file Auditor.h.

SmartIF<ISvcLocator> Auditor::m_pSvcLocator
| mutable private

Pointer to service locator service.

Definition at line 241 of file Auditor.h.

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

- GaudiKernel/GaudiKernel/Auditor.h
- GaudiKernel/src/Lib/Auditor.cpp