3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Reflection.IReflectedField Class Referenceabstract

Metadata interface for a reflected field. More...

#include <IReflectedField.hpp>

Inheritance diagram for Engine3DRadSpace.Reflection.IReflectedField:

Public Member Functions

IntPtr Get (IntPtr objPtr)
void Set (IntPtr objPtr, IntPtr value)
const size_t TypeHash () const noexcept
 Type hash of the field's type, usually typeid(T).hash_code() for the field's type T.
const std::string & FieldName () const noexcept
 Name of the field.
const std::string & FieldDesc () const noexcept
 Description of the field.
const size_t TypeSize () const noexcept
 Size of the field's type in bytes.
const ptrdiff_t FieldOffset () const noexcept
 Offset of the field within the object, in bytes.
virtual const void * Get (void *objPtr) const =0
 Gets the value of the field from the given object pointer.
virtual void Set (void *objPtr, const void *value) const =0
 Sets the value of the field in the given object pointer.
template<typename T>
const T GetAtOffset (void *objPtr, intptr_t offset) const
 Gets the type T with an additional offset from the field's offset within the object.
virtual const void * DefaultValue () const =0
 Returns a pointer to the default value of the field's type.
virtual FieldRepresentation Representation () const =0
 Returns the field representation type.
virtual std::unique_ptr< IReflectedField > Clone () const =0
 Performs a deep copy of this instance.
virtual ~IReflectedField ()=default

Protected Member Functions

 IReflectedField ()=default
 IReflectedField (size_t offset, size_t size, const std::string &name, const std::string &desc, const std::type_info &info)
 IReflectedField (const IReflectedField &f)=default
 IReflectedField (IReflectedField &&)=default
IReflectedField & operator= (const IReflectedField &f)=default
IReflectedField & operator= (IReflectedField &&f)=default

Protected Attributes

size_t _typeHash = 0
std::type_index _typeIndex
size_t _size = 0
size_t _offset = 0
std::string _name
std::string _desc

Properties

ulong TypeHash [get]
string FieldName [get]
string FieldDesc [get]
ulong TypeSize [get]
ulong FieldOffset [get]
IntPtr DefaultValue [get]

Detailed Description

Metadata interface for a reflected field.

Constructor & Destructor Documentation

◆ IReflectedField() [1/4]

Engine3DRadSpace.Reflection.IReflectedField.IReflectedField ( )
protecteddefault

◆ IReflectedField() [2/4]

IReflectedField::IReflectedField ( size_t offset,
size_t size,
const std::string & name,
const std::string & desc,
const std::type_info & info )
protected

◆ IReflectedField() [3/4]

Engine3DRadSpace.Reflection.IReflectedField.IReflectedField ( const IReflectedField & f)
protecteddefault

◆ IReflectedField() [4/4]

Engine3DRadSpace.Reflection.IReflectedField.IReflectedField ( IReflectedField && )
protecteddefault

◆ ~IReflectedField()

virtual Engine3DRadSpace.Reflection.IReflectedField.~IReflectedField ( )
virtualdefault

Member Function Documentation

◆ Clone()

◆ DefaultValue()

◆ FieldDesc()

const std::string & IReflectedField::FieldDesc ( ) const
noexcept

Description of the field.

Returns
Field description

◆ FieldName()

const std::string & IReflectedField::FieldName ( ) const
noexcept

Name of the field.

Returns
Field name

◆ FieldOffset()

Offset of the field within the object, in bytes.

Returns
Offset of the field within the object, in bytes

◆ Get() [1/2]

IntPtr Engine3DRadSpace.Reflection.IReflectedField.Get ( IntPtr objPtr)

◆ Get() [2/2]

◆ GetAtOffset()

template<typename T>
const T Engine3DRadSpace.Reflection.IReflectedField.GetAtOffset ( void * objPtr,
intptr_t offset ) const
inline

Gets the type T with an additional offset from the field's offset within the object.

Template Parameters
TType
Parameters
objPtrObject containing this field
offsetadditional offset in bytes
Returns

◆ operator=() [1/2]

IReflectedField & Engine3DRadSpace.Reflection.IReflectedField.operator= ( const IReflectedField & f)
protecteddefault

◆ operator=() [2/2]

IReflectedField & Engine3DRadSpace.Reflection.IReflectedField.operator= ( IReflectedField && f)
protecteddefault

◆ Representation()

◆ Set() [1/2]

void Engine3DRadSpace.Reflection.IReflectedField.Set ( IntPtr objPtr,
IntPtr value )

◆ Set() [2/2]

◆ TypeHash()

const size_t IReflectedField::TypeHash ( ) const
noexcept

Type hash of the field's type, usually typeid(T).hash_code() for the field's type T.

Returns

◆ TypeSize()

Size of the field's type in bytes.

Returns
Size of the field's type in bytes

Member Data Documentation

◆ _desc

std::string Engine3DRadSpace.Reflection.IReflectedField._desc
protected

◆ _name

std::string Engine3DRadSpace.Reflection.IReflectedField._name
protected

◆ _offset

size_t Engine3DRadSpace.Reflection.IReflectedField._offset = 0
protected

◆ _size

size_t Engine3DRadSpace.Reflection.IReflectedField._size = 0
protected

◆ _typeHash

size_t Engine3DRadSpace.Reflection.IReflectedField._typeHash = 0
protected

◆ _typeIndex

std::type_index Engine3DRadSpace.Reflection.IReflectedField._typeIndex
protected

Property Documentation

◆ DefaultValue

IntPtr Engine3DRadSpace.Reflection.IReflectedField.DefaultValue
get

◆ FieldDesc

string Engine3DRadSpace.Reflection.IReflectedField.FieldDesc
get

◆ FieldName

string Engine3DRadSpace.Reflection.IReflectedField.FieldName
get

◆ FieldOffset

ulong Engine3DRadSpace.Reflection.IReflectedField.FieldOffset
get

◆ TypeHash

ulong Engine3DRadSpace.Reflection.IReflectedField.TypeHash
get

◆ TypeSize

ulong Engine3DRadSpace.Reflection.IReflectedField.TypeSize
get

The documentation for this class was generated from the following files: