5 #ifndef XAODCORE_TOOLS_AUXVARIABLE_H
6 #define XAODCORE_TOOLS_AUXVARIABLE_H
23 #define AUX_VARIABLE( VAR, ... ) \
25 static const auxid_t auxid = \
26 getAuxID( #VAR, VAR CXXUTILS_PP_FIRST( __VA_ARGS__ ) ); \
27 regAuxVar( auxid, #VAR, VAR ); \
58 template <
class VARTYPE,
class AUXBASE>
62 return VARTYPE (auxcont->memResource());
66 template <
class VARTYPE,
class AUXBASE>
74 template <
class VARTYPE,
class AUXBASE>
77 return initAuxVar2<VARTYPE> ( auxcont, std::is_constructible<VARTYPE, std::pmr::memory_resource*>() );
81 template <const
char* NAME,
class AUXBASE,
class VARTYPE>
87 auxcont->regAuxVar (auxid, NAME,
var);
88 return initAuxVar1<VARTYPE>( auxcont );
96 template <
class ELT, const
char* NAME,
class AUXBASE,
class LINKS,
class LINKED>
105 auxcont->regAuxVar( acc.auxid(), NAME,
links );
106 return xAOD::detail::initAuxVar1<LINKED>( auxcont );
113 #define AUXVAR_DECL( TYPE, NAME, ... ) \
114 static constexpr const char NAME ## __name[] = #NAME; \
115 AuxVariable_t< TYPE AUXVAR_DECL_ALLOC_( TYPE, __VA_ARGS__ ) > NAME \
116 { xAOD::detail::initAuxVar< NAME ## __name >( this, NAME CXXUTILS_PP_SECOND( __VA_ARGS__ ) ) }
117 #define AUXVAR_DECL_ALLOC_( TYPE, ... ) \
118 __VA_OPT__( CXXUTILS_PP_FIRST( __VA_ARGS__ )< TYPE > )
121 #define AUXVAR_PACKEDCONTAINER_DECL( TYPE, NAME ) \
122 static constexpr const char NAME ## __name[] = #NAME; \
123 SG::PackedContainer< TYPE > NAME { xAOD::detail::initAuxVar< NAME ## __name >( this, NAME ) }
126 #endif // XAODCORE_TOOLS_AUXVARIABLE_H