File indexing completed on 2024-04-06 12:11:33
0001 #ifndef Fireworks_Core_register_itemaccessorbase_macro_h
0002 #define Fireworks_Core_register_itemaccessorbase_macro_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <string>
0023
0024
0025 #include "FWCore/Reflection/interface/TypeWithDict.h"
0026 #include "FWCore/Utilities/interface/concatenate.h"
0027
0028
0029
0030 #define REGISTER_FWITEMACCESSOR_METHODS() \
0031 const std::string& typeName() const { return classTypeName(); } \
0032 const std::string& purpose() const { return classPurpose(); } \
0033 static const std::string& classRegisterTypeName(); \
0034 static const std::string& classTypeName(); \
0035 static const std::string& classPurpose()
0036
0037 #define DEFINE_FWITEMACCESSOR_METHODS(_accessor_, _type_, _purpose_) \
0038 const std::string& _accessor_::classTypeName() { \
0039 static std::string s_type = edm::TypeWithDict(typeid(_type_)).name(); \
0040 return s_type; \
0041 } \
0042 const std::string& _accessor_::classRegisterTypeName() { \
0043 static std::string s_type(typeid(_type_).name()); \
0044 return s_type; \
0045 } \
0046 const std::string& _accessor_::classPurpose() { \
0047 static std::string s_purpose(_purpose_); \
0048 return s_purpose; \
0049 } \
0050 enum { EDM_CONCATENATE(dummy_itemaccessor_methods_, __LINE__) }
0051
0052 #define DEFINE_TEMPLATE_FWITEMACCESSOR_METHODS(_accessor_, _type_, _purpose_) \
0053 template <> \
0054 const std::string& _accessor_::classTypeName() { \
0055 static std::string s_type = edm::TypeWithDict(typeid(_type_)).name(); \
0056 return s_type; \
0057 } \
0058 template <> \
0059 const std::string& _accessor_::classRegisterTypeName() { \
0060 static std::string s_type(typeid(_type_).name()); \
0061 return s_type; \
0062 } \
0063 template <> \
0064 const std::string& _accessor_::classPurpose() { \
0065 static std::string s_purpose(_purpose_); \
0066 return s_purpose; \
0067 } \
0068 enum { EDM_CONCATENATE(dummy_itemaccessor_methods_, __LINE__) }
0069
0070 #endif