13 #ifndef DD4HEP_GEOMETRY_CONDITIONDERIVED_H
14 #define DD4HEP_GEOMETRY_CONDITIONDERIVED_H
28 namespace Conditions {
30 class ConditionManager;
31 class ConditionResolver;
32 class ConditionDependency;
33 class ConditionUpdateCall;
48 virtual Condition get(
unsigned int key)
const = 0;
81 template<
typename Q> Q*
param()
const {
88 T& data = cond.
get<
T>();
93 throw std::runtime_error(
"ConditionUpdateCall: Failed to access non-existing item:"+key_value.name);
96 template<
typename T>
const T&
get(
const ConditionKey& key_value)
const {
99 const T& data = cond.
get<
T>();
104 throw std::runtime_error(
"ConditionUpdateCall: Failed to access non-existing item:"+key_value.name);
107 template<
typename T>
T&
get(
size_t key_id) {
109 return this->get<T>(key_value);
112 template<
typename T>
const T&
get(
size_t key_id)
const {
114 return this->get<T>(key_value);
226 : resolver(resolv), dependency(dep), iov(&iov_ref), parameter(user_param)
239 throw std::runtime_error(
"ConditionUpdateCall: Failed to access non-existing condition:"+key_value.
name);
Condition dependency builder.
const ConditionResolver & resolver
Q * param() const
Access user parameter.
int m_refCount
Reference count.
ConditionDependency & operator=(const ConditionDependency &c)
Assignment operator.
virtual Condition operator()(const ConditionKey &target, const Context &ctxt)=0
Interface to client Callback in order to update the condition.
bool isValid() const
Check the validity of the object held by the handle.
T & get()
Generic getter. Specify the exact type, not a polymorph type.
ConditionResolver class used by the derived conditions calculation mechanism.
int m_refCount
Reference count.
void release()
Release object. May not be used any longer.
Condition::iov_type * iov
Condition condition(size_t which) const
Access to condition object by dependency index.
Main condition object handle.
unsigned int key_type
Forward definition of the key type.
virtual Condition get(const ConditionKey &key) const =0
Interface to access conditions by conditions key.
void iov_intersection(const IOV &comparator)
Set the intersection of this IOV with the argument IOV.
ConditionUpdateContext Context
const ConditionDependency & dependency
Condition dependency definition.
Geometry::DetElement DetElement
Key definition to optimize ans simplyfy the access to conditions entities.
key_type key() const
Access the dependency key.
Class describing the interval of validty.
virtual Geometry::LCDD & lcdd() const =0
Access to the detector description instance.
ConditionUpdateCall * callback
Reference to the update callback. No auto pointer. callback may be shared.
ConditionUpdateContext class used by the derived conditions calculation mechanism.
ConditionDependency()
Default constructor.
ConditionDependency * release()
Release the created dependency and take ownership.
void add(const ConditionKey &source)
Add a new dependency.
virtual const IOV & requiredValidity() const =0
Required IOV value for update cycle.
DetElement detector
Reference to the target's detector element.
Dependencies dependencies
Dependency keys this condition depends on.
const iov_type & iov() const
Access the IOV block.
const ConditionKey & key(size_t which) const
Access to dependency keys.
virtual Ref_t manager() const =0
Access to the conditions manager.
ConditionUpdateCall()
Standard destructor.
std::string name
String representation of the key object.
ConditionUpdateCall * addRef()
Add use count to the object.
ConditionDependency * addRef()
Add use count to the object.
std::vector< ConditionKey > Dependencies
Defintion of the depencency container.
Handle class describing a detector element.
ConditionDependency * operator->()
Access underlying object directly.
key_type hash
Hashed key representation.
virtual ~ConditionDependency()
Default destructor.
virtual ~ConditionResolver()
Standard destructor.
The main interface to the DD4hep detector description package.
virtual ~ConditionUpdateCall()
Standard destructor.
ConditionUpdateContext(const ConditionResolver &r, const ConditionDependency &d, void *parameter, Condition::iov_type &iov)
Initializing constructor.
ConditionKey target
Key to the condition to be updated.
DependencyBuilder(const ConditionKey &target, ConditionUpdateCall *call)
Initializing constructor.
virtual ~DependencyBuilder()
Default destructor.
Condition::key_type key_type
Forward definition of the key type.
void release()
Release object. May not be used any longer.
ConditionDependency * m_dependency
The created dependency.