Bayeux  3.4.1
Core Foundation library for SuperNEMO
reflection_interface.h
Go to the documentation of this file.
1 /*
4  * Copyright (C) 2012-2016 Francois Mauger <mauger@lpccaen.in2p3.fr>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or (at
9  * your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef DATATOOLS_REFLECTION_INTERFACE_H
24 #define DATATOOLS_REFLECTION_INTERFACE_H
25 
26 // Third Party:
27 // - Camp:
28 #include <camp/detail/typeid.hpp>
29 #include <camp/camptype.hpp>
30 
34 
46 #define DR_CLASS_RTTI() \
47  CAMP_RTTI() \
48 
49 
65 #define DR_CLASS_REGISTER(Class) \
66  CAMP_TYPE( Class ) \
67 
68 
73 #define DR_TYPE_REGISTER(Type) \
74  CAMP_TYPE( Type ) \
75 
76 
83 
93 #define DR_CLASS_NONCOPYABLE_REGISTER(Class) \
94  CAMP_TYPE_NONCOPYABLE( Class ) \
95 
96 
101 #define DR_TYPE_NONCOPYABLE_REGISTER(Type) \
102  CAMP_TYPE_NONCOPYABLE( Type ) \
103 
104 
105 namespace datatools{
106  namespace detail {
108  namespace reflection {
109  template<typename Introspectable>
110  void implement_reflection(unsigned int);
111  }
112  }
113 }
114 
117 #define DR_CLASS_IMPLEMENT_REFLECTION_DECLARATION(Introspectable) \
118  namespace datatools{ \
119  namespace detail { \
120  namespace reflection { \
121  template<> \
122  void implement_reflection< Introspectable > (unsigned int); \
123  }}} \
124 
125 
128 #define DR_TYPE_IMPLEMENT_REFLECTION_DECLARATION(Introspectable) \
129  DR_CLASS_IMPLEMENT_REFLECTION_DECLARATION(Introspectable) \
130 
131 
139 
149 #define DR_CLASS_INIT(Introspectable) \
150  DR_CLASS_REGISTER(Introspectable) \
151  DR_CLASS_IMPLEMENT_REFLECTION_DECLARATION(Introspectable) \
152 
153 
158 #define DR_CLASS_NONCOPYABLE_INIT(Introspectable) \
159  DR_CLASS_NONCOPYABLE_REGISTER(Introspectable) \
160  DR_CLASS_IMPLEMENT_REFLECTION_DECLARATION(Introspectable) \
161 
162 
165 #define DR_TYPE_INIT(Introspectable) \
166  DR_CLASS_INIT(Introspectable) \
167 
168 
171 #define DR_TYPE_NONCOPYABLE_INIT(Introspectable) \
172  DR_CLASS_NONCOPYABLE_INIT(Introspectable) \
173 
174 
175 #endif // DATATOOLS_REFLECTION_INTERFACE_H
176 
177 // Local Variables: --
178 // mode: c++ --
179 // c-file-style: "gnu" --
180 // tab-width: 2 --
181 // End: --
void implement_reflection(unsigned int)
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13