DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConditionsPool.cpp
Go to the documentation of this file.
1 // $Id$
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 
15 // Framework include files
16 #include "DD4hep/Handle.inl"
17 #include "DD4hep/Printout.h"
18 #include "DD4hep/InstanceCount.h"
19 #include "DDCond/ConditionsPool.h"
21 
22 using std::string;
23 using namespace DD4hep;
24 using namespace DD4hep::Conditions;
25 
27 
30  : NamedObject(), m_manager(mgr), iovType(0), iov(0), age_value(AGE_NONE)
31 {
33 }
34 
37  // Should, but cannot clear here, since clear is a virtual overload.
39 }
40 
42 void ConditionsPool::print(const string& opt) const {
43  printout(INFO,"ConditionsPool","+++ %s Conditions for pool with IOV: %-32s age:%3d [%4d entries]",
44  opt.c_str(), iov->str().c_str(), age_value, count());
45 }
46 
49  m_manager.ptr()->onRegister(condition);
50 }
51 
54  m_manager.ptr()->onRemove(condition);
55 }
56 
59 {
60 }
61 
64 }
65 
68  : m_iov(0), m_manager(mgr), m_iovPool(pool)
69 {
71 }
72 
76 }
void print(const std::string &opt) const
Print pool basics.
virtual ~UpdatePool()
Default destructor.
ConditionsManager m_manager
Handle to conditions manager object.
DD4HEP_INSTANTIATE_HANDLE_NAMED(ConditionsPool)
UpdatePool(ConditionsManager mgr)
Default constructor.
ConditionsPool(ConditionsManager mgr)
Default constructor.
static void decrement(T *)
Decrement count according to type information.
Main condition object handle.
Definition: Conditions.h:70
void onRemove(Condition condition)
Listener invocation when a condition is deregistered from the cache.
void onRegister(Condition condition)
Listener invocation when a condition is registered to the cache.
T * ptr() const
Access to the held object.
Definition: Handle.h:149
virtual ~UserPool()
Default destructor.
Implementation of a named object.
Definition: NamedObject.h:31
Manager class for condition handles.
void onRegister(Condition condition)
Listener invocation when a condition is registered to the cache.
IOV * iov
The IOV of the conditions hosted.
Class implementing the conditions collection for a given IOV type.
static void increment(T *)
Increment count according to type information.
Definition: InstanceCount.h:98
virtual ~ConditionsPool()
Default destructor. Note: pool must be cleared by the subclass!
Pool of conditions satisfying one IOV type (epoch, run, fill, etc)
UserPool(ConditionsManager mgr, ConditionsIOVPool *pool)
Default constructor.
void onRemove(Condition condition)
Listener invocation when a condition is deregistered from the cache.
int printout(PrintLevel severity, const char *src, const char *fmt,...)
Calls the display action with a given severity level.
Definition: Printout.cpp:111
virtual size_t count() const =0
Total entry count.
std::string str() const
Create string representation of the IOV.
Definition: IOV.cpp:126