CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
register_itemaccessorbase_macro.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_register_itemaccessorbase_macro_h
2 #define Fireworks_Core_register_itemaccessorbase_macro_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : register_itemaccessorbase_macros_h
7 //
16 //
17 // Original Author: Giulio Eulisse
18 // Created: Thu Feb 18 11:31:20 EDT 2010
19 //
20 
21 // system include files
23 
24 // user include files
25 
26 // forward declarations
27 #define REGISTER_FWITEMACCESSOR_METHODS() \
28  const std::string& typeName() const { return classTypeName(); } \
29  const std::string& purpose() const { return classPurpose();} \
30  static const std::string& classRegisterTypeName(); \
31  static const std::string& classTypeName(); \
32  static const std::string& classPurpose()
33 
34 #define CONCATENATE_HIDDEN(a,b) a ## b
35 #define CONCATENATE(a,b) CONCATENATE_HIDDEN(a,b)
36 
37 #define DEFINE_FWITEMACCESSOR_METHODS(_accessor_,_type_,_purpose_) \
38  const std::string& _accessor_::classTypeName() { \
39  static std::string s_type = edm::TypeWithDict(typeid(_type_)).name(); \
40  return s_type;} \
41  const std::string& _accessor_::classRegisterTypeName() { \
42  static std::string s_type(typeid(_type_).name()); \
43  return s_type;} \
44  const std::string& _accessor_::classPurpose() { \
45  static std::string s_purpose(_purpose_); return s_purpose;} enum {CONCATENATE(dummy_itemaccessor_methods_, __LINE__)}
46 
47 #define DEFINE_TEMPLATE_FWITEMACCESSOR_METHODS(_accessor_,_type_,_purpose_) \
48  template<> const std::string& _accessor_::classTypeName() { \
49  static std::string s_type = edm::TypeWithDict(typeid(_type_)).name(); \
50  return s_type;} \
51  template<> const std::string& _accessor_::classRegisterTypeName() { \
52  static std::string s_type(typeid(_type_).name()); \
53  return s_type;} \
54  template<> const std::string& _accessor_::classPurpose() { \
55  static std::string s_purpose(_purpose_); return s_purpose;} enum {CONCATENATE(dummy_itemaccessor_methods_, __LINE__)}
56 
57 #endif