DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Helper class to ease testing of plugins: Effectively a container of object extensions. More...
#include <PluginTester.h>
Classes | |
struct | Entry |
Defintiion of the extension entry. More... | |
Public Types | |
typedef std::pair< const std::type_info *, std::string > | key_type |
Definition of the extension type. More... | |
typedef std::map< key_type, void * > | Extensions |
Mapped extension type. More... | |
typedef void(* | destruct_t) (void *) |
Extensions destructor type. More... | |
typedef std::map< const std::type_info *, Entry > | ExtensionMap |
Public Member Functions | |
void * | addExtension (void *ptr, const std::string &name, const std::type_info &info, destruct_t dtor) |
Add an extension object to the detector element. More... | |
void * | extension (const std::string &name, const std::type_info &info, bool alert) const |
Access an existing extension object from the detector element. More... | |
void * | removeExtension (const std::string &name, const std::type_info &info, bool destroy) |
Remove an existing extension object from the instance. More... | |
PluginTester () | |
Default constructor. More... | |
PluginTester (const PluginTester ©)=delete | |
Copy constructor. More... | |
virtual | ~PluginTester () |
Default destructor. More... | |
PluginTester & | operator= (const PluginTester ©)=delete |
Assignment operator. More... | |
void | clear (bool destroy=true) |
Clear all extensions. More... | |
template<typename Q > | |
Q * | addExtension (Q *ptr, const std::string &name) |
template<typename Q > | |
Q * | extension (const std::string &name, bool alert=true) |
template<typename Q > | |
Q * | removeExtension (const std::string &name, bool destroy=true) |
Static Public Member Functions | |
static void | _noDelete (void *) |
Function to be passed as dtor if object should NOT be deleted! More... | |
template<typename T > | |
static void | _delete (void *ptr) |
Templated destructor function. More... | |
Public Attributes | |
Extensions | extensions |
The extensions object. More... | |
ExtensionMap * | extensionMap = 0 |
Pointer to the extension map. More... | |
Helper class to ease testing of plugins: Effectively a container of object extensions.
Definition at line 30 of file PluginTester.h.
typedef void(* dd4hep::PluginTester::destruct_t) (void *) |
Extensions destructor type.
Definition at line 37 of file PluginTester.h.
typedef std::map<const std::type_info*, Entry> dd4hep::PluginTester::ExtensionMap |
Definition at line 44 of file PluginTester.h.
typedef std::map<key_type, void*> dd4hep::PluginTester::Extensions |
Mapped extension type.
Definition at line 35 of file PluginTester.h.
typedef std::pair<const std::type_info*,std::string> dd4hep::PluginTester::key_type |
Definition of the extension type.
Definition at line 33 of file PluginTester.h.
PluginTester::PluginTester | ( | ) |
Default constructor.
Definition at line 36 of file PluginTester.cpp.
|
delete |
Copy constructor.
|
virtual |
Default destructor.
Definition at line 42 of file PluginTester.cpp.
|
inlinestatic |
Templated destructor function.
Definition at line 55 of file PluginTester.h.
|
inlinestatic |
Function to be passed as dtor if object should NOT be deleted!
Definition at line 52 of file PluginTester.h.
|
inline |
Definition at line 77 of file PluginTester.h.
void * PluginTester::addExtension | ( | void * | ptr, |
const std::string & | name, | ||
const std::type_info & | info, | ||
destruct_t | dtor | ||
) |
Add an extension object to the detector element.
Definition at line 64 of file PluginTester.cpp.
void PluginTester::clear | ( | bool | destroy = true | ) |
Clear all extensions.
Internal object destructor: release extension object(s)
Definition at line 48 of file PluginTester.cpp.
|
inline |
Definition at line 80 of file PluginTester.h.
void * PluginTester::extension | ( | const std::string & | name, |
const std::type_info & | info, | ||
bool | alert | ||
) | const |
Access an existing extension object from the detector element.
Definition at line 103 of file PluginTester.cpp.
|
delete |
Assignment operator.
|
inline |
Definition at line 83 of file PluginTester.h.
void * PluginTester::removeExtension | ( | const std::string & | name, |
const std::type_info & | info, | ||
bool | destroy | ||
) |
Remove an existing extension object from the instance.
Definition at line 82 of file PluginTester.cpp.
ExtensionMap* dd4hep::PluginTester::extensionMap = 0 |
Pointer to the extension map.
Definition at line 49 of file PluginTester.h.
Extensions dd4hep::PluginTester::extensions |
The extensions object.
Definition at line 47 of file PluginTester.h.