cgv
Loading...
Searching...
No Matches
reflection_traits_info.h
1#pragma once
2
3#include <cgv/type/cond/is_base_of.h>
4#include <cgv/type/cond/is_standard_type.h>
5#include "reflection_traits.h"
6#include "reflect_config.h"
7
8namespace cgv {
9 namespace reflect {
10
11template <bool is_self,typename T>
13{
14 static T* get_dummy_ptr() { return 0; }
15 static const bool use_get = true;
16#ifdef REFLECT_TRAITS_WITH_DECLTYPE
17 typedef decltype(get_reflection_traits(*get_dummy_ptr())) traits_type;
18 static const ReflectionTraitsKind kind = traits_type::kind;
19#else
20 static const ReflectionTraitsKind kind = RTK_EXTERNAL_SELF_REFLECT;
21#endif
22};
23
24template <typename T>
26{
27 static const ReflectionTraitsKind kind = RTK_SELF_REFLECT;
28 static const bool use_get = false;
30};
31
32template <bool is_std, typename T>
33struct reflection_traits_info_std : public reflection_traits_info_self<cgv::type::cond::is_base_of<self_reflection_tag, T>::value, T> {};
34
35template <typename T>
37{
38 static const ReflectionTraitsKind kind = RTK_STD_TYPE;
39 static const bool use_get = false;
41};
42
44
52template <typename T>
53struct reflection_traits_info : public reflection_traits_info_std<cgv::type::cond::is_standard_type<T>::value, T>
54{
55};
56
57 }
58}
59
60#include <cgv/config/lib_end.h>
ReflectionTraitsKind
different types of reflection traits
the cgv namespace
Definition print.h:11
the reflection_traits_info defines compile time information about reflection_traits for a given type ...
Default implementation of the reflection traits providing type specific interface.