![]() |
ATLAS Offline Software
|
Set up plugin loading of TP converters. More...
#include "Gaudi/PluginService.h"
Go to the source code of this file.
Classes | |
struct | Athena::TPCnvVers |
struct | Athena::TPCnvType |
Namespaces | |
Athena | |
Some weak symbol referencing magic... | |
Macros | |
#define | DO_ATHTPCNV_FACTORY_REGISTER_CNAME(name, serial) _register_ ## _ ## serial |
#define | DO_ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, id, trans_type, pers_type, is_last_version, cnv_type, signature, serial) |
#define | DO_ATHTPCNV_PLUGINSVC_FACTORY(type, trans_type, pers_type, is_last_version, cnv_type, signature, serial) DO_ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, ::Gaudi::PluginService::Details::demangle<type>(), trans_type, pers_type, is_last_version, cnv_type, signature, serial) |
#define | ATHTPCNV_PLUGINSVC_FACTORY(type, trans_type, pers_type, is_last_version, signature) DO_ATHTPCNV_PLUGINSVC_FACTORY(type, trans_type, pers_type, is_last_version, Athena::TPCnvType::Athena, signature, __LINE__) |
#define | TRIGTPCNV_PLUGINSVC_FACTORY(type, trans_type, pers_type, is_last_version, signature) DO_ATHTPCNV_PLUGINSVC_FACTORY(type, trans_type, pers_type, is_last_version, Athena::TPCnvType::Trigger, signature, __LINE__) |
#define | ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, id, trans_type, pers_type, is_last_version, signature) DO_ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, id, trans_type, pers_type, is_last_version, Athena::TPCnvType::Athena, signature, __LINE__) |
#define | TRIGTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, id, trans_type, pers_type, is_last_version, signature) DO_ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, id, trans_type, pers_type, is_last_version, Athena::TPCnvType::Trigger, signature, __LINE__) |
#define | DECLARE_TPCNV_FACTORY(x, trans_type, pers_type, is_last_version) ATHTPCNV_PLUGINSVC_FACTORY(x,trans_type,pers_type,is_last_version,ITPCnvBase*()) |
#define | DECLARE_TRIGTPCNV_FACTORY(x, trans_type, pers_type, is_last_version) TRIGTPCNV_PLUGINSVC_FACTORY(x,trans_type,pers_type,is_last_version,ITPCnvBase*()) |
#define | DECLARE_NAMED_TPCNV_FACTORY(x, n, trans_type, pers_type, is_last_version) ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(x,std::string(#n), trans_type,pers_type, is_last_version, ITPCnvBase*()) |
#define | DECLARE_NAMED_TRIGTPCNV_FACTORY(x, n, trans_type, pers_type, is_last_version) TRIGTPCNV_PLUGINSVC_FACTORY_WITH_ID(x,std::string(#n), trans_type,pers_type, is_last_version, ITPCnvBase*()) |
Set up plugin loading of TP converters.
In a TPCnv package, create a source file with the same name as the package, add add this to your requirements file:
That file should contain a declaration like this for each TP converter:
The first three arguments should be the converter class, the transient class, and the persistent class, respectively. The fourth argument should be Athena::TPCnvVers::Current
if this is the most recent version of the converter. You should also declare previous versions of the converter, using Old:
There is a separate macro DECLARE_TRIGTPCNV_FACTORY
to allow declaring separate converters to use for the trigger.
Finally, in some cases you may need to use a different name for the plugin than the C++ class name. This is generally the case if the converter class is actually a typedef. In that case, use DECLARE_NAMED_TPCNV_FACTORY:
The implementation is very simple. Let the converter, transient, and persistent types be C, T, and P, respectively. We always make plugin entries for C and _PERS_P. If the converter is current, we also make an entry for _TRANS_T. If the converter is for _TRIG, we add _TRIG to the front of the pers and trans names.
Thus, to find the correct converter for a transient class, we look up _TRANS_T; and for a persistent class we look up _PERS_P. For TRIG, we first try the look up with _TRIG in front of those names. To get the transient class name corresponding to a persistent class, we create an instance of the converter and use the transientTInfo
interface. No registry is needed beyond the existing Gaudi plugin registry.
One limitation: if you have multiple transient classes that use the same persistent class, you'll get warnings from the plugin service.
Definition in file TPCnvFactory.h.
#define ATHTPCNV_PLUGINSVC_FACTORY | ( | type, | |
trans_type, | |||
pers_type, | |||
is_last_version, | |||
signature | |||
) | DO_ATHTPCNV_PLUGINSVC_FACTORY(type, trans_type, pers_type, is_last_version, Athena::TPCnvType::Athena, signature, __LINE__) |
Definition at line 150 of file TPCnvFactory.h.
#define ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID | ( | type, | |
id, | |||
trans_type, | |||
pers_type, | |||
is_last_version, | |||
signature | |||
) | DO_ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, id, trans_type, pers_type, is_last_version, Athena::TPCnvType::Athena, signature, __LINE__) |
Definition at line 155 of file TPCnvFactory.h.
#define DECLARE_NAMED_TPCNV_FACTORY | ( | x, | |
n, | |||
trans_type, | |||
pers_type, | |||
is_last_version | |||
) | ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(x,std::string(#n), trans_type,pers_type, is_last_version, ITPCnvBase*()) |
Definition at line 172 of file TPCnvFactory.h.
#define DECLARE_NAMED_TRIGTPCNV_FACTORY | ( | x, | |
n, | |||
trans_type, | |||
pers_type, | |||
is_last_version | |||
) | TRIGTPCNV_PLUGINSVC_FACTORY_WITH_ID(x,std::string(#n), trans_type,pers_type, is_last_version, ITPCnvBase*()) |
Definition at line 175 of file TPCnvFactory.h.
#define DECLARE_TPCNV_FACTORY | ( | x, | |
trans_type, | |||
pers_type, | |||
is_last_version | |||
) | ATHTPCNV_PLUGINSVC_FACTORY(x,trans_type,pers_type,is_last_version,ITPCnvBase*()) |
Definition at line 166 of file TPCnvFactory.h.
#define DECLARE_TRIGTPCNV_FACTORY | ( | x, | |
trans_type, | |||
pers_type, | |||
is_last_version | |||
) | TRIGTPCNV_PLUGINSVC_FACTORY(x,trans_type,pers_type,is_last_version,ITPCnvBase*()) |
Definition at line 169 of file TPCnvFactory.h.
#define DO_ATHTPCNV_FACTORY_REGISTER_CNAME | ( | name, | |
serial | |||
) | _register_ ## _ ## serial |
Definition at line 118 of file TPCnvFactory.h.
#define DO_ATHTPCNV_PLUGINSVC_FACTORY | ( | type, | |
trans_type, | |||
pers_type, | |||
is_last_version, | |||
cnv_type, | |||
signature, | |||
serial | |||
) | DO_ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, ::Gaudi::PluginService::Details::demangle<type>(), trans_type, pers_type, is_last_version, cnv_type, signature, serial) |
Definition at line 145 of file TPCnvFactory.h.
#define DO_ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID | ( | type, | |
id, | |||
trans_type, | |||
pers_type, | |||
is_last_version, | |||
cnv_type, | |||
signature, | |||
serial | |||
) |
Definition at line 127 of file TPCnvFactory.h.
#define TRIGTPCNV_PLUGINSVC_FACTORY | ( | type, | |
trans_type, | |||
pers_type, | |||
is_last_version, | |||
signature | |||
) | DO_ATHTPCNV_PLUGINSVC_FACTORY(type, trans_type, pers_type, is_last_version, Athena::TPCnvType::Trigger, signature, __LINE__) |
Definition at line 152 of file TPCnvFactory.h.
#define TRIGTPCNV_PLUGINSVC_FACTORY_WITH_ID | ( | type, | |
id, | |||
trans_type, | |||
pers_type, | |||
is_last_version, | |||
signature | |||
) | DO_ATHTPCNV_PLUGINSVC_FACTORY_WITH_ID(type, id, trans_type, pers_type, is_last_version, Athena::TPCnvType::Trigger, signature, __LINE__) |
Definition at line 157 of file TPCnvFactory.h.