DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
ConditionsPool.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 // Framework include files
15 #include <DDCond/ConditionsPool.h>
17 #include <DD4hep/Printout.h>
18 #include <DD4hep/InstanceCount.h>
19 #include <DD4hep/detail/Handle.inl>
22 
23 using namespace dd4hep::cond;
24 
27 
30  : NamedObject(), m_manager(mgr), iov(i), 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 {
43  printout(INFO,"ConditionsPool","+++ Conditions for pool with IOV: %-32s age:%3d [%4d entries]",
44  GetName(), age_value, size());
45 }
46 
48 void ConditionsPool::print(const std::string& opt) const {
49  printout(INFO,"ConditionsPool","+++ %s Conditions for pool with IOV: %-32s age:%3d [%4d entries]",
50  opt.c_str(), GetName(), age_value, size());
51  if ( opt == "*" || opt == "ALL" ) {
52  ConditionsPrinter printer(0);
53  RangeConditions range;
54  printer.summary = false;
55  printer.lineLength = 132;
56  const_cast<ConditionsPool*>(this)->select_all(range);
57  for( auto c : range )
58  printer(c);
59  }
60 }
61 
64  m_manager.ptr()->onRegister(condition);
65 }
66 
69  m_manager.ptr()->onRemove(condition);
70 }
71 
74 {
75 }
76 
79 }
80 
83  : m_iov(0), m_manager(mgr)
84 {
86 }
87 
91 }
dd4hep::RangeConditions
std::vector< Condition > RangeConditions
Definition: Conditions.h:491
dd4hep::cond::ConditionsPool::age_value
int age_value
Aging value.
Definition: ConditionsPool.h:67
ConditionsInterna.h
dd4hep::NamedObject::GetName
const char * GetName() const
Access name.
Definition: NamedObject.h:58
dd4hep::cond::ConditionsPool::onRegister
void onRegister(Condition condition)
Listener invocation when a condition is registered to the cache.
Definition: ConditionsPool.cpp:63
dd4hep::InstanceCount::increment
static void increment(T *)
Increment count according to type information.
Definition: InstanceCount.h:98
dd4hep::cond::ConditionsPrinter::lineLength
size_t lineLength
Line length.
Definition: ConditionsPrinter.h:62
ConditionsManagerObject.h
dd4hep::Condition
Main condition object handle.
Definition: Conditions.h:51
dd4hep::cond::ConditionsPool::select_all
virtual size_t select_all(RangeConditions &result)=0
Select all conditions contained.
dd4hep::cond::ConditionsPool::~ConditionsPool
virtual ~ConditionsPool()
Default destructor. Note: pool must be cleared by the subclass!
Definition: ConditionsPool.cpp:36
dd4hep::cond
Namespace for implementation details of the AIDA detector description toolkit.
Definition: ConditionsCleanup.h:23
dd4hep::IOV
Class describing the interval of validty.
Definition: IOV.h:67
dd4hep::cond::UserPool::UserPool
UserPool(ConditionsManager mgr)
Default constructor.
Definition: ConditionsPool.cpp:82
ConditionsPrinter.h
dd4hep::cond::ConditionsPool
Class implementing the conditions collection for a given IOV type.
Definition: ConditionsPool.h:54
dd4hep::cond::ConditionsManagerObject::onRegister
void onRegister(Condition condition)
Listener invocation when a condition is registered to the cache.
Definition: ConditionsManager.cpp:82
dd4hep::InstanceCount::decrement
static void decrement(T *)
Decrement count according to type information.
Definition: InstanceCount.h:102
dd4hep::cond::ConditionsPrinter::summary
bool summary
Flag to print summary.
Definition: ConditionsPrinter.h:70
dd4hep::cond::ConditionsPool::print
void print() const
Print pool basics.
Definition: ConditionsPool.cpp:42
dd4hep::cond::ConditionsPool::size
virtual size_t size() const =0
Total entry count.
dd4hep::cond::ConditionsPool::onRemove
void onRemove(Condition condition)
Listener invocation when a condition is deregistered from the cache.
Definition: ConditionsPool.cpp:68
dd4hep::cond::UpdatePool::~UpdatePool
virtual ~UpdatePool()
Default destructor.
Definition: ConditionsPool.cpp:78
dd4hep::cond::ConditionsManager
Manager class for condition handles.
Definition: ConditionsManager.h:46
dd4hep::cond::ConditionsPool::m_manager
ConditionsManager m_manager
Handle to conditions manager object.
Definition: ConditionsPool.h:57
dd4hep::Handle::ptr
T * ptr() const
Access to the held object.
Definition: Handle.h:153
DD4HEP_INSTANTIATE_HANDLE_NAMED
DD4HEP_INSTANTIATE_HANDLE_NAMED(UpdatePool)
dd4hep::NamedObject
Implementation of a named object.
Definition: NamedObject.h:30
dd4hep::cond::ConditionsManagerObject::onRemove
void onRemove(Condition condition)
Listener invocation when a condition is deregistered from the cache.
Definition: ConditionsManager.cpp:88
dd4hep::cond::UpdatePool::UpdatePool
UpdatePool(ConditionsManager mgr, IOV *iov)
Default constructor.
Definition: ConditionsPool.cpp:73
ConditionsPool.h
dd4hep::cond::UserPool::~UserPool
virtual ~UserPool()
Default destructor.
Definition: ConditionsPool.cpp:89
dd4hep::cond::UpdatePool
Interface for conditions pool optimized to host conditions updates.
Definition: ConditionsPool.h:109
InstanceCount.h
Printout.h
dd4hep::cond::ConditionsPrinter
Generic Conditions data dumper.
Definition: ConditionsPrinter.h:38
dd4hep::cond::ConditionsPool::ConditionsPool
ConditionsPool(ConditionsManager mgr, IOV *iov)
Default constructor.
Definition: ConditionsPool.cpp:29