|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
26 static int s_extensionID = 0;
29 static std::map<const std::type_info*, PluginTester::ExtensionMap> s_map;
50 void* ptr = (*i).second;
52 ExtensionMap::iterator j =
extensionMap->find((*i).first.first);
54 Entry& e = (*j).second;
72 entry.
id = ++s_extensionID;
77 throw std::runtime_error(
"dd4hep: addExtension: Object already has an extension "+name+
78 " of type:" + typeName(
info) +
".");
86 void *ptr = (*j).second;
90 Entry& e = (*i).second;
98 throw std::runtime_error(
"dd4hep: removeExtension: The object "+name+
99 " of type " + typeName(
info) +
" is not present.");
111 throw std::runtime_error(
"dd4hep: extension: Object has no extension "+name+
112 " of type:" + typeName(
info) +
".");
void clear(bool destroy=true)
Clear all extensions.
std::pair< const std::type_info *, std::string > key_type
Definition of the extension type.
PluginTester()
Default constructor.
virtual ~PluginTester()
Default destructor.
std::size_t info(const std::string &src, const std::string &msg)
static void increment(T *)
Increment count according to type information.
void * removeExtension(const std::string &name, const std::type_info &info, bool destroy)
Remove an existing extension object from the instance.
ExtensionMap * extensionMap
Pointer to the extension map.
std::map< const std::type_info *, Entry > ExtensionMap
void * extension(const std::string &name, const std::type_info &info, bool alert) const
Access an existing extension object from the detector element.
void * addExtension(void *ptr, const std::string &name, const std::type_info &info, destruct_t dtor)
Add an extension object to the detector element.
static void decrement(T *)
Decrement count according to type information.
Helper class to ease testing of plugins: Effectively a container of object extensions.
Namespace for the AIDA detector description toolkit.
Defintiion of the extension entry.
Extensions extensions
The extensions object.