Minsky
nobble.h
Go to the documentation of this file.
1 /*
2  @copyright Steve Keen 2020
3  @author Russell Standish
4  This file is part of Minsky.
5 
6  Minsky is free software: you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Minsky is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Minsky. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef NOBBLE_H
21 #define NOBBLE_H
22 
23 // deal with multiple template arguments
24 #define NOBBLE_TARG(...) __VA_ARGS__
25 #define NOBBLE_STR(...) #__VA_ARGS__
26 
27 
28 #define NOBBLE(type, tdecl) \
29  namespace classdesc \
30 { \
31  template <tdecl> struct tn<type> \
32  { \
33  static string name() {return NOBBLE_STR(type);} \
34  }; \
35 } \
36  namespace classdesc_access \
37 { \
38  template <tdecl> struct access_RESTProcess<type>: \
39  public classdesc::NullDescriptor<classdesc::RESTProcess_t> {}; \
40  \
41  template <tdecl> struct access_json_pack<type>: \
42  public classdesc::NullDescriptor<classdesc::json_pack_t> {}; \
43  \
44  template <tdecl> struct access_json_unpack<type>: \
45  public classdesc::NullDescriptor<classdesc::json_unpack_t> {}; \
46  }
47 
48 #include <chrono>
49 
50 // nobble various system types we're not going to expose to the REST API
51 NOBBLE(NOBBLE_TARG(std::chrono::time_point<C,D>), NOBBLE_TARG(class C, class D))
52 NOBBLE(NOBBLE_TARG(std::chrono::duration<R,P>), NOBBLE_TARG(class R, class P))
53 NOBBLE(std::istream,)
54 NOBBLE(std::initializer_list<T>,class T)
55 #if defined(__GNUC__) && !defined(__clang__)
56 NOBBLE(NOBBLE_TARG(__gnu_cxx::__normal_iterator<const unsigned int*, std::vector<T,A>>),NOBBLE_TARG(class T,class A))
57 NOBBLE(NOBBLE_TARG(__gnu_cxx::__normal_iterator<const long unsigned int*, std::vector<T,A>>),NOBBLE_TARG(class T,class A))
58 NOBBLE(NOBBLE_TARG(__gnu_cxx::__normal_iterator<const long long unsigned int*, std::vector<T,A>>),NOBBLE_TARG(class T,class A))
59 #elif defined(MAC_OSX_TK)
60 NOBBLE(std::__1::__wrap_iter<const unsigned long *>,)
61 #elif defined(__clang__)
62 NOBBLE(NOBBLE_TARG(__gnu_cxx::__normal_iterator<const unsigned long*, std::vector<T,A>>),NOBBLE_TARG(class T,class A))
63 #endif
64 NOBBLE(NOBBLE_TARG(boost::geometry::model::d2::point_xy<T,S>),NOBBLE_TARG(class T,class S))
65 #endif
#define NOBBLE_TARG(...)
Definition: nobble.h:24
STL namespace.
#define NOBBLE(type, tdecl)
Definition: nobble.h:28