Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:52

0001 #ifndef GENERS_IOISEXTERNAL_HH_
0002 #define GENERS_IOISEXTERNAL_HH_
0003 
0004 namespace gs {
0005   template <class T>
0006   struct IOIsExternal {
0007     enum { value = 0 };
0008   };
0009 }  // namespace gs
0010 
0011 // Use the following macro (outside of any namespace)
0012 // to declare some type as external for I/O purposes
0013 //
0014 #define gs_declare_type_external(T) /**/    \
0015   namespace gs {                            \
0016     template <>                             \
0017     struct IOIsExternal<T> {                \
0018       enum { value = 1 };                   \
0019     };                                      \
0020     template <>                             \
0021     struct IOIsExternal<T const> {          \
0022       enum { value = 1 };                   \
0023     };                                      \
0024     template <>                             \
0025     struct IOIsExternal<T volatile> {       \
0026       enum { value = 1 };                   \
0027     };                                      \
0028     template <>                             \
0029     struct IOIsExternal<T const volatile> { \
0030       enum { value = 1 };                   \
0031     };                                      \
0032   }
0033 
0034 // Use the following macro (outside of any namespace)
0035 // to declare some template parameterized by one argument
0036 // as external for I/O purposes
0037 //
0038 #define gs_declare_template_external_T(name) /**/ \
0039   namespace gs {                                  \
0040     template <class T>                            \
0041     struct IOIsExternal<name<T>> {                \
0042       enum { value = 1 };                         \
0043     };                                            \
0044     template <class T>                            \
0045     struct IOIsExternal<const name<T>> {          \
0046       enum { value = 1 };                         \
0047     };                                            \
0048     template <class T>                            \
0049     struct IOIsExternal<volatile name<T>> {       \
0050       enum { value = 1 };                         \
0051     };                                            \
0052     template <class T>                            \
0053     struct IOIsExternal<const volatile name<T>> { \
0054       enum { value = 1 };                         \
0055     };                                            \
0056   }
0057 
0058 // Use the following macro (outside of any namespace)
0059 // to declare some template parameterized by two arguments
0060 // as external for I/O purposes
0061 //
0062 #define gs_declare_template_external_TT(name) /**/   \
0063   namespace gs {                                     \
0064     template <class T, class U>                      \
0065     struct IOIsExternal<name<T, U>> {                \
0066       enum { value = 1 };                            \
0067     };                                               \
0068     template <class T, class U>                      \
0069     struct IOIsExternal<const name<T, U>> {          \
0070       enum { value = 1 };                            \
0071     };                                               \
0072     template <class T, class U>                      \
0073     struct IOIsExternal<volatile name<T, U>> {       \
0074       enum { value = 1 };                            \
0075     };                                               \
0076     template <class T, class U>                      \
0077     struct IOIsExternal<const volatile name<T, U>> { \
0078       enum { value = 1 };                            \
0079     };                                               \
0080   }
0081 
0082 #endif  // GENERS_IOISEXTERNAL_HH_