14#if defined(__GNUC__) && !defined(__ICC)
15#pragma GCC diagnostic push
16#pragma GCC diagnostic ignored "-Wnoexcept-type"
23 int classdesc_epilogue_not_included();
24 int _dummy=classdesc_epilogue_not_included();
38#include <emscripten/console.h>
45 typedef basic_string<wchar_t> wstring;
54#if defined(__cplusplus) && __cplusplus>=201103L
55#include <unordered_map>
56#include <unordered_set>
60#if defined(__cplusplus) && __cplusplus<201103L
67#include <tr1/type_traits>
68#if !defined(__ICC) || __ICC > 1100
72#include <boost/tr1/type_traits.hpp>
73#include <boost/tr1/memory.hpp>
81#if defined(__cplusplus) && __cplusplus>=201103L || defined(_MSC_VER)
83#include <unordered_map>
84#include <unordered_set>
92 using std::false_type;
95 using std::is_integral;
96 using std::is_floating_point;
100 struct is_Carray:
public std::is_array<T> {};
101 using std::is_pointer;
102 using std::is_reference;
103 using std::is_member_object_pointer;
104 using std::is_member_function_pointer;
108 using std::is_function;
110 using std::is_arithmetic;
111 using std::is_fundamental;
112 using std::is_object;
113 using std::is_scalar;
114 using std::is_compound;
115 using std::is_member_pointer;
118 using std::is_volatile;
121 using std::is_polymorphic;
122 using std::is_abstract;
123 using std::is_signed;
124 using std::is_unsigned;
125 using std::alignment_of;
131 using std::is_base_of;
132 using std::is_convertible;
134 using std::remove_const;
135 using std::remove_volatile;
136 using std::remove_cv;
137 using std::add_const;
138 using std::add_volatile;
141 using std::remove_reference;
143 using std::remove_extent;
144 using std::remove_all_extents;
146 using std::remove_pointer;
147 using std::add_pointer;
149 using std::shared_ptr;
151 using std::dynamic_pointer_cast;
153 using std::is_default_constructible;
154 using std::is_copy_constructible;
155 using std::is_assignable;
159 template <
typename... >
using void_t = void;
162 template <
class T,
class...
Args>
163 std::unique_ptr<T> make_unique(
Args... args)
164 {
return std::unique_ptr<T>(
new T(args...));}
172#elif defined(BOOST_TR1) || defined(TR1)
175 using std::tr1::true_type;
176 using std::tr1::false_type;
178 using std::tr1::is_void;
179 using std::tr1::is_integral;
180 using std::tr1::is_floating_point;
184 struct is_Carray:
public std::tr1::is_array<T> {};
185 using std::tr1::is_pointer;
186 using std::tr1::is_reference;
187 using std::tr1::is_member_object_pointer;
188 using std::tr1::is_member_function_pointer;
189 using std::tr1::is_enum;
190 using std::tr1::is_union;
191 using std::tr1::is_class;
192 using std::tr1::is_function;
194 using std::tr1::is_arithmetic;
195 using std::tr1::is_fundamental;
196 using std::tr1::is_object;
197 using std::tr1::is_scalar;
198 using std::tr1::is_compound;
199 using std::tr1::is_member_pointer;
201 using std::tr1::is_const;
202 using std::tr1::is_volatile;
203 using std::tr1::is_pod;
204 using std::tr1::is_empty;
205 using std::tr1::is_polymorphic;
206 using std::tr1::is_abstract;
207 using std::tr1::is_signed;
208 using std::tr1::is_unsigned;
209 using std::tr1::alignment_of;
212 using std::tr1::extent;
214 using std::tr1::is_same;
215 using std::tr1::is_base_of;
216 using std::tr1::is_convertible;
218 using std::tr1::remove_const;
219 using std::tr1::remove_volatile;
220 using std::tr1::remove_cv;
221 using std::tr1::add_const;
222 using std::tr1::add_volatile;
223 using std::tr1::add_cv;
225 using std::tr1::remove_reference;
227 using std::tr1::remove_extent;
228 using std::tr1::remove_all_extents;
230 using std::tr1::remove_pointer;
231 using std::tr1::add_pointer;
235#if (!defined(__ICC) || __ICC > 1100)
236 using std::tr1::shared_ptr;
237 using std::tr1::weak_ptr;
238 using std::tr1::dynamic_pointer_cast;
242 template <
class T>
struct is_default_constructible:
244 public std::tr1::has_nothrow_constructor<T> {};
245 template <
class T>
struct is_copy_constructible:
246 public std::tr1::has_nothrow_copy<T> {};
247 template <
class T,
class U>
struct is_assignable
249 static const bool value=std::tr1::has_nothrow_assign<T>::value &&
250 std::tr1::is_convertible<U,T>::value;
274 template <
bool,
class type=
void>
struct enable_if_c {
typedef type T;};
286 template <
bool C,
class True,
class F>
292 template <
class True,
class F>
299 template <
int>
struct dummy {dummy(
int) {} };
302 template <
class T>
struct is_sequence {
static const bool value=
false;};
304 static const bool value=
true;};
306 static const bool value=
true;};
308 static const bool value=
true;};
313 template <
class T>
struct is_string {
static const bool value=
false;};
315 {
static const bool value=
true;};
322 template <
class T,
class C,
class A>
324 static const bool value=
true;};
325 template <
class K,
class V,
class C,
class A>
327 static const bool value=
true;};
328 template <
class T,
class C,
class A>
330 static const bool value=
true;};
331 template <
class K,
class V,
class C,
class A>
333 static const bool value=
true;};
335#if defined(__cplusplus) && __cplusplus>=201103L
336 template <
class T,
class=
void>
struct is_iterator:
public false_type {};
337 template <
class T>
struct is_iterator<T, void_t<typename
std::iterator_traits<T>::iterator_category>>:
340 template <
class K,
class V,
class H,
class P,
class A>
342 static const bool value=
true;};
343 template <
class K,
class H,
class P,
class A>
345 static const bool value=
true;};
346 template <
class K,
class V,
class H,
class P,
class A>
348 static const bool value=
true;};
349 template <
class K,
class H,
class P,
class A>
351 static const bool value=
true;};
352 template <
class T, std::
size_t N>
353 struct is_sequence<std::array<T,N>> {
static const bool value=
true;};
359 static const bool value=
360 is_sequence<T>::value||is_associative_container<T>::value;
367 template <
class T>
struct is_pair:
public false_type {};
368 template <
class F,
class S>
struct is_pair<
std::pair<F,S> >:
public true_type {};
372 template <
class T>
struct is_smart_ptr<shared_ptr<
T> >:
public true_type {};
374 template <
class T>
struct is_smart_ptr<const shared_ptr<
T> >:
public true_type {};
375 template <
class T>
struct is_smart_ptr<const weak_ptr<
T> >:
public true_type {};
376#if defined(__cplusplus) && __cplusplus>=201103L
377 template <
class T>
struct is_smart_ptr<
std::unique_ptr<T>>:
public true_type {};
378 template <
class T>
struct is_smart_ptr<const
std::unique_ptr<T>>:
public true_type {};
383 template <
class T>
struct is_weak_ptr<weak_ptr<
T> >:
public true_type {};
384 template <
class T>
struct is_weak_ptr<const weak_ptr<
T> >:
public true_type {};
386#if defined(__cplusplus) && __cplusplus>=201103L
389 template <
typename T>
390 struct is_complete_helper {
391 template <
typename U>
392 static auto test(U*) -> std::integral_constant<bool,
sizeof(U) ==
sizeof(U)>;
393 static auto test(...) -> std::false_type;
394 using type =
decltype(test((
T*)0));
397 template <
typename T>
398 struct is_complete : is_complete_helper<typename std::remove_pointer<typename std::remove_reference<T>::type>::type>::type {};
404 template <
class T>
struct Not
405 {
static const bool value=!T::value;};
407#if defined(__cplusplus) && __cplusplus>=201103L
409 template <
class A,
class... B>
struct And
410 {
static const bool value=A::value &&
And<B...>::value;};
412 template <
class A>
struct And<A> {
static const bool value=A::value;};
414 template <
class A,
class... B>
struct Or
415 {
static const bool value=A::value || Or<B...>::value;};
417 template <
class A>
struct Or<A> {
static const bool value=A::value;};
419 template <
class A,
class B>
struct And
420 {
static const bool value=A::value && B::value;};
422 template <
class A,
class B>
struct Or
423 {
static const bool value=A::value || B::value;};
426 template <
int X,
int Y>
struct Eq
427 {
static const bool value=X==Y;};
431 template <
class T,
class U,
bool c=Or<is_const<T>,is_const<U> >::value>
struct transfer_const;
434 typedef typename add_const<U>::type type;
439 typedef typename remove_const<U>::type type;
444#define CLASSDESC_HAS_MEMBER(mem) \
445 template <class T, class Sig> \
446 struct has_member_##mem \
448 template <class U, Sig> struct SFINAE {}; \
449 template <class U> static char test(SFINAE<U,&U::mem>*); \
450 template <class U> static int test(...); \
451 const static bool value=sizeof(test<T>(0))==sizeof(char); \
455 CLASSDESC_HAS_MEMBER(resize);
459 public Or<has_member_resize<T,void (T::*)(typename T::size_type)>,
461 <T,void (T::*)(typename T::size_type, typename T::value_type)> > {};
465 resize(
T& x,
size_t n) {x.resize(n);}
468 typename enable_if<Not<has_resize<T> >,
void>::T
469 resize(T& x,
size_t n) {}
471 CLASSDESC_HAS_MEMBER(push_back);
472 CLASSDESC_HAS_MEMBER(erase);
476 public Or<has_member_push_back<T,void (T::*)(typename T::value_type)>,
478 <T,void (T::*)(const typename T::value_type&)> > {};
482 push_back(
T& x,
const typename T::value_type& v) {x.push_back(v);}
485 typename enable_if<Or<Not<has_push_back<T> >,is_const<T> >,
void>::T
486 push_back(T& x,
const typename T::value_type& v) {}
489 CLASSDESC_HAS_MEMBER(size);
490 template <
class T>
struct has_size:
public has_member_size<T,size_t (T::*)()const> {};
491 CLASSDESC_HAS_MEMBER(value_type);
492 template <
class T>
struct has_value_type:
public has_member_value_type<T,size_t (T::*)()const> {};
523 public And<is_default_constructible<T>, is_copy_constructible<T> > {};
526 template <
class T>
const T&
keyOf(
const T& x) {
return x;}
527 template <
class F,
class S>
const F&
keyOf(
const std::pair<F,S>& x) {
return x.first;}
532 static const bool value=is_dca<T>::value && !is_abstract<T>::value;
537 static const bool value=
false;
545 struct exception: std::runtime_error
547 exception(
const string& s=
"classdesc exception"): std::runtime_error(s) {}
550#if defined(__cplusplus) && __cplusplus>=201103L
551 template <
class Tp,
class EqualTo>
552 struct has_equality_operator_impl
554 template <
class U,
class V>
555 static auto test(U*) ->
decltype(std::declval<U>() == std::declval<V>());
556 template <
typename,
typename>
557 static auto test(...) -> std::false_type;
558 using type=
typename std::is_same<bool, decltype(test<Tp, EqualTo>(0))>::type;
560 template <
class T,
class EqualTo=T>
561 struct has_equality_operator:
public has_equality_operator_impl<T,EqualTo>::type {};
563 template <
class T,
class U>
564 struct has_equality_operator<std::pair<T,U>>:
565 public And<has_equality_operator<T>, has_equality_operator<U>> {};
571 template <
class T,
class Enable=
void>
struct tn;
575 std::string>
::T typeName();
577#if defined(__cplusplus) && __cplusplus>=201103L
579 template <
class T,
class... A> std::string varTn() {
return typeName<T>()+
","+varTn<A...>();}
580 template <
class T> std::string varTn() {
return typeName<T>();}
585 template <>
inline std::string typeName<bool>() {
return "bool";}
586 template <>
inline std::string typeName<char>() {
return "char";}
587 template <>
inline std::string typeName<short>() {
return "short";}
588 template <>
inline std::string typeName<int>() {
return "int";}
589 template <>
inline std::string typeName<long>() {
return "long";}
591 template <>
inline std::string typeName<signed char>() {
return "signed char";}
592 template <>
inline std::string typeName<unsigned char>() {
return "unsigned char";}
593 template <>
inline std::string typeName<unsigned short>(){
return "unsigned short";}
594 template <>
inline std::string typeName<unsigned int>() {
return "unsigned int";}
595 template <>
inline std::string typeName<unsigned long>() {
return "unsigned long";}
598 template <>
inline std::string typeName<long long>() {
return "long long";}
599 template <>
inline std::string typeName<unsigned long long>() {
return "unsigned long long";}
602 template <>
inline std::string typeName<float>() {
return "float";}
603 template <>
inline std::string typeName<double>() {
return "double";}
604 template <>
inline std::string typeName<long double>() {
return "long double";}
607 template <>
inline std::string typeName<std::string>() {
return "std::string";}
608 template <>
inline std::string typeName<std::wstring>() {
return "std::wstring";}
612#if __cplusplus>=201103L
613 template <>
inline std::string typeName<char16_t>() {
return "char16_t";}
614 template <>
inline std::string typeName<char32_t>() {
return "char32_t";}
619 inline typeName() {
return "<function>";}
623 inline typeName() {
return "<function>";}
625#if defined(__cplusplus) && __cplusplus>=201103L
626 template <
class F>
struct tn<std::function<F>>
628 static string name() {
return "std::function<"+typeName<F>()+
">";}
632 template <
class T>
struct tn<
T*>
634 static std::string name()
635 {
return typeName<T>()+
"*";}
638 template <
class T>
struct tn<
T&>
640 static std::string name()
641 {
return typeName<T>()+
"&";}
644 template <
class T>
struct tn<shared_ptr<
T> >
646 static std::string name()
647 {
return "classdesc::shared_ptr<"+typeName<T>()+
">";}
650#if defined(__cplusplus) && __cplusplus <= 201402
651#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
652#pragma GCC diagnostic push
653#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
655 template <
class T>
struct tn<
std::auto_ptr<T> >
657 static std::string name()
658 {
return "auto_ptr<"+typeName<T>()+
">";}
660#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
661#pragma GCC diagnostic pop
665#if defined(__cplusplus) && __cplusplus>=201103L
666 template <
class T>
struct tn<std::unique_ptr<T> >
668 static std::string name()
669 {
return "std::unique_ptr<"+typeName<T>()+
">";}
672 template <
class T, std::
size_t N>
struct tn<std::array<T,N> >
674 static std::string name()
675 {
return "std::array<"+typeName<T>()+
","+std::to_string(N)+
">";}
677 template <
class T>
struct tn<weak_ptr<
T> >
679 static std::string name()
680 {
return "std::weak_ptr<"+typeName<T>()+
">";}
684 template <
class T,
class A>
struct tn<
std::vector<T,A> >
686 static std::string name()
687 {
return "std::vector<"+typeName<T>()+
">";}
690 template <
class T,
class A>
struct tn<
std::list<T,A> >
692 static std::string name()
693 {
return "std::list<"+typeName<T>()+
">";}
696 template <
class T,
class A>
struct tn<
std::deque<T,A> >
698 static std::string name()
699 {
return "std::deque<"+typeName<T>()+
">";}
702 template <
class T,
class C,
class A>
struct tn<
std::set<T,C,A> >
704 static std::string name()
705 {
return "std::set<"+typeName<T>()+
">";}
708 template <
class K,
class V,
class C,
class A>
struct tn<
std::map<K,V,C,A> >
710 static std::string name()
711 {
return "std::map<"+typeName<K>()+
","+typeName<V>()+
">";}
714 template <
class T,
class C,
class A>
struct tn<
std::multiset<T,C,A> >
716 static std::string name()
717 {
return "std::multiset<"+typeName<T>()+
">";}
720 template <
class K,
class V,
class C,
class A>
struct tn<
std::multimap<K,V,C,A> >
722 static std::string name()
723 {
return "std::multimap<"+typeName<K>()+
","+typeName<V>()+
">";}
726 template <
class K,
class V>
struct tn<
std::pair<K,V> >
728 static std::string name()
729 {
return "std::pair<"+typeName<K>()+
","+typeName<V>()+
">";}
732#if defined(__cplusplus) && __cplusplus>=201103L
733 template <
class K,
class H,
class E,
class A>
struct tn<
std::unordered_set<K,H,E,A> >
735 static std::string name()
736 {
return "std::unordered_set<"+typeName<K>()+
">";}
738 template <
class K,
class H,
class E,
class A>
struct tn<std::unordered_multiset<K,H,E,A> >
740 static std::string name()
741 {
return "std::unordered_multiset<"+typeName<K>()+
">";}
743 template <
class K,
class V,
class C,
class A>
struct tn<std::unordered_map<K,V,C,A> >
745 static std::string name()
746 {
return "std::unordered_map<"+typeName<K>()+
","+typeName<V>()+
">";}
748 template <
class K,
class V,
class C,
class A>
struct tn<std::unordered_multimap<K,V,C,A> >
750 static std::string name()
751 {
return "std::unordered_multimap<"+typeName<K>()+
","+typeName<V>()+
">";}
764 typedef std::map<std::string,int> SVMap;
765 typedef std::map<int,std::string> VSMap;
773 EnumKeys(
const EnumKey* data,
int size)
775 for (
const EnumKey *i=data; i<data+size; i++)
777 s2v[i->name]=i->value;
778 v2s[i->value]=i->name;
781 T operator()(std::string key)
const {
782 SVMap::const_iterator i=s2v.find(key);
783 if (i!=s2v.end())
return T(i->second);
786 std::string operator()(
int val)
const
788 VSMap::const_iterator i=v2s.find(val);
789 if (i!=v2s.end())
return i->second;
792 std::string operator()(
T val)
const {
return operator()(
int(val));}
794 bool has(
T val)
const {
return v2s.count(val);}
795 bool has(
const std::string& s)
const {
return s2v.count(s);}
798 size_t size()
const {
return v2s.size();}
799 typedef VSMap::const_iterator iterator;
800 iterator begin()
const {
return v2s.begin();}
801 iterator end()
const {
return v2s.end();}
804 class Siterator:
public It
807 typedef string value_type;
808 typedef string* pointer;
809 typedef const string& reference;
811 Siterator(
const It& i): It(i) {}
812 const string& operator*()
const {
return It::operator*().second;}
813 const string* operator->()
const {
return &It::operator*().second;}
816 Siterator sbegin()
const {
return begin();}
817 Siterator
send()
const {
return end();}
819 class Viterator:
public It
822 typedef T value_type;
824 typedef const T& reference;
826 Viterator(
const It& i): It(i) {}
827 T operator*()
const {
return T(It::operator*().first);}
830 Viterator vbegin()
const {
return begin();}
831 Viterator vend()
const {
return end();}
838 static EnumKey keysData[];
839 static EnumKeys<T> keys;
843 template <
class T>
struct enum_keysData<const
T>:
public enum_keysData<T> {};
846 template <
class T>
int enumKey(
const std::string&);
847 template <
class T> std::string enumKey(
int);
851 enum_keys() {
return enum_keysData<T>::keys;}
855 {
return enum_keys<E>()(e);}
859 operator<<(std::ostream& o,
T x)
860 {
return o<<to_string(x);}
871 Enum_handle(
T& arg): ref(arg) {}
872 operator std::string()
const {
873 return enumKey<typename remove_const<T>::type>(
static_cast<int>(ref));
875 Enum_handle(
const Enum_handle& x): ref(x.ref) {}
876 operator int()
const {
return static_cast<int>(ref);}
877 const Enum_handle& operator=(
T x) {ref=x;
return *
this;}
878 const Enum_handle& operator=(
int x) {ref=
T(x);
return *
this;}
879 const Enum_handle& operator=(
const std::string& x)
880 {ref=
T(enumKey<T>(x));
return *
this;}
893 std::ostream& operator<<(std::ostream& o, Enum_handle<T> x)
895 o << static_cast<std::string>(x);
904 static std::string name()
905 {
return "classdesc::Enum_handle<"+typeName<T>()+
">";}
908 template <
class T,
int n>
struct tn<
T [n]>
910 static std::string name()
912 std::ostringstream os;
913 os << typeName<T>()<<
"["<<n<<
"]";
937 void operator()(
void *targ,
const string& desc,
T& arg) {}
941 inline std::string tail(
const string& x) {
943 std::string::size_type i=r.rfind(
'.');
944 return r.substr( i==std::string::npos? 0: i+1);
948 inline std::string head(
const string& x) {
950 std::string::size_type i=r.rfind(
'.');
951 return r.substr( 0, i==std::string::npos? std::string::npos: i);
959 {
typedef std::pair<K,V> T;};
967 struct ExcludeClass:
public T
970 template <
class U>
explicit ExcludeClass(
const U& x): T(x) {}
971#if __cplusplus>=201103L
972 template <
class... U>
explicit ExcludeClass(U... args): T(std::forward<U>(args)...) {}
974 template <
class U>
const T& operator=(
const U& x) {
return T::operator=(x);}
976 template <
class U>
operator const U&()
const {
return *(
const U*)
this;}
978 template <
class U>
operator U&() {
return *(U*)
this;}
984 struct ExcludeFundamental
987 typedef const T& ConstRefType;
989 ExcludeFundamental() {}
990 template <
class U>
explicit ExcludeFundamental(
const U& x): val(x) {}
991 template <
class U>
const T& operator=(
const U& x) {
return val=x;}
992 template <
class U>
operator U()
const {
return val;}
993 operator RefType () {
return val;}
994 operator ConstRefType ()
const {
return val;}
995 T operator+(
const T& x)
const {
return val+x;}
996 T operator-(
const T& x)
const {
return val-x;}
997 T operator*(
const T& x)
const {
return val*x;}
998 T operator/(
const T& x)
const {
return val/x;}
999 T operator%(
const T& x)
const {
return mod(val,x);}
1000 T operator+=(
const T& x) {
return val+=x;}
1001 T operator-=(
const T& x) {
return val-=x;}
1002 T operator*=(
const T& x) {
return val*=x;}
1003 T operator/=(
const T& x) {
return val/=x;}
1004 T operator%=(
const T& x) {val=mod(val,x);
return val;}
1005 bool operator==(
const T& x)
const {
return val==x;}
1006 bool operator==(
const ExcludeFundamental<T>& x)
const {
return val==x.val;}
1007 template <
class U>
bool operator!=(U x)
const {
return !operator==(x);}
1010 template <
class T>
struct Exclude:
public
1011 conditional<is_class<T>::value, ExcludeClass<T>, ExcludeFundamental<T> >
::T
1016#if __cplusplus>=201103L
1017 template <
class... U>
explicit Exclude(U... args): Super(std::forward<U>(args)...) {}
1019 template <
class U>
explicit Exclude(
const U& x): Super(x) {}
1020 template <
class U>
const T& operator=(
const U& x) {
return Super::operator=(x);}
1027 Exclude(): val(NULL) {}
1028#if __cplusplus>=201103L
1029 Exclude(std::nullptr_t): val(
nullptr) {}
1030 bool operator==(std::nullptr_t)
const {
return val==
nullptr;}
1032 bool operator==(
const T* x)
const {
return val==x;}
1033 bool operator==(
const Exclude<T*>& x)
const {
return val==x.val;}
1034 template <
class U>
bool operator!=(U x)
const {
return !operator==(x);}
1035 template <
class U>
explicit Exclude(
const U& x): val(x) {}
1036 template <
class U>
const T& operator=(U x) {
return *(val=x);}
1037 template <
class U>
operator U()
const {
return val;}
1038 T& operator*() {
return *val;}
1039 const T& operator*()
const {
return *val;}
1040 T* operator->() {
return val;}
1041 const T* operator->()
const {
return val;}
1044 operator+(U x) {
return val+x;}
1047 operator+(U x)
const {
return val+x;}
1048 std::ptrdiff_t operator-(
const T* x)
const {
return val-x;}
1051 template <
class T,
class U>
1057 std::ptrdiff_t operator-(
const T* x,
const Exclude<T*> y)
1058 {
return x-
static_cast<T*
>(y);}
1062 {
return x-
static_cast<T*
>(y);}
1064 template <
class T,
class U>
T mod(
T x, U y) {
return x%y;}
1065 template <
class U>
float mod(
float x, U y) {
return std::fmod(x,y);}
1066 template <
class U>
double mod(
double x, U y) {
return std::fmod(x,y);}
1071 struct Exclude<bool>
1073 typedef bool& RefType;
1074 typedef const bool& ConstRefType;
1077 template <
class U>
explicit Exclude(
const U& x): val(x) {}
1078 template <
class U>
bool operator=(
const U& x) {
return val=x;}
1079 template <
class U>
operator U()
const {
return val;}
1080 operator RefType () {
return val;}
1081 operator ConstRefType ()
const {
return val;}
1082 bool operator&&(
const bool& x)
const {
return val&&x;}
1083 bool operator||(
const bool& x)
const {
return val||x;}
1084 bool operator&=(
const bool& x) {
return val=val&&x;}
1085 bool operator|=(
const bool& x) {
return val=val||x;}
1086 bool operator!()
const {
return !val;}
1099 static std::string name()
1100 {
return "classdesc::Exclude<"+typeName<T>()+
">";}
1104 template <
class action_t>
1108 void operator()(action_t&,
const string&,U&) {}
1110 void type(action_t&,
const string&) {}
1120 static B& cast(C& x) {
return static_cast<B&
>(x);}
1122 static const B& cast(
const C& x) {
return static_cast<const B&
>(x);}
1129 string r(
".base_"+typeName<T>());
1130 for (
size_t i=1; i<r.size(); ++i)
1131 if (!isalnum(r[i])) r[i]=
'_';
1138 enum Type {boolean, int_number, float_number, string, array, object, null};
1141 template <>
inline std::string typeName<RESTProcessType::Type >()
1142 {
return "::classdesc::RESTProcessType::Type";}
1144 template <> EnumKey enum_keysData<RESTProcessType::Type >::keysData[]=
1146 {
"boolean",int(RESTProcessType::boolean)},
1147 {
"int_number",int(RESTProcessType::int_number)},
1148 {
"float_number",int(RESTProcessType::float_number)},
1149 {
"string",int(RESTProcessType::string)},
1150 {
"array",int(RESTProcessType::array)},
1151 {
"object",int(RESTProcessType::object)},
1152 {
"null",int(RESTProcessType::null)}
1154 template <>
EnumKeys<RESTProcessType::Type > enum_keysData<RESTProcessType::Type >::keys(enum_keysData<RESTProcessType::Type >::keysData,
sizeof(enum_keysData<RESTProcessType::Type >::keysData)/
sizeof(enum_keysData<RESTProcessType::Type >::keysData[0]));
1155 template <>
int enumKey<RESTProcessType::Type >(
const string& x){
return int(enum_keysData<RESTProcessType::Type >::keys(x));}
1156 template <>
string enumKey<RESTProcessType::Type >(
int x){
return enum_keysData<RESTProcessType::Type >::keys(x);}
1160 inline void log(
const std::string& msg)
1162#ifdef __EMSCRIPTEN__
1163 emscripten_console_log(msg.c_str());
1165 std::cout<<msg<<std::endl;
1171#if defined(__GNUC__) && !defined(__ICC)
1172#pragma GCC diagnostic pop
Definition classdesc.h:805
Definition classdesc.h:820
Definition classdesc.h:769
Definition classdesc.h:868
Definition classdesc.h:920
Definition classdesc.h:923
Definition classdesc.h:926
Definition classdesc.h:931
Definition classdesc.h:929
Definition classdesc.h:930
MPIbuf manipulator to send the MPIbuf's contents to a remote process.
Definition classdescMP.h:38
Contains definitions related to classdesc functionality.
const T & keyOf(const T &x)
utility key extraction function for associative containers
Definition classdesc.h:526
std::string typeName< void >()
a string representation of the type
Definition classdesc.h:584
void log(const std::string &msg)
allow logging to console in an emscripten environment.
Definition classdesc.h:1160
string basename()
returns a valid identifier to append to the descriptor of a base class
Definition classdesc.h:1127
Definition classdesc.h:420
Definition RESTProcess_epilogue.h:159
enum symbol handling
Definition classdesc.h:759
Definition classdesc.h:427
Definition classdesc.h:985
Definition classdesc.h:1012
helper for unpacking into map value_types
Definition classdesc.h:956
Definition classdesc.h:405
helper for constructing null descriptors
Definition classdesc.h:1106
Definition classdesc.h:423
types for RESTProcess and other embedding applications
Definition classdesc.h:1137
Definition classdesc.h:1118
Definition classdesc.h:936
Definition classdesc.h:274
controlled template specialisation: stolen from boost::enable_if.
Definition classdesc.h:282
Definition classdesc.h:505
Definition classdesc.h:478
Definition classdesc.h:461
Definition classdesc.h:490
Definition classdesc.h:492
determines if T is a standard associative container
Definition classdesc.h:321
determines if T is a container
Definition classdesc.h:358
has default constructor, and is copiable
Definition classdesc.h:523
Definition classdesc.h:1089
true_type if T is a std::pair
Definition classdesc.h:367
can a temporary of type T be constructed and passed to an argument
Definition classdesc.h:531
determines if T is a standard sequence container
Definition classdesc.h:302
type trait for the smart pointer concept
Definition classdesc.h:371
true_type if T is a StringKeyMap
Definition classdesc.h:364
determines if this is a string
Definition classdesc.h:313
Definition classdesc.h:382
Definition classdesc.h:571
transfer the constness property of T to U
Definition classdesc.h:431