CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ClassProperty Class Referenceabstract

Represents a reflected property from metadata defined by the class. More...

#include <CeresEngine/Reflection/Class.hpp>

Inheritance diagram for CeresEngine::ClassProperty:
CeresEngine::ClassMember CeresEngine::MetaItem CeresEngine::MetaAccessorProperty< GetterType, SetterType > CeresEngine::MetaPointerProperty< PointerType >

Public Member Functions

 ClassProperty (Class &owner, StringView name)
 
 ~ClassProperty () noexcept override
 
MetaCategory getCategory () const final
 Gets the category of the item.
 
virtual bool isStatic () const noexcept=0
 Determines if the property is static or not.
 
virtual bool isReadOnly () const noexcept=0
 Determines if the property is read-only and cannot be set.
 
TypeID getTypeID () const noexcept
 
Type getType () const
 
virtual TypeID getGetterReturnTypeID () const noexcept=0
 
Type getGetterReturnType () const
 
virtual Box get (const Box &target) const =0
 Gets the property value.
 
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.
 
virtual TypeID getSetterParameterTypeID () const noexcept=0
 
Type getSetterParameterType () const
 
virtual void set (const Box &target, const Box &value) const =0
 Sets the property value.
 
virtual void set (const Box &target, Box &&value) const =0
 
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
 

Public Attributes

StringView name
 
ReflectionAttributeContainer attributes
 

Static Public Attributes

static constexpr MetaCategory kCategory = MetaCategory::Property
 Gets the category of the item.
 

Detailed Description

Represents a reflected property from metadata defined by the class.

Constructor & Destructor Documentation

◆ ClassProperty()

CeresEngine::ClassProperty::ClassProperty ( Class owner,
StringView  name 
)
explicit

◆ ~ClassProperty()

CeresEngine::ClassProperty::~ClassProperty ( )
overridenoexcept

Member Function Documentation

◆ get() [1/3]

Box CeresEngine::ClassProperty::get ( ) const

Gets the value of a static property.

Returns
The value of the static property.

◆ get() [2/3]

virtual Box CeresEngine::ClassProperty::get ( const Box target) const
pure virtual

Gets the property value.

Parameters
target
Returns

Implemented in CeresEngine::MetaPointerProperty< PointerType >, and CeresEngine::MetaAccessorProperty< GetterType, SetterType >.

◆ get() [3/3]

template<typename T >
requires (!std::is_same_v<std::decay_t<T>, Box> && !std::is_same_v<std::decay_t<T>, Box>)
auto CeresEngine::ClassProperty::get ( T target) const
inline

◆ getCategory()

MetaCategory CeresEngine::ClassProperty::getCategory ( ) const
inlinefinalvirtual

Gets the category of the item.

Implements CeresEngine::MetaItem.

◆ getGetterReturnType()

Type CeresEngine::ClassProperty::getGetterReturnType ( ) const

◆ getGetterReturnTypeID()

virtual TypeID CeresEngine::ClassProperty::getGetterReturnTypeID ( ) const
pure virtualnoexcept

◆ getSetterParameterType()

Type CeresEngine::ClassProperty::getSetterParameterType ( ) const

◆ getSetterParameterTypeID()

virtual TypeID CeresEngine::ClassProperty::getSetterParameterTypeID ( ) const
pure virtualnoexcept

◆ getType()

Type CeresEngine::ClassProperty::getType ( ) const

◆ getTypeID()

TypeID CeresEngine::ClassProperty::getTypeID ( ) const
noexcept

◆ isReadOnly()

virtual bool CeresEngine::ClassProperty::isReadOnly ( ) const
pure virtualnoexcept

Determines if the property is read-only and cannot be set.

Implemented in CeresEngine::MetaPointerProperty< PointerType >, and CeresEngine::MetaAccessorProperty< GetterType, SetterType >.

◆ isStatic()

virtual bool CeresEngine::ClassProperty::isStatic ( ) const
pure virtualnoexcept

◆ set() [1/10]

void CeresEngine::ClassProperty::set ( Box &&  value) const

◆ set() [2/10]

virtual void CeresEngine::ClassProperty::set ( const Box target,
Box &&  value 
) const
pure virtual

◆ set() [3/10]

virtual void CeresEngine::ClassProperty::set ( const Box target,
const Box value 
) const
pure virtual

Sets the property value.

Parameters
targetThe target instance to set the property on.
valueThe value to the set the property to.

Implemented in CeresEngine::MetaPointerProperty< PointerType >, and CeresEngine::MetaAccessorProperty< GetterType, SetterType >.

◆ set() [4/10]

void CeresEngine::ClassProperty::set ( const Box value) const

Sets the property value.

This overload is only used for static properties.

Parameters
valueThe value to the set the property to.

◆ set() [5/10]

template<typename V >
requires (!std::is_same_v<std::decay_t<V>, Box>)
void CeresEngine::ClassProperty::set ( const V value) const
inline

◆ set() [6/10]

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 CeresEngine::ClassProperty::set ( T target,
const V value 
) const
inline

◆ set() [7/10]

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 CeresEngine::ClassProperty::set ( T target,
V &&  value 
) const
inline

◆ set() [8/10]

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 CeresEngine::ClassProperty::set ( T target,
V value 
) const
inline

◆ set() [9/10]

template<typename V >
requires (!std::is_same_v<std::decay_t<V>, Box>)
void CeresEngine::ClassProperty::set ( V &&  value) const
inline

◆ set() [10/10]

template<typename V >
requires (!std::is_same_v<std::decay_t<V>, Box>)
void CeresEngine::ClassProperty::set ( V value) const
inline

Member Data Documentation

◆ attributes

ReflectionAttributeContainer CeresEngine::ClassProperty::attributes

◆ kCategory

constexpr MetaCategory CeresEngine::ClassProperty::kCategory = MetaCategory::Property
staticconstexpr

Gets the category of the item.

◆ name

StringView CeresEngine::ClassProperty::name

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