cgv
Loading...
Searching...
No Matches
reflect_extern.h
1#pragma once
2
3#include "reflection_traits.h"
4
5#include "lib_begin.h"
6
7namespace cgv {
8 namespace reflect {
9
11template <typename D, typename B>
13{
14 static const ReflectionTraitsKind kind = RTK_EXTERNAL_SELF_REFLECT;
16 static const bool has_external = true;
20 bool has_external_implementation() const { return true; }
22 bool external_implementation(reflection_handler& rh, void* member_ptr) { return static_cast<D*>(member_ptr)->self_reflect(rh); }
23};
24
26template <typename T, typename D>
27struct extern_reflection_traits : public extern_reflection_traits_impl<D, reflection_traits<T,RTK_EXTERNAL_SELF_REFLECT,false> >
28{
31};
32
34template <typename T, typename D>
35struct extern_string_reflection_traits : public extern_reflection_traits_impl<D, reflection_traits<T,RTK_EXTERNAL_SELF_REFLECT> >
36{
39};
40
41 }
42}
43
44#include <cgv/config/lib_end.h>
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
ReflectionTraitsKind
different types of reflection traits
the cgv namespace
Definition print.h:11
abstract interface for type reflection with basic type management and optional string conversion
this reflection traits implementation is used by the reflect_string function
D external_self_reflect_type
compile time information about external type with self_reflect implementation
bool external_implementation(reflection_handler &rh, void *member_ptr)
call the external implementation
bool has_external_implementation() const
whether type can be converted to string, defaults to false
static const bool has_external
compile information about external implementation
this reflection traits implementation is used for external self_reflect implementations of instances ...
abst_reflection_traits * clone()
clone function
this reflection traits implementation is used for external self_reflect implementations together with...
abst_reflection_traits * clone()
clone function