DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
ConditionsInterna.h
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 // NOTE:
15 //
16 // This is an internal include file. It should only be included to
17 // instantiate code. Otherwise the Conditions include file should be
18 // sufficient for all practical purposes.
19 //
20 //==========================================================================
21 #ifndef DD4HEP_DETAIL_CONDITIONSINTERNA_H
22 #define DD4HEP_DETAIL_CONDITIONSINTERNA_H
23 
24 // Framework include files
25 #include <DD4hep/DetElement.h>
26 #include <DD4hep/Conditions.h>
27 #include <DD4hep/Grammar.h>
28 #include <DD4hep/NamedObject.h>
29 
30 // C/C++ include files
31 #include <map>
32 
33 
35 namespace dd4hep {
36 
37  // Forward declarations
38  class IOVType;
39 
41 
48  namespace detail {
49 
51 
65 #if defined(DD4HEP_CONDITIONS_HAVE_NAME)
66  : public NamedObject
67 #endif
68  {
69  public:
71  std::string value;
72 #if defined(DD4HEP_CONDITIONS_DEBUG) || !defined(DD4HEP_MINIMAL_CONDITIONS)
73  std::string validity;
76  std::string address;
78  std::string comment;
79 #endif
83  const IOV* iov = 0;
89  int refCount = 1;
93  ConditionObject(const ConditionObject&) = delete;
94  // No move constructor
97  ConditionObject(const std::string& nam,const std::string& tit="");
99  virtual ~ConditionObject();
105  ConditionObject* addRef() { ++refCount; return this; }
107  void release();
109  static size_t offset();
113  const IOV* iovData() const;
115  const IOVType* iovType() const;
117  void* payload() const;
119  bool is_bound() const { return data.is_bound(); }
120  bool is_traced() const { return true; }
122  void setFlag(Condition::mask_type option) { flags |= option; }
124  void unFlag(Condition::mask_type option) { flags &= ~option; }
126  bool testFlag(Condition::mask_type option) const { return option == (flags&option);}
127  };
128 
129  } /* End namespace detail */
130 } /* End namespace dd4hep */
131 #endif // DD4HEP_DETAIL_CONDITIONSINTERNA_H
dd4hep::detail::ConditionObject::value
std::string value
Condition value (in string form)
Definition: ConditionsInterna.h:71
dd4hep::detail::ConditionObject::is_bound
bool is_bound() const
Check if object is already bound....
Definition: ConditionsInterna.h:119
dd4hep::detail::ConditionObject::payload
void * payload() const
Access the bound data payload. Exception id object is unbound.
Definition: ConditionsInterna.cpp:75
dd4hep::detail::ConditionObject::hash
Condition::key_type hash
Hash value of the name.
Definition: ConditionsInterna.h:85
dd4hep::detail::ConditionObject::operator=
ConditionObject & operator=(const ConditionObject &)=delete
No assignment operation.
dd4hep::detail::ConditionObject::flags
Condition::mask_type flags
Flags.
Definition: ConditionsInterna.h:87
dd4hep::OpaqueDataBlock
Class describing an opaque conditions data block.
Definition: OpaqueData.h:92
dd4hep::detail::ConditionObject::address
std::string address
Condition address.
Definition: ConditionsInterna.h:76
dd4hep::detail::ConditionObject::addRef
ConditionObject * addRef()
Increase reference counter (Used by persistency mechanism)
Definition: ConditionsInterna.h:105
dd4hep::detail::ConditionObject::is_traced
bool is_traced() const
Definition: ConditionsInterna.h:120
dd4hep::OpaqueData::is_bound
bool is_bound() const
Check if object is already bound....
Definition: OpaqueData.h:71
dd4hep::IOVType
Class describing the interval of validty type.
Definition: IOV.h:37
dd4hep::detail::ConditionObject::unFlag
void unFlag(Condition::mask_type option)
Flag operations: UN-Set a conditons flag.
Definition: ConditionsInterna.h:124
dd4hep::detail::ConditionObject::~ConditionObject
virtual ~ConditionObject()
Standard Destructor.
Definition: ConditionsInterna.cpp:58
dd4hep::IOV
Class describing the interval of validty.
Definition: IOV.h:67
dd4hep::detail::ConditionObject::ConditionObject
ConditionObject()
Default constructor.
Definition: ConditionsInterna.cpp:40
dd4hep::detail::ConditionObject::ConditionObject
ConditionObject(ConditionObject &&)=delete
dd4hep::detail::ConditionObject::iovType
const IOVType * iovType() const
Access safely the IOV-type.
Definition: ConditionsInterna.cpp:92
dd4hep::detail::ConditionObject::move
ConditionObject & move(ConditionObject &from)
Move data content: 'from' will be reset to NULL.
Definition: ConditionsInterna.cpp:80
dd4hep::detail::ConditionObject::release
void release()
Release object (Used by persistency mechanism)
Definition: ConditionsInterna.cpp:63
NamedObject.h
dd4hep::detail::ConditionObject::refCount
int refCount
Reference count.
Definition: ConditionsInterna.h:89
dd4hep::detail::ConditionObject::offset
static size_t offset()
Data offset from the opaque data block pointer to the condition.
Definition: ConditionsInterna.cpp:68
dd4hep::detail::ConditionObject::comment
std::string comment
Comment string.
Definition: ConditionsInterna.h:78
Conditions.h
dd4hep::detail::ConditionObject::validity
std::string validity
Condition validity (in string form)
Definition: ConditionsInterna.h:74
dd4hep::detail::ConditionObject::operator=
ConditionObject & operator=(ConditionObject &&)=delete
No move assignment operator.
dd4hep::detail::ConditionObject::setFlag
void setFlag(Condition::mask_type option)
Flag operations: Set a conditons flag.
Definition: ConditionsInterna.h:122
dd4hep::Condition::key_type
unsigned long long int key_type
Forward definition of the key type.
Definition: Conditions.h:54
dd4hep::detail::ConditionObject::iovData
const IOV * iovData() const
Access safely the IOV.
Definition: ConditionsInterna.cpp:85
dd4hep::Condition::mask_type
unsigned int mask_type
Forward definition of the object properties.
Definition: Conditions.h:60
dd4hep::detail::ConditionObject
The data class behind a conditions handle.
Definition: ConditionsInterna.h:68
DetElement.h
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::NamedObject
Implementation of a named object.
Definition: NamedObject.h:30
dd4hep::detail::ConditionObject::data
OpaqueDataBlock data
Data block.
Definition: ConditionsInterna.h:81
dd4hep::detail::ConditionObject::ConditionObject
ConditionObject(const ConditionObject &)=delete
No copy constructor.
dd4hep::detail::ConditionObject::iov
const IOV * iov
Interval of validity.
Definition: ConditionsInterna.h:83
dd4hep::detail::ConditionObject::testFlag
bool testFlag(Condition::mask_type option) const
Flag operations: Test for a given a conditons flag.
Definition: ConditionsInterna.h:126
Grammar.h