10#include "Refureku/TypeInfo/Variables/FieldBase.h"
11#include "Refureku/TypeInfo/Cast.h"
12#include "Refureku/TypeInfo/MethodFieldHelpers.h"
13#include "Refureku/Exceptions/InvalidArchetype.h"
20 REFUREKU_INTERNAL
Field(
char const* name,
25 std::size_t memoryOffset,
26 Entity const* outerEntity =
nullptr)
noexcept;
28 REFUREKU_INTERNAL
~Field()
noexcept;
48 template <
typename ValueType,
typename InstanceType,
typename = std::enable_if_t<is_value_v<InstanceType> &&
internal::IsAdjustableInstanceValue<InstanceType>>>
49 RFK_NODISCARD ValueType
get(InstanceType& instance)
const;
73 template <
typename ValueType>
74 RFK_NODISCARD ValueType
getUnsafe(
void* instance)
const;
99 template <
typename ValueType>
100 RFK_NODISCARD ValueType
getUnsafe(
void const* instance)
const;
116 template <
typename ValueType,
typename InstanceType,
typename = std::enable_if_t<is_value_v<InstanceType> &&
internal::IsAdjustableInstanceValue<InstanceType>>>
117 void set(InstanceType& instance,
118 ValueType&& value)
const;
130 template <
typename InstanceType,
typename = std::enable_if_t<is_value_v<InstanceType> &&
internal::IsAdjustableInstanceValue<InstanceType>>>
131 void set(InstanceType& instance,
132 void const* valuePtr,
133 std::size_t valueSize)
const;
151 template <
typename ValueType>
153 ValueType&& value)
const;
165 void const* valuePtr,
166 std::size_t valueSize)
const;
178 template <
typename InstanceType,
typename = std::enable_if_t<is_value_v<InstanceType> &&
internal::IsAdjustableInstanceValue<InstanceType>>>
179 RFK_NODISCARD
void*
getPtr(InstanceType& instance)
const;
194 RFK_NODISCARD REFUREKU_API
206 template <
typename InstanceType,
typename = std::enable_if_t<is_value_v<InstanceType> &&
internal::IsAdjustableInstanceValue<InstanceType>>>
207 RFK_NODISCARD
void const*
getConstPtr(InstanceType
const& instance)
const;
219 RFK_NODISCARD REFUREKU_API
227 RFK_NODISCARD REFUREKU_API std::size_t
234 RFK_GEN_GET_PIMPL(FieldImpl,
Entity::getPimpl())
248 template <typename InstanceType>
249 RFK_NODISCARD InstanceType* adjustInstancePointerAddress(InstanceType* instance) const;
255 #include "Refureku/TypeInfo/Variables/Field.inl"
Definition: Allocator.h:19
Definition: FieldBase.h:20
RFK_NODISCARD REFUREKU_API void * getPtrUnsafe(void *instance) const
Get a pointer to this field in the provided instance. This method DOES NOT perform any pointer adjust...
REFUREKU_API void setUnsafe(void *instance, void const *valuePtr, std::size_t valueSize) const
Copy valueSize bytes starting from valuePtr into this field's address in instance.
RFK_NODISCARD ValueType getUnsafe(void *instance) const
Get the value corresponding to this field in the provided instance. This method in not safe if you pr...
void set(InstanceType &instance, ValueType &&value) const
Set the value corresponding to this field in the provided instance. This method is not safe if you pr...
RFK_NODISCARD ValueType get(InstanceType &instance) const
Get the value corresponding to this field in the provided instance. This method in not safe if you pr...
RFK_NODISCARD void * getPtr(InstanceType &instance) const
Get a pointer to this field in the provided instance.
void set(InstanceType &instance, void const *valuePtr, std::size_t valueSize) const
Copy valueSize bytes starting from valuePtr into this field's address in instance.
void setUnsafe(void *instance, ValueType &&value) const
Set the value corresponding to this field in the provided instance. This method is not safe if you pr...
RFK_NODISCARD REFUREKU_API void const * getConstPtrUnsafe(void const *instance) const noexcept
Get a const pointer to this field in the provided instance. This method DOES NOT perform any pointer ...
RFK_NODISCARD void const * getConstPtr(InstanceType const &instance) const
Get a const pointer to this field in the provided instance.
RFK_NODISCARD REFUREKU_API std::size_t getMemoryOffset() const noexcept
Get the memory offset of this field in an instance of its owner class (Field::getOwner()).
RFK_NODISCARD ValueType getUnsafe(void const *instance) const
Get the value corresponding to this field in the provided instance. This method in not safe if you pr...
Definition: Allocator.h:16
EFieldFlags
Definition: EFieldFlags.h:16