ATLAS Offline Software
Loading...
Searching...
No Matches
AuxStoreAccessorMacros.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: AuxStoreAccessorMacros.h 633587 2014-12-04 09:09:41Z ssnyder $
8#ifndef XAODCORE_AUXSTOREACCESSORMACROS_H
9#define XAODCORE_AUXSTOREACCESSORMACROS_H
10
36#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, \
37 SETTER) \
38 TYPE CL::NAME() const { \
39 static const Accessor< TYPE > acc( #NAME ); \
40 return acc( *this ); \
41 } \
42 void CL::SETTER( TYPE value ) { \
43 static const Accessor< TYPE > acc( #NAME ); \
44 acc( *this ) = value; \
45 return; \
46 }
47
59#define AUXSTORE_PRIMITIVE_GETTER(CL, TYPE, NAME ) \
60 TYPE CL::NAME() const { \
61 static const Accessor< TYPE > acc( #NAME ); \
62 return acc( *this ); \
63 }
64
77#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER) \
78 const TYPE& CL::NAME() const { \
79 static const Accessor< TYPE > acc( #NAME ); \
80 return acc( *this ); \
81 } \
82 void CL::SETTER( const TYPE& value ) { \
83 static const Accessor< TYPE > acc( #NAME ); \
84 acc( *this ) = value; \
85 return; \
86 }
87
88
101# define AUXSTORE_OBJECT_MOVE(CL, TYPE, NAME, SETTER) \
102 void CL::SETTER( typename SG::AuxDataTraits<TYPE>::element_type&& value ) { \
103 static const Accessor< TYPE > acc( #NAME ); \
104 acc( *this ) = std::move(value); \
105 return; \
106 }
107
108
119#define AUXSTORE_OBJECT_GETTER(CL, TYPE, NAME ) \
120 const TYPE& CL::NAME() const { \
121 static const Accessor< TYPE > acc( #NAME ); \
122 return acc( *this ); \
123 }
124
139#define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, \
140 NAME) \
141 TRANSTYPE CL::NAME() const { \
142 static const Accessor< PERSTYPE > acc( #NAME ); \
143 return static_cast< TRANSTYPE >( acc( *this ) ); \
144 }
145
160#define AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, \
161 NAME, SETTER) \
162 void CL::SETTER( TRANSTYPE value ) { \
163 static const Accessor< PERSTYPE > acc( #NAME ); \
164 acc( *this ) = static_cast< PERSTYPE >( value ); \
165 return; \
166 }
167
168#endif // XAODCORE_AUXSTOREACCESSORMACROS_H