00001
00002
00003 #ifndef XAODCORE_AUXSTOREACCESSORMACROS_H
00004 #define XAODCORE_AUXSTOREACCESSORMACROS_H
00005
00031 #define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, \
00032 SETTER) \
00033 TYPE CL::NAME() const { \
00034 static Accessor< TYPE > acc( #NAME ); \
00035 return acc( *this ); \
00036 } \
00037 void CL::SETTER( TYPE value ) { \
00038 static Accessor< TYPE > acc( #NAME ); \
00039 acc( *this ) = value; \
00040 return; \
00041 }
00042
00054 #define AUXSTORE_PRIMITIVE_GETTER(CL, TYPE, NAME ) \
00055 TYPE CL::NAME() const { \
00056 static Accessor< TYPE > acc( #NAME ); \
00057 return acc( *this ); \
00058 }
00059
00072 #define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER) \
00073 const TYPE& CL::NAME() const { \
00074 static Accessor< TYPE > acc( #NAME ); \
00075 return acc( *this ); \
00076 } \
00077 void CL::SETTER( const TYPE& value ) { \
00078 static Accessor< TYPE > acc( #NAME ); \
00079 acc( *this ) = value; \
00080 return; \
00081 }
00082
00083
00096 #if __cplusplus < 201100
00097 # define AUXSTORE_OBJECT_MOVE(CL, TYPE, NAME, SETTER)
00098 #else
00099 # define AUXSTORE_OBJECT_MOVE(CL, TYPE, NAME, SETTER) \
00100 void CL::SETTER( typename SG::AuxDataTraits<TYPE>::element_type&& value ) { \
00101 static Accessor< TYPE > acc( #NAME ); \
00102 acc( *this ) = std::move(value); \
00103 return; \
00104 }
00105 #endif
00106
00107
00118 #define AUXSTORE_OBJECT_GETTER(CL, TYPE, NAME ) \
00119 const TYPE& CL::NAME() const { \
00120 static Accessor< TYPE > acc( #NAME ); \
00121 return acc( *this ); \
00122 }
00123
00138 #define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, \
00139 NAME) \
00140 TRANSTYPE CL::NAME() const { \
00141 static Accessor< PERSTYPE > acc( #NAME ); \
00142 return static_cast< TRANSTYPE >( acc( *this ) ); \
00143 }
00144
00159 #define AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, \
00160 NAME, SETTER) \
00161 void CL::SETTER( TRANSTYPE value ) { \
00162 static Accessor< PERSTYPE > acc( #NAME ); \
00163 acc( *this ) = static_cast< PERSTYPE >( value ); \
00164 return; \
00165 }
00166
00167 #endif // XAODCORE_AUXSTOREACCESSORMACROS_H