1 #ifndef Candidate_component_h
2 #define Candidate_component_h
19 namespace componenthelper {
25 template <
typename C,
typename T, T (C::*F)() const>
28 const C *dc = dynamic_cast<const C *>(&
c);
35 template <
typename C,
typename T, T (C::*F)(
size_t) const,
size_t (C::*S)() const>
38 const C *dc = dynamic_cast<const C *>(&
c);
44 const C *dc = dynamic_cast<const C *>(&
c);
56 template <
typename T,
typename M,
typename Tag = DefaultComponentTag>
64 template <
typename T,
typename Tag>
74 template <
typename T,
typename Tag>
84 template <
typename T,
typename Tag>
91 #define GET_CANDIDATE_COMPONENT(CAND, TYPE, FUN, TAG) \
93 struct component<TYPE, componenthelper::SingleComponentTag, TAG> { \
94 typedef componenthelper::SingleComponent<CAND, TYPE, &CAND::FUN> type; \
97 #define GET_DEFAULT_CANDIDATE_COMPONENT(CAND, TYPE, FUN) \
99 struct component<TYPE, componenthelper::SingleComponentTag, DefaultComponentTag> { \
100 typedef componenthelper::SingleComponent<CAND, TYPE, &CAND::FUN> type; \
103 #define GET_CANDIDATE_MULTIPLECOMPONENTS(CAND, TYPE, FUN, SIZE, TAG) \
105 struct component<TYPE, componenthelper::MultipleComponentsTag, TAG> { \
106 typedef componenthelper::MultipleComponents<CAND, TYPE, &CAND::FUN, &CAND::SIZE> type; \
109 #define GET_DEFAULT_CANDIDATE_MULTIPLECOMPONENTS(CAND, TYPE, FUN, SIZE) \
111 struct component<TYPE, componenthelper::MultipleComponentsTag, DefaultComponentTag> { \
112 typedef componenthelper::MultipleComponents<CAND, TYPE, &CAND::FUN, &CAND::SIZE> type; \