1 #ifndef SIPLASPLAS_REFLECTION_DYNAMIC_OBJECT_HPP 2 #define SIPLASPLAS_REFLECTION_DYNAMIC_OBJECT_HPP 13 namespace dynamic_reflection
16 class SIPLASPLAS_REFLECTION_DYNAMIC_EXPORT
Object 19 static constexpr
bool ConstructReference =
true;
31 template<
typename T,
typename = std::enable_if_t<
33 !std::is_same<std::decay_t<T>,
Object>::value &&
34 !std::is_pointer<std::decay_t<T>>::value
37 _type{cpp::dynamic_reflection::Type::get<std::decay_t<T>>()},
39 _object{_type.copy_construct(&value)}
42 Object(
const T* pointer) :
43 _type{cpp::dynamic_reflection::Type::get<T*>()},
45 _object{
const_cast<T*
>(pointer)}
48 Object(
const Object& other);
49 Object(Object&& other);
50 Object& operator=(
const Object& other);
51 Object& operator=(Object&& other);
55 Object& operator=(
const T& value)
64 return *
reinterpret_cast<std::remove_reference_t<T>*
>(_object);
74 bool isReference()
const;
78 const void* raw()
const;
81 std::string toString()
const;
82 static Object fromString(
const std::string& typeName,
const std::string& value);
95 #endif // SIPLASPLAS_REFLECTION_DYNAMIC_OBJECT_HPP
Definition: messaging.hpp:8
void destroy(T &object)
Invokes the destructor of an object.
Definition: destroy.hpp:16
Definition: object.hpp:16