28 #ifndef __RTTR_PROPERTY_CONTAINER_OBJECT_H__
29 #define __RTTR_PROPERTY_CONTAINER_OBJECT_H__
36 class property_container<object_ptr, C*, void, return_as_copy, set_value> :
public property_container_base
39 property_container(
const std::string& name,
const type declaring_type, C* pointer)
40 : property_container_base(name, declaring_type),
45 bool is_readonly()
const {
return false; }
46 bool is_static()
const {
return true; }
47 type get_type()
const {
return type::get<C>(); }
48 bool is_array()
const {
return detail::is_array<C>::value; }
50 bool set_value(detail::instance&
object, detail::argument& arg)
const
54 return property_accessor<C>::set_value(*_accessor, arg);
62 variant get_value(detail::instance&
object)
const
64 return (variant(*_accessor));
76 class property_container<object_ptr, C*, void, return_as_copy, read_only> :
public property_container_base
79 property_container(
const std::string& name,
const type declaring_type, C* pointer)
80 : property_container_base(name, declaring_type),
85 bool is_readonly()
const {
return true; }
86 bool is_static()
const {
return true; }
87 type get_type()
const {
return type::get<C>(); }
88 bool is_array()
const {
return detail::is_array<C>::value; }
90 bool set_value(detail::instance&
object, detail::argument& arg)
const
95 variant get_value(detail::instance&
object)
const
97 return (variant(*_accessor));
109 class property_container<object_ptr, C*, void, return_as_ptr, set_as_ptr> :
public property_container_base
112 property_container(
const std::string& name,
const type declaring_type, C* pointer)
113 : property_container_base(name, declaring_type),
116 static_assert(!std::is_pointer<C>::value,
"The given type is already a pointer type!");
119 bool is_readonly()
const {
return false; }
120 bool is_static()
const {
return true; }
121 type get_type()
const {
return type::get<C*>(); }
122 bool is_array()
const {
return detail::is_array<C>::value; }
124 bool set_value(detail::instance&
object, detail::argument& arg)
const
126 if (arg.is_type<C*>())
128 return property_accessor<C*>::set_value(_accessor, arg);
136 variant get_value(detail::instance&
object)
const
138 return (variant(_accessor));
150 class property_container<object_ptr, C*, void, return_as_ptr, read_only> :
public property_container_base
153 property_container(
const std::string& name,
const type declaring_type, C* pointer)
154 : property_container_base(name, declaring_type),
159 bool is_readonly()
const {
return true; }
160 bool is_static()
const {
return true; }
161 type get_type()
const {
return type::get<typename std::add_const<C>::type*>(); }
162 bool is_array()
const {
return detail::is_array<C>::value; }
164 bool set_value(detail::instance&
object, detail::argument& arg)
const
169 variant get_value(detail::instance&
object)
const
171 return (variant(const_cast<const C*>(_accessor)));
178 #endif // __RTTR_PROPERTY_CONTAINER_OBJECT_H__