ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Athena::ConditionsCleanerSvc Class Reference

Facade class for conditions garbage collection. More...

#include <ConditionsCleanerSvc.h>

Inheritance diagram for Athena::ConditionsCleanerSvc:
Collaboration diagram for Athena::ConditionsCleanerSvc:

Public Member Functions

 ConditionsCleanerSvc (const std::string &name, ISvcLocator *svc)
 Standard Gaudi constructor. More...
 
virtual StatusCode initialize () override
 Standard Gaudi initialize method. More...
 
virtual StatusCode event (const EventContext &ctx, bool allowAsync) override
 Called at the start of each event. More...
 
virtual StatusCode condObjAdded (const EventContext &ctx, CondContBase &cc) override
 Called after a conditions object has been added. More...
 
virtual StatusCode printStats () const override
 Print some statistics about the garbage collection. More...
 
virtual StatusCode reset () override
 Clear the internal state of the service. More...
 

Private Attributes

ServiceHandle< Athena::IConditionsCleanerSvcm_cleanerSvc
 

Detailed Description

Facade class for conditions garbage collection.

This forwards calls to IConditionsCleanerSvc to the service that actually implements it. Done like this so that we need only specify the concrete class in one place. The concrete service may be left unspecified, in which case no garbage collection will be done.

Definition at line 35 of file ConditionsCleanerSvc.h.

Constructor & Destructor Documentation

◆ ConditionsCleanerSvc()

Athena::ConditionsCleanerSvc::ConditionsCleanerSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Standard Gaudi constructor.

Parameters
nameService name.
svcService locator.

Definition at line 25 of file ConditionsCleanerSvc.cxx.

27  : base_class (name, svc),
28  m_cleanerSvc ("", name)
29 {
30  declareProperty ("CleanerSvc", m_cleanerSvc,
31  "Service implementing conditions garbage collection. "
32  "If blank, no garbage collection will be done.");
33 }

Member Function Documentation

◆ condObjAdded()

StatusCode Athena::ConditionsCleanerSvc::condObjAdded ( const EventContext &  ctx,
CondContBase cc 
)
overridevirtual

Called after a conditions object has been added.

Parameters
ctxThe current event context.
ccThe container to which the object was added.

Definition at line 70 of file ConditionsCleanerSvc.cxx.

72 {
73  if (!m_cleanerSvc.empty()) {
74  return m_cleanerSvc->condObjAdded (ctx, cc);
75  }
76  return StatusCode::SUCCESS;
77 }

◆ event()

StatusCode Athena::ConditionsCleanerSvc::event ( const EventContext &  ctx,
bool  allowAsync 
)
overridevirtual

Called at the start of each event.

Parameters
ctxThe current event context.
allowAsyncIf true, then cleaning may be run in an asynchronous TBB task.

Definition at line 55 of file ConditionsCleanerSvc.cxx.

57 {
58  if (!m_cleanerSvc.empty()) {
59  return m_cleanerSvc->event (ctx, allowAsync);
60  }
61  return StatusCode::SUCCESS;
62 }

◆ initialize()

StatusCode Athena::ConditionsCleanerSvc::initialize ( )
overridevirtual

Standard Gaudi initialize method.

Definition at line 39 of file ConditionsCleanerSvc.cxx.

40 {
41  if (!m_cleanerSvc.empty()) {
42  ATH_CHECK( m_cleanerSvc.retrieve() );
43  }
44  return StatusCode::SUCCESS;
45 }

◆ printStats()

StatusCode Athena::ConditionsCleanerSvc::printStats ( ) const
overridevirtual

Print some statistics about the garbage collection.

Would generally be called in finalize(), but broken out as a separate interface for testing/debugging purposes.

Definition at line 85 of file ConditionsCleanerSvc.cxx.

86 {
87  if (!m_cleanerSvc.empty()) {
88  return m_cleanerSvc->printStats();
89  }
90  return StatusCode::SUCCESS;
91 }

◆ reset()

StatusCode Athena::ConditionsCleanerSvc::reset ( )
overridevirtual

Clear the internal state of the service.

Only for testing. Don't call if any other thread may be touching the service.

Definition at line 98 of file ConditionsCleanerSvc.cxx.

99 {
100  if (!m_cleanerSvc.empty()) {
101  return m_cleanerSvc->reset();
102  }
103  return StatusCode::SUCCESS;
104 }

Member Data Documentation

◆ m_cleanerSvc

ServiceHandle<Athena::IConditionsCleanerSvc> Athena::ConditionsCleanerSvc::m_cleanerSvc
private

Definition at line 88 of file ConditionsCleanerSvc.h.


The documentation for this class was generated from the following files:
Athena::ConditionsCleanerSvc::m_cleanerSvc
ServiceHandle< Athena::IConditionsCleanerSvc > m_cleanerSvc
Definition: ConditionsCleanerSvc.h:88
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.handimod.cc
int cc
Definition: handimod.py:523