File indexing completed on 2025-01-18 09:13:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DDCond/ConditionsPool.h>
0016 #include <DDCond/ConditionsManagerObject.h>
0017 #include <DD4hep/Printout.h>
0018 #include <DD4hep/InstanceCount.h>
0019 #include <DD4hep/detail/Handle.inl>
0020 #include <DD4hep/ConditionsPrinter.h>
0021 #include <DD4hep/detail/ConditionsInterna.h>
0022
0023 using namespace dd4hep::cond;
0024
0025 DD4HEP_INSTANTIATE_HANDLE_NAMED(UpdatePool);
0026 DD4HEP_INSTANTIATE_HANDLE_NAMED(ConditionsPool);
0027
0028
0029 ConditionsPool::ConditionsPool(ConditionsManager mgr, IOV* i)
0030 : NamedObject(), m_manager(mgr), iov(i), age_value(AGE_NONE)
0031 {
0032 InstanceCount::increment(this);
0033 }
0034
0035
0036 ConditionsPool::~ConditionsPool() {
0037
0038 InstanceCount::decrement(this);
0039 }
0040
0041
0042 void ConditionsPool::print() const {
0043 printout(INFO,"ConditionsPool","+++ Conditions for pool with IOV: %-32s age:%3d [%4d entries]",
0044 GetName(), age_value, size());
0045 }
0046
0047
0048 void ConditionsPool::print(const std::string& opt) const {
0049 printout(INFO,"ConditionsPool","+++ %s Conditions for pool with IOV: %-32s age:%3d [%4d entries]",
0050 opt.c_str(), GetName(), age_value, size());
0051 if ( opt == "*" || opt == "ALL" ) {
0052 ConditionsPrinter printer(0);
0053 RangeConditions range;
0054 printer.summary = false;
0055 printer.lineLength = 132;
0056 const_cast<ConditionsPool*>(this)->select_all(range);
0057 for( auto c : range )
0058 printer(c);
0059 }
0060 }
0061
0062
0063 void ConditionsPool::onRegister(Condition condition) {
0064 m_manager.ptr()->onRegister(condition);
0065 }
0066
0067
0068 void ConditionsPool::onRemove(Condition condition) {
0069 m_manager.ptr()->onRemove(condition);
0070 }
0071
0072
0073 UpdatePool::UpdatePool(ConditionsManager mgr, IOV* i) : ConditionsPool(mgr, i)
0074 {
0075 }
0076
0077
0078 UpdatePool::~UpdatePool() {
0079 }
0080
0081
0082 UserPool::UserPool(ConditionsManager mgr)
0083 : m_iov(0), m_manager(mgr)
0084 {
0085 InstanceCount::increment(this);
0086 }
0087
0088
0089 UserPool::~UserPool() {
0090 InstanceCount::decrement(this);
0091 }