DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
ObjectExtensions.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 #ifndef DD4HEP_OBJECTEXTENSIONS_H
14 #define DD4HEP_OBJECTEXTENSIONS_H
15 
16 // Framework include files
17 #include <DD4hep/ExtensionEntry.h>
18 
19 // C/C++ include files
20 #include <map>
21 
23 namespace dd4hep {
24 
26 
34  public:
36  std::map<unsigned long long int, ExtensionEntry*> extensions;
37 
38  public:
40  ObjectExtensions(const std::type_info& parent_type);
44  virtual ~ObjectExtensions();
48  void initialize();
50  void move(ObjectExtensions& copy);
52  void clear(bool destroy=true);
54  void copyFrom(const std::map<unsigned long long int,ExtensionEntry*>& ext, void* arg);
56  void* addExtension(unsigned long long int key, ExtensionEntry* entry);
58  void* removeExtension(unsigned long long int key, bool destroy);
60  void* extension(unsigned long long int key, bool alert) const;
62  void* extension(unsigned long long int key) const;
63  };
64 
65 } /* End namespace dd4hep */
66 #endif // DD4HEP_OBJECTEXTENSIONS_H
dd4hep::ExtensionEntry
Definition of the extension entry interface class.
Definition: ExtensionEntry.h:40
dd4hep::ObjectExtensions::ObjectExtensions
ObjectExtensions(const ObjectExtensions &copy)=delete
Copy constructor.
dd4hep::ObjectExtensions
Implementation of an object supporting arbitrary user extensions.
Definition: ObjectExtensions.h:33
dd4hep::ObjectExtensions::removeExtension
void * removeExtension(unsigned long long int key, bool destroy)
Remove an existing extension object from the instance.
Definition: ObjectExtensions.cpp:82
dd4hep::ObjectExtensions::operator=
ObjectExtensions & operator=(const ObjectExtensions &copy)=delete
Assignment operator.
dd4hep::ObjectExtensions::ObjectExtensions
ObjectExtensions(const std::type_info &parent_type)
Default constructor.
Definition: ObjectExtensions.cpp:30
dd4hep::ObjectExtensions::initialize
void initialize()
Initialize non-persistent object containers (e.g. after loading from ROOT file)
dd4hep::ObjectExtensions::extensions
std::map< unsigned long long int, ExtensionEntry * > extensions
The extensions object.
Definition: ObjectExtensions.h:36
dd4hep::ObjectExtensions::move
void move(ObjectExtensions &copy)
Move extensions to target object.
Definition: ObjectExtensions.cpp:41
dd4hep::ObjectExtensions::~ObjectExtensions
virtual ~ObjectExtensions()
Default destructor.
Definition: ObjectExtensions.cpp:35
key
unsigned char key
Definition: AlignmentsCalculator.cpp:69
dd4hep::ObjectExtensions::clear
void clear(bool destroy=true)
Clear all extensions.
Definition: ObjectExtensions.cpp:47
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::detail::tools::copy
void copy(Alignment from, Alignment to)
Copy alignment object from source object.
Definition: AlignmentTools.cpp:43
dd4hep::ObjectExtensions::copyFrom
void copyFrom(const std::map< unsigned long long int, ExtensionEntry * > &ext, void *arg)
Copy object extensions from another object. Hosting type must be identical!
Definition: ObjectExtensions.cpp:58
dd4hep::ObjectExtensions::addExtension
void * addExtension(unsigned long long int key, ExtensionEntry *entry)
Add an extension object to the detector element.
Definition: ObjectExtensions.cpp:65
ExtensionEntry.h
dd4hep::ObjectExtensions::extension
void * extension(unsigned long long int key, bool alert) const
Access an existing extension object from the detector element.
Definition: ObjectExtensions.cpp:108