ATLAS Offline Software
Trigger
TrigEvent
TrigNavigation
TrigNavigation
TypeRegistration.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigNavigation/NavigationInit.h
"
6
#include "
TrigStorageDefinitions/EDM_TypeInfo.h
"
7
8
#include <iostream>
9
10
template
<
typename
CONTAINER>
11
struct
register_feature
{
12
template
<
class
FEATURE>
13
void
do_it
()
const
{
14
//std::cout << "\t\t registering feature: " << typeid(FEATURE).name() << " -> ";
15
//std::cout << "container: " << typeid(CONTAINER).name() << std::endl;
16
17
HLT::RegisterFeatureContainerTypes<FEATURE,CONTAINER>::instan
();
18
}
19
};
20
21
22
template
<
class
AUX>
23
struct
register_aux
{
24
static
void
do_it
() {
25
HLT::RegisterAuxType<AUX>::instan
();
26
}
27
};
28
29
30
template
<>
31
struct
register_aux
<
HLT
::TypeInformation::no_aux>{
32
static
void
do_it
() {}
33
};
34
35
36
37
38
struct
registertype
{
39
template
<
class
typeinfo_element>
40
void
do_it
()
const
{
41
typedef
typename
typeinfo_element::list_of_features FEATURES;
42
typedef
typename
typeinfo_element::container CONTAINER;
43
typedef
typename
typeinfo_element::aux AUX;
44
45
//std::cout << "list of features for contaier " << typeid(CONTAINER).name() << " ";
46
//HLT::TypeInformation::for_each_type<FEATURES,HLT::TypeInformation::simple_printer >::do_it();
47
//std::cout<< std::endl;
48
49
HLT::TypeInformation::for_each_type<FEATURES,register_feature<CONTAINER>
>
::do_it
();
50
register_aux<AUX>::do_it
();
51
}
52
};
53
54
//we want to exectute a function upon loading of a library (i.e. 'static'). since this is not possible
55
//per se, we take a detour via a default constructor. we declare a class with a static data member
56
//and initizalize that static member. This will call the default ctor of this member type during
57
//which we can register all kinds of types to the navigation. This also uses the looping functionality
58
//of the typemap
59
60
61
template
<
typename
TYPELIST>
62
struct
a_default_ctor
{
63
a_default_ctor
(){
64
//std::cout << "registering package with navi, packae typelist has size: " << TYPELIST::last_index + 1 << std::endl;
65
//we need to do this by hand unfortunately because we hit the template instantiaton depth of 99
66
HLT::TypeInformation::for_each_type<typename TYPELIST::template range< 0, 9>::type
,
registertype
>::do_it();
67
HLT::TypeInformation::for_each_type<typename TYPELIST::template range<10,19>::type
,
registertype
>::do_it();
68
HLT::TypeInformation::for_each_type<typename TYPELIST::template range<20,29>::type
,
registertype
>::do_it();
69
}
70
};
71
72
template
<
typename
TYPELIST>
73
struct
a_class_that_calls_default_ctor
{
74
static
const
a_default_ctor<TYPELIST>
member
;
75
};
76
77
#define REGISTER_PACKAGE_WITH_NAVI(name)\
78
template<> a_default_ctor<class_##name::map>\
79
const a_class_that_calls_default_ctor<class_##name::map>::member = \
80
a_default_ctor<class_##name::map>();
NavigationInit.h
register_feature::do_it
void do_it() const
Definition:
TypeRegistration.h:13
a_default_ctor
Definition:
TypeRegistration.h:62
a_class_that_calls_default_ctor::member
static const a_default_ctor< TYPELIST > member
Definition:
TypeRegistration.h:74
register_aux::do_it
static void do_it()
Definition:
TypeRegistration.h:24
HLT::RegisterFeatureContainerTypes::instan
static void instan()
Definition:
NavigationInit.h:35
HLT::RegisterAuxType::instan
static void instan()
Definition:
NavigationInit.h:50
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition:
HLTResultReader.h:26
register_aux< HLT::TypeInformation::no_aux >::do_it
static void do_it()
Definition:
TypeRegistration.h:32
register_aux
Definition:
TypeRegistration.h:23
HLT::TypeInformation::for_each_type
Definition:
TypeInformation.h:379
registertype::do_it
void do_it() const
Definition:
TypeRegistration.h:40
registertype
Definition:
TypeRegistration.h:38
register_feature
Definition:
TypeRegistration.h:11
a_class_that_calls_default_ctor
Definition:
TypeRegistration.h:73
a_default_ctor::a_default_ctor
a_default_ctor()
Definition:
TypeRegistration.h:63
EDM_TypeInfo.h
Generated on Fri Jul 5 2024 21:32:17 for ATLAS Offline Software by
1.8.18