CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::MetaPointerProperty< PointerType > Class Template Reference

An implementation of MetaProperty that uses a direct pointer (or pointer to member) to access the property. More...

#include <CeresEngine/Reflection/Class.define.hpp>

Inheritance diagram for CeresEngine::MetaPointerProperty< PointerType >:
CeresEngine::ClassProperty CeresEngine::ClassMember CeresEngine::MetaItem

Public Member Functions

 MetaPointerProperty (Class &owner, const StringView name, PointerType pointer) noexcept
 Creates a new property by using a pointer.
 
bool isStatic () const noexcept override
 
bool isReadOnly () const noexcept override
 
TypeID getGetterReturnTypeID () const noexcept override
 
TypeID getSetterParameterTypeID () const noexcept override
 
Box get (const Box &target) const override
 
void set (const Box &target, const Box &value) const override
 
void set (const Box &target, Box &&value) const override
 
- Public Member Functions inherited from CeresEngine::ClassProperty
 ClassProperty (Class &owner, StringView name)
 
 ~ClassProperty () noexcept override
 
MetaCategory getCategory () const final
 Gets the category of the item.
 
TypeID getTypeID () const noexcept
 
Type getType () const
 
Type getGetterReturnType () const
 
template<typename T >
requires (!std::is_same_v<std::decay_t<T>, Box> && !std::is_same_v<std::decay_t<T>, Box>)
auto get (T &target) const
 
Box get () const
 Gets the value of a static property.
 
Type getSetterParameterType () const
 
template<typename T , typename V >
requires (!std::is_same_v<std::decay_t<T>, Box> && !std::is_same_v<std::decay_t<V>, Box>)
void set (T &target, const V &value) const
 
template<typename T , typename V >
requires (!std::is_same_v<std::decay_t<T>, Box> && !std::is_same_v<std::decay_t<V>, Box>)
void set (T &target, V &value) const
 
template<typename T , typename V >
requires (!std::is_same_v<std::decay_t<T>, Box> && !std::is_same_v<std::decay_t<V>, Box>)
void set (T &target, V &&value) const
 
void set (const Box &value) const
 Sets the property value.
 
void set (Box &&value) const
 
template<typename V >
requires (!std::is_same_v<std::decay_t<V>, Box>)
void set (const V &value) const
 
template<typename V >
requires (!std::is_same_v<std::decay_t<V>, Box>)
void set (V &value) const
 
template<typename V >
requires (!std::is_same_v<std::decay_t<V>, Box>)
void set (V &&value) const
 
- Public Member Functions inherited from CeresEngine::MetaItem
virtual ~MetaItem () noexcept=default
 

Private Types

using AccessorTraits = internal::MetaPropertyAccessorInternal< PointerType, internal::MetaPropertyAccessorTag< PointerType > >
 

Private Attributes

const PointerType mPointer
 The property pointer. Can be eiter a raw pointer or a pointer to data member.
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::ClassProperty
StringView name
 
ReflectionAttributeContainer attributes
 
- Static Public Attributes inherited from CeresEngine::ClassProperty
static constexpr MetaCategory kCategory = MetaCategory::Property
 Gets the category of the item.
 

Detailed Description

template<typename PointerType>
class CeresEngine::MetaPointerProperty< PointerType >

An implementation of MetaProperty that uses a direct pointer (or pointer to member) to access the property.

Template Parameters
PointerTypeThe type of the property pointer.

Member Typedef Documentation

◆ AccessorTraits

template<typename PointerType >
using CeresEngine::MetaPointerProperty< PointerType >::AccessorTraits = internal::MetaPropertyAccessorInternal<PointerType, internal::MetaPropertyAccessorTag<PointerType> >
private

Constructor & Destructor Documentation

◆ MetaPointerProperty()

template<typename PointerType >
CeresEngine::MetaPointerProperty< PointerType >::MetaPointerProperty ( Class owner,
const StringView  name,
PointerType  pointer 
)
inlineexplicitnoexcept

Creates a new property by using a pointer.

Parameters
ownerThe class that owns the property.
nameThe name of the property.
pointerThe pointer to be used to access the property.

Member Function Documentation

◆ get()

template<typename PointerType >
Box CeresEngine::MetaPointerProperty< PointerType >::get ( const Box target) const
inlineoverridevirtual

◆ getGetterReturnTypeID()

template<typename PointerType >
TypeID CeresEngine::MetaPointerProperty< PointerType >::getGetterReturnTypeID ( ) const
inlineoverridevirtualnoexcept

◆ getSetterParameterTypeID()

template<typename PointerType >
TypeID CeresEngine::MetaPointerProperty< PointerType >::getSetterParameterTypeID ( ) const
inlineoverridevirtualnoexcept

◆ isReadOnly()

template<typename PointerType >
bool CeresEngine::MetaPointerProperty< PointerType >::isReadOnly ( ) const
inlineoverridevirtualnoexcept

◆ isStatic()

template<typename PointerType >
bool CeresEngine::MetaPointerProperty< PointerType >::isStatic ( ) const
inlineoverridevirtualnoexcept

◆ set() [1/2]

template<typename PointerType >
void CeresEngine::MetaPointerProperty< PointerType >::set ( const Box target,
Box &&  value 
) const
inlineoverridevirtual

◆ set() [2/2]

template<typename PointerType >
void CeresEngine::MetaPointerProperty< PointerType >::set ( const Box target,
const Box value 
) const
inlineoverridevirtual

Member Data Documentation

◆ mPointer

template<typename PointerType >
const PointerType CeresEngine::MetaPointerProperty< PointerType >::mPointer
private

The property pointer. Can be eiter a raw pointer or a pointer to data member.


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