CMS 3D CMS Logo

reflex.h
Go to the documentation of this file.
1 #ifndef FWCore_Reflection_interface_reflex_h
2 #define FWCore_Reflection_interface_reflex_h
3 
4 /* These macros can be used to annotate the data members of DataFormats classes
5  * and achieve the same effect of ROOT-style comments or reflex dictionaries:
6  *
7  * private:
8  * int size_;
9  * float* data_; //[size_]
10  * float* transient_; //!
11  *
12  * can be expressed as
13  *
14  * private:
15  * int size_;
16  * float* data_ EDM_REFLEX_SIZE(size_);
17  * float* transient_ EDM_REFLEX_TRANSIENT;
18  *
19  * The main advantage is that - unlike comments - these macros can be used inside
20  * other macros.
21  *
22  * To avoid warning about unrecognised attributes, these macros expand to nothing
23  * unless __CLING__ is defined.
24  */
25 
27 
28 #ifdef __CLING__
29 
30 // Macros used to annotate class members for the generation of ROOT dictionaries
31 #define EDM_REFLEX_TRANSIENT [[clang::annotate("!")]]
32 #define EDM_REFLEX_SIZE(SIZE) [[clang::annotate("[" EDM_STRINGIZE(SIZE) "]")]]
33 
34 #else
35 
36 #define EDM_REFLEX_TRANSIENT
37 #define EDM_REFLEX_SIZE(SIZE)
38 
39 #endif // __CLING__
40 
41 #endif // FWCore_Reflection_interface_reflex_h