Refureku v2.2.0
C++17 runtime reflection library.
rfk Namespace Reference

Classes

class  Allocator
 
class  Archetype
 
class  ArchetypeRegisterer
 
class  ArgCountMismatch
 
class  ArgTypeMismatch
 
class  BadNamespaceFormat
 
class  ClassTemplate
 
class  ClassTemplateInstantiation
 
class  ClassTemplateInstantiationRegisterer
 
class  ConstViolation
 
struct  CopyConstness
 Helper type traits class that copy the constness of a type to a target type. ex: CopyConstness<int, float>::Type yields float CopyConstness<int const, float>::Type yields float const. More...
 
struct  CopyConstness< Source const, Target >
 
class  Database
 
class  DefaultEntityRegisterer
 
class  Entity
 
class  Enum
 
class  EnumValue
 
class  Field
 
class  FieldBase
 
class  Function
 
class  FunctionBase
 
class  FunctionParameter
 
class  FundamentalArchetype
 
class  ICallable
 
class  InvalidArchetype
 
class  MemberFunction
 
class  MemberFunction< CallerType, ReturnType(ArgTypes...)>
 
class  Method
 
class  MethodBase
 
class  Namespace
 
class  NamespaceFragment
 
class  NamespaceFragmentRegisterer
 
class  NonMemberFunction
 
class  NonMemberFunction< ReturnType(ArgTypes...)>
 
class  NonTypeTemplateArgument
 
class  NonTypeTemplateParameter
 
class  Object
 
class  ParentStruct
 
class  Pimpl
 
class  Property
 Base class to inherit from to define new properties. More...
 
class  ReturnTypeMismatch
 
class  StaticField
 
class  StaticMethod
 
class  Struct
 
class  TemplateArgument
 
class  TemplateParameter
 
class  TemplateTemplateArgument
 
class  TemplateTemplateParameter
 
class  Type
 
class  TypeMismatch
 
class  TypePart
 
class  TypeTemplateArgument
 
class  TypeTemplateParameter
 
class  Variable
 
class  VariableBase
 
class  Vector
 

Typedefs

using uint8 = uint8_t
 
using uint16 = uint16_t
 
using uint32 = uint32_t
 
using uint64 = uint64_t
 
using int8 = int8_t
 
using int16 = int16_t
 
using int32 = int32_t
 
using int64 = int64_t
 
template<typename T >
using Predicate = bool(*)(T const &value, void *userData)
 Predicate defining if a value is valid or not. More...
 
template<typename T >
using SharedPtr = std::shared_ptr< T >
 
template<typename T , class Deleter = std::default_delete<T>>
using UniquePtr = std::unique_ptr< T, Deleter >
 
template<typename T >
using Visitor = bool(*)(T const &value, void *userData)
 Visitor function. More...
 
using Class = Struct
 
using StructTemplate = ClassTemplate
 
using StructTemplateInstantiation = ClassTemplateInstantiation
 

Enumerations

enum class  EClassKind { Standard , Template , TemplateInstantiation }
 Defines the kind of a rfk::Class or a rfk::Struct instance: More...
 
enum class  ETemplateParameterKind { NonTypeTemplateParameter , TypeTemplateParameter , TemplateTemplateParameter }
 Defines the kind of a template parameter. More...
 
enum class  EAccessSpecifier : uint8 { Undefined = 0 , Public = 1 , Protected = 2 , Private = 3 }
 
enum class  EEntityKind : uint16 {
  Undefined = 0u , Namespace = 1 << 0 , Class = 1 << 1 , Struct = 1 << 2 ,
  Enum = 1 << 3 , FundamentalArchetype = 1 << 4 , Variable = 1 << 5 , Field = 1 << 6 ,
  Function = 1 << 7 , Method = 1 << 8 , EnumValue = 1 << 9 , NamespaceFragment = 1 << 10
}
 
enum class  ETypePartDescriptor : uint16 {
  Undefined = 0 , Const = 1 << 0 , Volatile = 1 << 2 , Ptr = 1 << 3 ,
  LRef = 1 << 4 , RRef = 1 << 5 , CArray = 1 << 6 , Value = 1 << 7
}
 
enum class  EFunctionFlags : uint8 { Default = 0 , Static = 1 << 0 , Inline = 1 << 1 }
 
enum class  EMethodFlags : uint16 {
  Default = 0 , Public = 1 << 0 , Protected = 1 << 1 , Private = 1 << 2 ,
  Static = 1 << 3 , Inline = 1 << 4 , Virtual = 1 << 5 , PureVirtual = 1 << 6 ,
  Override = 1 << 7 , Final = 1 << 8 , Const = 1 << 9
}
 
enum class  EFieldFlags : uint8 {
  Default = 0 , Public = 1 << 0 , Protected = 1 << 1 , Private = 1 << 2 ,
  Static = 1 << 3 , Mutable = 1 << 4
}
 
enum class  EVarFlags : uint8 { Default = 0 , Static = 1 << 0 }
 

Functions

template<typename T , typename... Args>
SharedPtr< T > makeShared (Args &&... args)
 
template<typename T , typename... Args>
UniquePtr< T > makeUnique (Args &&... args)
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Property const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Property const *, rfk::Allocator< Property const * > >)
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Archetype const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Archetype const *, rfk::Allocator< Archetype const * > >)
 
template<typename T >
Enum const * getEnum () noexcept
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Enum const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Enum const *, rfk::Allocator< Enum const * > >)
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< EnumValue const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< EnumValue const *, rfk::Allocator< EnumValue const * > >)
 
template<typename T >
Archetype const * getArchetype () noexcept
 Get the archetype of any type if it exists. Note that this method will always return nullptr on protected/private nested archetypes. If a cv-qualified, pointer/reference, array type is passed, they are all ignored and the raw type archetype is returned. Example: int* -> int, int[2] -> int, const volatile int -> int, int& -> int. More...
 
template<>
REFUREKU_API Archetype const * getArchetype< void > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< std::nullptr_t > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< bool > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< char > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< signed char > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< unsigned char > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< wchar_t > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< char16_t > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< char32_t > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< short > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< unsigned short > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< int > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< unsigned int > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< long > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< unsigned long > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< long long > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< unsigned long long > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< float > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< double > () noexcept
 
template<>
REFUREKU_API Archetype const * getArchetype< long double > () noexcept
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Struct const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Struct const *, rfk::Allocator< Struct const * > >)
 
template<typename TargetClassType , typename SourceClassType >
RFK_NODISCARD TargetClassType * dynamicCast (SourceClassType *instance) noexcept
 Adjust the provided pointer to another class pointer if possible. More...
 
template<typename TargetClassType >
RFK_NODISCARD TargetClassType * dynamicCast (typename CopyConstness< TargetClassType, void >::Type *instance, Struct const &instanceStaticArchetype, Struct const &instanceDynamicArchetype, Struct const &targetArchetype) noexcept
 Adjust the pointer of the provided instance of a given static/dynamic type to a pointer to another type if possible. More...
 
template<typename TargetClassType >
RFK_NODISCARD TargetClassType * dynamicUpCast (typename CopyConstness< TargetClassType, void >::Type *instance, Struct const &targetArchetype) noexcept
 Adjust the pointer of the provided instance of type instanceStaticArchetype to a pointer to a targetArchetype. This method only works for upcast, which means that if instanceStaticArchetype is a parent class of targetArchetype, nullptr is returned. Since the method checks only for upcast, it is theoritically faster than dynamicCast. More...
 
template<typename TargetClassType >
RFK_NODISCARD TargetClassType * dynamicDownCast (typename CopyConstness< TargetClassType, void >::Type *instance, Struct const &instanceStaticArchetype, Struct const &targetArchetype) noexcept
 Adjust the pointer of the provided instance of type instanceStaticArchetype to a pointer to a targetArchetype. This method only works for downcast, which means that if targetArchetype is a parent class of instanceStaticArchetype, nullptr is returned. Since the method checks only for downcast, it is theoritically faster than dynamicCast. More...
 
REFUREKU_API Database const & getDatabase () noexcept
 Get a reference to the database of this program. More...
 
RFK_NODISCARD REFUREKU_API Archetype const * archetypeCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Archetype. More...
 
RFK_NODISCARD REFUREKU_API FundamentalArchetype const * fundamentalArchetypeCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::FundamentalType. More...
 
RFK_NODISCARD REFUREKU_API Struct const * structCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Struct. More...
 
RFK_NODISCARD REFUREKU_API StructTemplate const * structTemplateCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::StructTemplate. More...
 
RFK_NODISCARD REFUREKU_API StructTemplateInstantiation const * structTemplateInstantiationCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::StructTemplateInstantiation. More...
 
RFK_NODISCARD REFUREKU_API Class const * classCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Class. More...
 
RFK_NODISCARD REFUREKU_API ClassTemplate const * classTemplateCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::ClassTemplate. More...
 
RFK_NODISCARD REFUREKU_API ClassTemplateInstantiation const * classTemplateInstantiationCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::ClassTemplateInstantiation. More...
 
RFK_NODISCARD REFUREKU_API Field const * fieldCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Field. More...
 
RFK_NODISCARD REFUREKU_API StaticField const * staticFieldCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::StaticField. More...
 
RFK_NODISCARD REFUREKU_API Method const * methodCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Method. More...
 
RFK_NODISCARD REFUREKU_API StaticMethod const * staticMethodCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::StaticMethod. More...
 
RFK_NODISCARD REFUREKU_API Enum const * enumCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Enum. More...
 
RFK_NODISCARD REFUREKU_API EnumValue const * enumValueCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::EnumValue. More...
 
RFK_NODISCARD REFUREKU_API Namespace const * namespaceCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Namespace. More...
 
RFK_NODISCARD REFUREKU_API Variable const * variableCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Variable. More...
 
RFK_NODISCARD REFUREKU_API Function const * functionCast (Entity const *entity) noexcept
 Try to cast a rfk::Entity to rfk::Function. More...
 
template<auto FuncPtr>
Function const * getFunction () noexcept
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Function const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Function const *, rfk::Allocator< Function const * > >)
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Method const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Method const *, rfk::Allocator< Method const * > >)
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< StaticMethod const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< StaticMethod const *, rfk::Allocator< StaticMethod const * > >)
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Namespace const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Namespace const *, rfk::Allocator< Namespace const * > >)
 
template<typename T >
Type const & getType () noexcept
 Retrieve the Type object from a given type. Identical types will return the same Type object (the returned object will have the same address in memory). More...
 
template REFUREKU_API Type const & getType< void > () noexcept
 
template REFUREKU_API Type const & getType< std::nullptr_t > () noexcept
 
template REFUREKU_API Type const & getType< bool > () noexcept
 
template REFUREKU_API Type const & getType< char > () noexcept
 
template REFUREKU_API Type const & getType< signed char > () noexcept
 
template REFUREKU_API Type const & getType< unsigned char > () noexcept
 
template REFUREKU_API Type const & getType< wchar_t > () noexcept
 
template REFUREKU_API Type const & getType< char16_t > () noexcept
 
template REFUREKU_API Type const & getType< char32_t > () noexcept
 
template REFUREKU_API Type const & getType< short > () noexcept
 
template REFUREKU_API Type const & getType< unsigned short > () noexcept
 
template REFUREKU_API Type const & getType< int > () noexcept
 
template REFUREKU_API Type const & getType< unsigned int > () noexcept
 
template REFUREKU_API Type const & getType< long > () noexcept
 
template REFUREKU_API Type const & getType< unsigned long > () noexcept
 
template REFUREKU_API Type const & getType< long long > () noexcept
 
template REFUREKU_API Type const & getType< unsigned long long > () noexcept
 
template REFUREKU_API Type const & getType< float > () noexcept
 
template REFUREKU_API Type const & getType< double > () noexcept
 
template REFUREKU_API Type const & getType< long double > () noexcept
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Field const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Field const *, rfk::Allocator< Field const * > >)
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< StaticField const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< StaticField const *, rfk::Allocator< StaticField const * > >)
 
template<auto VarPtr>
Variable const * getVariable () noexcept
 
 REFUREKU_TEMPLATE_API (rfk::Allocator< Variable const * >)
 
 REFUREKU_TEMPLATE_API (rfk::Vector< Variable const *, rfk::Allocator< Variable const * > >)
 

Detailed Description

Copyright (c) 2021 Julien SOYSOUVANH - All Rights Reserved

This file is part of the Refureku library project which is released under the MIT License. See the LICENSE.md file for full license details.

Copyright (c) 2020 Julien SOYSOUVANH - All Rights Reserved

This file is part of the Refureku library project which is released under the MIT License. See the LICENSE.md file for full license details.

Copyright (c) 2022 Julien SOYSOUVANH - All Rights Reserved

This file is part of the Refureku library project which is released under the MIT License. See the LICENSE.md file for full license details.

Typedef Documentation

◆ Predicate

template<typename T >
using rfk::Predicate = typedef bool (*)(T const& value, void* userData)

Predicate defining if a value is valid or not.

Parameters
valueThe tested value.
userDataData received from the user.
Returns
true if the tested value is valid, else false.

◆ Visitor

template<typename T >
using rfk::Visitor = typedef bool (*)(T const& value, void* userData)

Visitor function.

Parameters
valueThe visited value.
userDataData received from the user.
Returns
true to make the visitor continue to the next value, else false (abort).

Enumeration Type Documentation

◆ EClassKind

enum class rfk::EClassKind
strong

Defines the kind of a rfk::Class or a rfk::Struct instance:

◆ EEntityKind

enum class rfk::EEntityKind : uint16
strong

Describe the kind of an entity

Enumerator
Undefined 

This entity is... what? Should never happen...

Namespace 

The entity is a namespace, it can safely be cast to rfk::Namespace type.

Class 

The entity is a class, it can safely be cast to rfk::Class.

Struct 

The archetype is a struct, it can safely be cast to rfk::Struct.

Enum 

The archetype is an enum, it can safely by cast to rfk::Enum.

FundamentalArchetype 

The archetype is a fundamental archetype. it can safely by cast to rfk::FundamentalArchetype.

Variable 

This entity is a (non-member) variable, it can safely be cast to rfk::Variable.

Field 

The entity is a field, it can safely be cast to rfk::FieldBase type. More specific info can be retrieved from the entity by checking rfk::FieldBase::getFlags().

Function 

This entity is a (non-member) function, is can safely be cast to rfk::Function.

Method 

The entity is a method, it can safely be cast to rfk::MethodBase type. More specific info can be retrieved from the entity by checking rfk::MethodBase::getFlags().

EnumValue 

The entity is an enum value, it can safely be cast to rfk::EnumValue.

NamespaceFragment 

The entity is a namespace fragment, is can safely be cast to rfk::NamespaceFragment.

◆ EFieldFlags

enum class rfk::EFieldFlags : uint8
strong
Enumerator
Default 

No flag.

Public 

Access specifiers.

Static 

Field qualifiers.

◆ EFunctionFlags

enum class rfk::EFunctionFlags : uint8
strong

Flags describing a (non-member) function.

Enumerator
Default 

No flag.

Static 

static qualifier.

Inline 

inline qualifier.

◆ EMethodFlags

enum class rfk::EMethodFlags : uint16
strong

Flags describing a (member) function, i.e. a method.

Enumerator
Default 

No flag.

Public 

Access specifiers.

Static 

static qualifier.

Inline 

inline qualifier.

Virtual 

virtual qualifier.

PureVirtual 

virtual = 0 qualifier.

Override 

override qualifier.

Final 

final qualifier.

Const 

const qualifier.

◆ ETemplateParameterKind

enum class rfk::ETemplateParameterKind
strong

Defines the kind of a template parameter.

Enumerator
NonTypeTemplateParameter 

The template parameter is a non-type template parameter, like: template <int Value> or template <auto Value>

TypeTemplateParameter 

The template parameter is a type template parameter, like: template <typename T>

TemplateTemplateParameter 

The template parameter is a template template parameter, like: template <template <typename> typename T>

◆ ETypePartDescriptor

enum class rfk::ETypePartDescriptor : uint16
strong
Enumerator
Undefined 

Default uninitialized value for this enum

Const 

Keywords

Ptr 

Ptr/Ref/Array

◆ EVarFlags

enum class rfk::EVarFlags : uint8
strong
Enumerator
Default 

No flag.

Static 

static qualifier.

Function Documentation

◆ archetypeCast()

RFK_NODISCARD REFUREKU_API Archetype const * rfk::archetypeCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Archetype.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Archetype if entity is an archetype, else nullptr.

◆ classCast()

RFK_NODISCARD REFUREKU_API Class const * rfk::classCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Class.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Class if entity is a class, else nullptr.

◆ classTemplateCast()

RFK_NODISCARD REFUREKU_API ClassTemplate const * rfk::classTemplateCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::ClassTemplate.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::ClassTemplate if entity is a class template, else nullptr.

◆ classTemplateInstantiationCast()

RFK_NODISCARD REFUREKU_API ClassTemplateInstantiation const * rfk::classTemplateInstantiationCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::ClassTemplateInstantiation.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::ClassTemplateInstantiation if entity is a class template instantiation, else nullptr.

◆ dynamicCast() [1/2]

template<typename TargetClassType , typename SourceClassType >
RFK_NODISCARD TargetClassType * rfk::dynamicCast ( SourceClassType *  instance)
noexcept

Adjust the provided pointer to another class pointer if possible.

Template Parameters
TargetClassTypeType to cast to.
SourceClassTypeStatic type of the provided instance to cast.
Parameters
instanceA pointer to the instance to cast.
Returns
The pointer to instance as targetArchetype if successful, else nullptr.

◆ dynamicCast() [2/2]

template<typename TargetClassType >
RFK_NODISCARD TargetClassType * rfk::dynamicCast ( typename CopyConstness< TargetClassType, void >::Type *  instance,
Struct const &  instanceStaticArchetype,
Struct const &  instanceDynamicArchetype,
Struct const &  targetArchetype 
)
noexcept

Adjust the pointer of the provided instance of a given static/dynamic type to a pointer to another type if possible.

Template Parameters
TargetClassTypeType to cast to.
Parameters
instancePointer to the instance to cast.
instanceStaticArchetypeThe static archetype of instance (the result of rfk::getArchetype<decltype(instance)>() before it was casted to void).
instanceDynamicArchetypeThe dynamic archetype of instance (the result of instance->getArchetype(), overriden from rfk::Object).
targetArchetypeThe archetype of TargetClassType.
Returns
A pointer to the adjusted instance if the cast was successful, else nullptr.

◆ dynamicDownCast()

template<typename TargetClassType >
RFK_NODISCARD TargetClassType * rfk::dynamicDownCast ( typename CopyConstness< TargetClassType, void >::Type *  instance,
Struct const &  instanceStaticArchetype,
Struct const &  targetArchetype 
)
noexcept

Adjust the pointer of the provided instance of type instanceStaticArchetype to a pointer to a targetArchetype. This method only works for downcast, which means that if targetArchetype is a parent class of instanceStaticArchetype, nullptr is returned. Since the method checks only for downcast, it is theoritically faster than dynamicCast.

Template Parameters
TargetClassTypeType of pointer the result should be cast to. To get a void*, call dynamicCast<void>(...).
Parameters
instancePointer to the instance to cast.
instanceStaticArchetypeStatic archetype of the instance. If instanceStaticArchetype is not the static archetype of instance, the result of this method is UB.
targetArchetypeArchetype to cast instance to.
Returns
A pointer to the adjusted instance if the downcast was successful, else nullptr.

◆ dynamicUpCast()

template<typename TargetClassType >
RFK_NODISCARD TargetClassType * rfk::dynamicUpCast ( typename CopyConstness< TargetClassType, void >::Type *  instance,
Struct const &  targetArchetype 
)
noexcept

Adjust the pointer of the provided instance of type instanceStaticArchetype to a pointer to a targetArchetype. This method only works for upcast, which means that if instanceStaticArchetype is a parent class of targetArchetype, nullptr is returned. Since the method checks only for upcast, it is theoritically faster than dynamicCast.

Template Parameters
TargetClassTypeType of pointer the result should be cast to. To get a void*, call dynamicCast<void>(...).
Parameters
instancePointer to the instance to cast.
instanceStaticArchetypeStatic archetype of the instance. If instanceStaticArchetype is not the static archetype of instance, the result of this method is UB.
targetArchetypeArchetype to cast instance to.
Returns
A pointer to the adjusted instance if the upcast was successful, else nullptr.

◆ enumCast()

RFK_NODISCARD REFUREKU_API Enum const * rfk::enumCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Enum.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Enum if entity is an enum or enum class, else nullptr.

◆ enumValueCast()

RFK_NODISCARD REFUREKU_API EnumValue const * rfk::enumValueCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::EnumValue.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::EnumValue if entity is an enum value, else nullptr.

◆ fieldCast()

RFK_NODISCARD REFUREKU_API Field const * rfk::fieldCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Field.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Field if entity is a field, else nullptr.

◆ functionCast()

RFK_NODISCARD REFUREKU_API Function const * rfk::functionCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Function.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Function if entity is a function, else nullptr.

◆ fundamentalArchetypeCast()

RFK_NODISCARD REFUREKU_API FundamentalArchetype const * rfk::fundamentalArchetypeCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::FundamentalType.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::FundamentalType if entity is a fundamental archetype, else nullptr.

◆ getArchetype()

template<typename T >
Archetype const * rfk::getArchetype ( )
noexcept

Get the archetype of any type if it exists. Note that this method will always return nullptr on protected/private nested archetypes. If a cv-qualified, pointer/reference, array type is passed, they are all ignored and the raw type archetype is returned. Example: int* -> int, int[2] -> int, const volatile int -> int, int& -> int.

Get archetype for template classes. Cover only most common cases.

This templated method can be specialized to handle unreflected types.

Returns
The archetype of the provided type if it exists, else nullptr.
The archetype of the provided type if it exists, else nullptr.

◆ getArchetype< void >()

template<>
REFUREKU_API Archetype const * rfk::getArchetype< void > ( )
noexcept

rfk::getArchetype specialization for all fundamental types.

◆ getDatabase()

REFUREKU_API Database const & rfk::getDatabase ( )
noexcept

Get a reference to the database of this program.

Returns
A reference to the database of this program.

◆ getEnum()

template<typename T >
Enum const * rfk::getEnum ( )
noexcept

Base implementation of getEnum, specialized for each reflected enum.

◆ getFunction()

template<auto FuncPtr>
Function const * rfk::getFunction ( )
noexcept

Base implementation of getFunction, specialized for each reflected function.

◆ getType()

template<typename T >
Type const & rfk::getType ( )
noexcept

Retrieve the Type object from a given type. Identical types will return the same Type object (the returned object will have the same address in memory).

Returns
The computed type.

◆ getVariable()

template<auto VarPtr>
Variable const * rfk::getVariable ( )
noexcept

Base implementation of getVariable, specialized for each reflected variable.

◆ methodCast()

RFK_NODISCARD REFUREKU_API Method const * rfk::methodCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Method.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Method if entity is a method, else nullptr.

◆ namespaceCast()

RFK_NODISCARD REFUREKU_API Namespace const * rfk::namespaceCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Namespace.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Namespace if entity is a namespace, else nullptr.

◆ staticFieldCast()

RFK_NODISCARD REFUREKU_API StaticField const * rfk::staticFieldCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::StaticField.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::StaticField if entity is a static field, else nullptr.

◆ staticMethodCast()

RFK_NODISCARD REFUREKU_API StaticMethod const * rfk::staticMethodCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::StaticMethod.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::StaticMethod if entity is a static method, else nullptr.

◆ structCast()

RFK_NODISCARD REFUREKU_API Struct const * rfk::structCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Struct.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Struct if entity is a struct, else nullptr.

◆ structTemplateCast()

RFK_NODISCARD REFUREKU_API StructTemplate const * rfk::structTemplateCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::StructTemplate.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::StructTemplate if entity is a struct template, else nullptr.

◆ structTemplateInstantiationCast()

RFK_NODISCARD REFUREKU_API StructTemplateInstantiation const * rfk::structTemplateInstantiationCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::StructTemplateInstantiation.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::StructTemplateInstantiation if entity is a struct template instantiation, else nullptr.

◆ variableCast()

RFK_NODISCARD REFUREKU_API Variable const * rfk::variableCast ( Entity const *  entity)
noexcept

Try to cast a rfk::Entity to rfk::Variable.

Parameters
entityThe entity to cast.
Returns
A non-nullptr pointer to rfk::Variable if entity is a variable, else nullptr.