|
Refureku v2.2.0
C++17 runtime reflection library.
|
Public Member Functions | |
| REFUREKU_API | Struct (char const *name, std::size_t id, std::size_t memorySize, bool isClass) noexcept |
| template<typename ReturnType , typename... ArgTypes> | |
| RFK_NODISCARD rfk::SharedPtr< ReturnType > | makeSharedInstance (ArgTypes &&... args) const |
| Make an instance of the class represented by this archetype with the matching instantiator. One can add new instantiators to any class by using the Instantiator method property. More... | |
| template<typename ReturnType , typename... ArgTypes> | |
| RFK_NODISCARD rfk::UniquePtr< ReturnType > | makeUniqueInstance (ArgTypes &&... args) const |
| Make an instance of the class represented by this archetype with the matching instantiator. One can add new instantiators to any class by using the Instantiator method property. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Struct const * > | getDirectSubclasses () const noexcept |
| Compute the list of all direct reflected subclasses of this struct. Direct subclasses are computed by iterating over all subclasses (direct or not), so this method might have a heavy performance cost on big class hierarchies. More... | |
| RFK_NODISCARD REFUREKU_API bool | isSubclassOf (Struct const &archetype) const noexcept |
| Check if this struct is a subclass of another struct/class. More... | |
| RFK_NODISCARD REFUREKU_API bool | isBaseOf (Struct const &archetype) const noexcept |
| Check if this struct is a base class of another struct/class. More... | |
| RFK_NODISCARD REFUREKU_API ParentStruct const & | getDirectParentAt (std::size_t index) const noexcept |
| Get the index'th direct parent of this struct. If index is greater or equal to getDirectParentsCount(), the behaviour is undefined. More... | |
| RFK_NODISCARD REFUREKU_API std::size_t | getDirectParentsCount () const noexcept |
| Get the number of reflected direct parents this struct is inheriting from. More... | |
| REFUREKU_API bool | foreachDirectParent (Visitor< ParentStruct > visitor, void *userData) const |
| Execute the given visitor on all direct parents of this struct. More... | |
| RFK_NODISCARD REFUREKU_API Struct const * | getNestedStructByName (char const *name, EAccessSpecifier access=EAccessSpecifier::Undefined) const noexcept |
| RFK_NODISCARD REFUREKU_API Struct const * | getNestedStructByPredicate (Predicate< Struct > predicate, void *userData) const |
| Retrieve the first nested struct satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Struct const * > | getNestedStructsByPredicate (Predicate< Struct > predicate, void *userData) const |
| Retrieve all nested structs satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Class const * | getNestedClassByName (char const *name, EAccessSpecifier access=EAccessSpecifier::Undefined) const noexcept |
| RFK_NODISCARD REFUREKU_API Class const * | getNestedClassByPredicate (Predicate< Class > predicate, void *userData) const |
| Retrieve the first nested class satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Class const * > | getNestedClassesByPredicate (Predicate< Class > predicate, void *userData) const |
| Retrieve all nested classes satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Enum const * | getNestedEnumByName (char const *name, EAccessSpecifier access=EAccessSpecifier::Undefined) const noexcept |
| RFK_NODISCARD REFUREKU_API Enum const * | getNestedEnumByPredicate (Predicate< Enum > predicate, void *userData) const |
| Retrieve the first nested enum satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Enum const * > | getNestedEnumsByPredicate (Predicate< Enum > predicate, void *userData) const |
| Retrieve all nested enums satisfying the provided predicate. More... | |
| REFUREKU_API bool | foreachNestedArchetype (Visitor< Archetype > visitor, void *userData) const |
| Execute the given visitor on all archetypes nested in this struct. More... | |
| REFUREKU_API std::size_t | getNestedArchetypesCount () const noexcept |
| Get the number of archetypes nested in this struct. More... | |
| RFK_NODISCARD REFUREKU_API Field const * | getFieldByName (char const *name, EFieldFlags minFlags=EFieldFlags::Default, bool shouldInspectInherited=false) const noexcept |
| RFK_NODISCARD REFUREKU_API Field const * | getFieldByPredicate (Predicate< Field > predicate, void *userData, bool shouldInspectInherited=false) const |
| Retrieve the first field satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Field const * > | getFieldsByPredicate (Predicate< Field > predicate, void *userData, bool shouldInspectInherited=false, bool orderedByDeclaration=false) const |
| Retrieve all fields satisfying the provided predicate. More... | |
| REFUREKU_API bool | foreachField (Visitor< Field > visitor, void *userData, bool shouldInspectInherited=false) const |
| Execute the given visitor on all fields in this struct. More... | |
| REFUREKU_API std::size_t | getFieldsCount () const noexcept |
| Get the number of fields (including inherited ones) in this struct. More... | |
| RFK_NODISCARD REFUREKU_API StaticField const * | getStaticFieldByName (char const *name, EFieldFlags minFlags=EFieldFlags::Default, bool shouldInspectInherited=false) const noexcept |
| RFK_NODISCARD REFUREKU_API StaticField const * | getStaticFieldByPredicate (Predicate< StaticField > predicate, void *userData, bool shouldInspectInherited=false) const |
| Retrieve the first static field satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Vector< StaticField const * > | getStaticFieldsByPredicate (Predicate< StaticField > predicate, void *userData, bool shouldInspectInherited=false) const |
| Retrieve all static fields satisfying the provided predicate. More... | |
| REFUREKU_API bool | foreachStaticField (Visitor< StaticField > visitor, void *userData, bool shouldInspectInherited=false) const |
| Execute the given visitor on all static fields in this struct. More... | |
| REFUREKU_API std::size_t | getStaticFieldsCount () const noexcept |
| Get the number of static fields (including inherited ones) in this struct. More... | |
| template<typename MethodSignature > | |
| RFK_NODISCARD Method const * | getMethodByName (char const *name, EMethodFlags minFlags=EMethodFlags::Default, bool shouldInspectInherited=false) const noexcept |
| Get a method by name and signature. This template overload using signature comes handy when wanting to disambiguate 2 method overloads with and without const qualifier for example. More... | |
| RFK_NODISCARD REFUREKU_API Method const * | getMethodByName (char const *name, EMethodFlags minFlags=EMethodFlags::Default, bool shouldInspectInherited=false) const noexcept |
| RFK_NODISCARD REFUREKU_API Vector< Method const * > | getMethodsByName (char const *name, EMethodFlags minFlags=EMethodFlags::Default, bool shouldInspectInherited=false) const noexcept |
| RFK_NODISCARD REFUREKU_API Method const * | getMethodByPredicate (Predicate< Method > predicate, void *userData, bool shouldInspectInherited=false) const |
| Retrieve the first method satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Method const * > | getMethodsByPredicate (Predicate< Method > predicate, void *userData, bool shouldInspectInherited=false) const |
| Retrieve all methods satisfying the provided predicate. More... | |
| REFUREKU_API bool | foreachMethod (Visitor< Method > visitor, void *userData, bool shouldInspectInherited=false) const |
| Execute the given visitor on all methods in this struct. More... | |
| REFUREKU_API std::size_t | getMethodsCount () const noexcept |
| Get the number of methods (excluding inherited ones) in this struct. More... | |
| template<typename StaticMethodSignature > | |
| RFK_NODISCARD StaticMethod const * | getStaticMethodByName (char const *name, EMethodFlags minFlags=EMethodFlags::Default, bool shouldInspectInherited=false) const noexcept |
| RFK_NODISCARD REFUREKU_API StaticMethod const * | getStaticMethodByName (char const *name, EMethodFlags minFlags=EMethodFlags::Default, bool shouldInspectInherited=false) const noexcept |
| RFK_NODISCARD REFUREKU_API Vector< StaticMethod const * > | getStaticMethodsByName (char const *name, EMethodFlags minFlags=EMethodFlags::Default, bool shouldInspectInherited=false) const noexcept |
| RFK_NODISCARD REFUREKU_API StaticMethod const * | getStaticMethodByPredicate (Predicate< StaticMethod > predicate, void *userData, bool shouldInspectInherited=false) const |
| Retrieve the first static method satisfying the provided predicate. More... | |
| RFK_NODISCARD REFUREKU_API Vector< StaticMethod const * > | getStaticMethodsByPredicate (Predicate< StaticMethod > predicate, void *userData, bool shouldInspectInherited=false) const |
| Retrieve all static methods satisfying the provided predicate. More... | |
| REFUREKU_API bool | foreachStaticMethod (Visitor< StaticMethod > visitor, void *userData, bool shouldInspectInherited=false) const |
| Execute the given visitor on all static methods in this struct. More... | |
| REFUREKU_API std::size_t | getStaticMethodsCount () const noexcept |
| Get the number of static methods (excluding inherited ones) in this struct. More... | |
| RFK_NODISCARD REFUREKU_API EClassKind | getClassKind () const noexcept |
| Get the class kind of this instance. More... | |
| RFK_NODISCARD REFUREKU_API bool | getPointerOffset (Struct const &to, std::ptrdiff_t &out_pointerOffset) const noexcept |
| Get the pointer offset to transform an instance of this Struct pointer to a pointer of the provided Struct. Search in both directions (whether to is a parent class or a child class). More... | |
| RFK_NODISCARD REFUREKU_API bool | getSubclassPointerOffset (Struct const &to, std::ptrdiff_t &out_pointerOffset) const noexcept |
| Get the pointer offset to transform an instance of this Struct pointer to a pointer of the provided Struct. Only search the offset in this struct subclasses. If to is a parent of this struct, false will be returned. More... | |
| REFUREKU_API void | addDirectParent (Archetype const *archetype, EAccessSpecifier inheritanceAccess) noexcept |
| Add a parent to this struct if the provided archetype is a valid struct/class. More... | |
| REFUREKU_API void | setDirectParentsCapacity (std::size_t capacity) noexcept |
| Set the number of direct parents for this struct. Useful to avoid reallocations and avoid having unused memory. If the number of direct parents is already >= to the provided count, this method has no effect. More... | |
| REFUREKU_API void | addSubclass (Struct const &subclass, std::ptrdiff_t subclassPointerOffset) noexcept |
| Add a subclass to this struct. More... | |
| REFUREKU_API void | addNestedArchetype (Archetype const *nestedArchetype, EAccessSpecifier accessSpecifier) noexcept |
| Add a nested archetype to the struct. More... | |
| REFUREKU_API void | setNestedArchetypesCapacity (std::size_t capacity) noexcept |
| Internally pre-allocate enough memory for the provided number of nested archetypes. If the number of nested archetypes is already >= to the provided capacity, this method has no effect. More... | |
| REFUREKU_API Field * | addField (char const *name, std::size_t id, Type const &type, EFieldFlags flags, std::size_t memoryOffset, Struct const *outerEntity) noexcept |
| Add a field to the struct. More... | |
| REFUREKU_API void | setFieldsCapacity (std::size_t capacity) noexcept |
| Internally pre-allocate enough memory for the provided number of fields. If the number of fields is already >= to the provided capacity, this method has no effect. More... | |
| REFUREKU_API StaticField * | addStaticField (char const *name, std::size_t id, Type const &type, EFieldFlags flags, void *fieldPtr, Struct const *outerEntity) noexcept |
| Add a static field to the struct. More... | |
| REFUREKU_API StaticField * | addStaticField (char const *name, std::size_t id, Type const &type, EFieldFlags flags, void const *fieldPtr, Struct const *outerEntity) noexcept |
| REFUREKU_API void | setStaticFieldsCapacity (std::size_t capacity) noexcept |
| Internally pre-allocate enough memory for the provided number of static fields. If the number of static fields is already >= to the provided capacity, this method has no effect. More... | |
| REFUREKU_API Method * | addMethod (char const *name, std::size_t id, Type const &returnType, ICallable *internalMethod, EMethodFlags flags) noexcept |
| Add a method to the struct. More... | |
| REFUREKU_API void | setMethodsCapacity (std::size_t capacity) noexcept |
| Internally pre-allocate enough memory for the provided number of methods. If the number of methods is already >= to the provided capacity, this method has no effect. More... | |
| REFUREKU_API StaticMethod * | addStaticMethod (char const *name, std::size_t id, Type const &returnType, ICallable *internalMethod, EMethodFlags flags) noexcept |
| Add a static method to the struct. More... | |
| REFUREKU_API void | setStaticMethodsCapacity (std::size_t capacity) noexcept |
| Internally pre-allocate enough memory for the provided number of static methods. If the number of static methods is already >= to the provided capacity, this method has no effect. More... | |
| REFUREKU_API void | addSharedInstantiator (StaticMethod const &instantiator) noexcept |
| Add a new way to instantiate this struct through the makeSharedInstance method. The passed static method MUST return a rfk::SharedPtr<StructType>. Otherwise, the behaviour is undefined when calling Struct::makeSharedInstance. More... | |
| REFUREKU_API void | addUniqueInstantiator (StaticMethod const &instantiator) noexcept |
| Add a new way to instantiate this struct through the makeUniqueInstance method. The passed static method MUST return a rfk::UniquePtr<StructType>. Otherwise, the behaviour is undefined when calling Struct::makeUniqueInstance. More... | |
Public Member Functions inherited from rfk::Archetype | |
| Archetype (Archetype &&)=delete | |
| RFK_NODISCARD REFUREKU_API EAccessSpecifier | getAccessSpecifier () const noexcept |
| Get the access specifier of the archetype if it is nested in a struct or class. If the archetype is not nested in a struct or class, EAccessSpecifier::Undefined is returned. More... | |
| RFK_NODISCARD REFUREKU_API std::size_t | getMemorySize () const noexcept |
| Get the memory size of an instance of the archetype, as the operator sizeof(type) would do. More... | |
| REFUREKU_API void | setAccessSpecifier (EAccessSpecifier access) noexcept |
| Set the access specifier of the archetype in its outer struct/class. More... | |
Public Member Functions inherited from rfk::Entity | |
| Entity (Entity const &)=delete | |
| RFK_NODISCARD REFUREKU_API Property const * | getPropertyAt (std::size_t propertyIndex) const noexcept |
| Retrieve the property at the given index. If propertyIndex is greater or equal to the properties count, the behaviour is undefined. More... | |
| template<typename PropertyType , typename = std::enable_if_t<std::is_base_of_v<Property, PropertyType> && !std::is_same_v<PropertyType, Property>>> | |
| RFK_NODISCARD PropertyType const * | getProperty (bool isChildClassValid=true) const noexcept |
| Retrieve a property of a given type from this entity. More... | |
| RFK_NODISCARD REFUREKU_API Property const * | getProperty (Struct const &archetype, bool isChildClassValid=true) const noexcept |
| Retrieve the first property matching with the provided archetype. More... | |
| RFK_NODISCARD REFUREKU_API Property const * | getPropertyByName (char const *name) const noexcept |
| Retrieve the first property named with the provided name. More... | |
| RFK_NODISCARD REFUREKU_API Property const * | getPropertyByPredicate (Predicate< Property > predicate, void *userData) const |
| Retrieve a property matching with a predicate. More... | |
| template<typename PropertyType , typename = std::enable_if_t<std::is_base_of_v<Property, PropertyType> && !std::is_same_v<PropertyType, Property>>> | |
| RFK_NODISCARD Vector< PropertyType const * > | getProperties (bool isChildClassValid=true) const noexcept |
| Retrieve all properties matching with the provided archetype. If PropertyType uses multiple inheritance, its first inherited type must be rfk::Property or derived. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Property const * > | getProperties (Struct const &archetype, bool isChildClassValid=true) const noexcept |
| Retrieve all properties matching with the provided archetype. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Property const * > | getPropertiesByName (char const *name) const noexcept |
| Retrieve all properties named with the provided name. More... | |
| RFK_NODISCARD REFUREKU_API Vector< Property const * > | getPropertiesByPredicate (Predicate< Property > predicate, void *userData) const |
| Retrieve all properties matching with a predicate in this entity. More... | |
| RFK_NODISCARD REFUREKU_API std::size_t | getPropertiesCount () const noexcept |
| Get the number of properties attached to this entity. More... | |
| REFUREKU_API bool | foreachProperty (Visitor< Property > visitor, void *userData) const |
| Execute the given visitor on all properties attached to this entity. More... | |
| RFK_NODISCARD REFUREKU_API char const * | getName () const noexcept |
| Get the name of the entity. More... | |
| RFK_NODISCARD REFUREKU_API bool | hasSameName (char const *name) const noexcept |
| Check that this entity has the same name as the provided string. More... | |
| RFK_NODISCARD REFUREKU_API std::size_t | getId () const noexcept |
| Get the program-unique id of the entity. More... | |
| RFK_NODISCARD REFUREKU_API EEntityKind | getKind () const noexcept |
| Get the kind of the entity. Knowing the kind allows to safely cast to child classes. Check the EEntityKind documentation for more information. More... | |
| RFK_NODISCARD REFUREKU_API Entity const * | getOuterEntity () const noexcept |
| Get the outer entity of the entity. It basically corresponds to the entity this entity was declared in from a source-code point of view. A nullptr outer entity means the entity was declared at file level. More... | |
| REFUREKU_API bool | addProperty (Property const &property) noexcept |
| Add a property to this entity. More... | |
| REFUREKU_API void | setOuterEntity (Entity const *outerEntity) noexcept |
| Setter for the field _outerEntity. More... | |
| REFUREKU_API void | setPropertiesCapacity (std::size_t capacity) noexcept |
| Set the number of properties for this entity. Useful to avoid reallocations when adding a lot of properties. If the number of properties is already >= to the provided capacity, this method has no effect. More... | |
| Entity & | operator= (Entity const &)=delete |
| Entity & | operator= (Entity &&)=delete |
| RFK_NODISCARD REFUREKU_API bool | operator== (Entity const &other) const noexcept |
| RFK_NODISCARD REFUREKU_API bool | operator!= (Entity const &other) const noexcept |
Protected Member Functions | |
| REFUREKU_INTERNAL | Struct (char const *name, std::size_t id, std::size_t memorySize, bool isClass, EClassKind classKind) noexcept |
| REFUREKU_INTERNAL | Struct (StructImpl *implementation) noexcept |
Protected Member Functions inherited from rfk::Archetype | |
| REFUREKU_INTERNAL | Archetype (ArchetypeImpl *implementation) noexcept |
Protected Member Functions inherited from rfk::Entity | |
| REFUREKU_INTERNAL | Entity (Entity &&) noexcept |
| REFUREKU_INTERNAL | Entity (EntityImpl *implementation) noexcept |
|
noexcept |
Add a parent to this struct if the provided archetype is a valid struct/class.
| archetype | Archetype of the parent struct/class. |
| inheritanceAccess | The inheritance access for the provided parent. |
|
noexcept |
Add a field to the struct.
| name | Name of the field. |
| id | Unique entity id of the field. |
| type | Type of the field. |
| flags | Field flags. |
| memoryOffset | Offset in bytes of the field in the owner struct (obtained from offsetof). |
| outerEntity | Struct the field was first declared in (in case of inherited field, outerEntity is the parent struct). |
|
noexcept |
Add a method to the struct.
| name | Name of the method. |
| id | Unique entity id of the method. |
| returnType | Return type of the method call. |
| internalMethod | Dynamically allocated MemberFunction storing the underlying method. |
| flags | Method flags. |
|
noexcept |
Add a nested archetype to the struct.
| nestedArchetype | Nested archetype. |
| accessSpeficier | Access specifier of the nested archetype in the struct. |
|
noexcept |
Add a new way to instantiate this struct through the makeSharedInstance method. The passed static method MUST return a rfk::SharedPtr<StructType>. Otherwise, the behaviour is undefined when calling Struct::makeSharedInstance.
| instantiator | Pointer to the static method. |
|
noexcept |
Add a static field to the struct.
| name | Name of the static field. |
| id | Unique entity id of the static field. |
| type | Type of the static field. |
| flags | Field flags. |
| fieldPtr | Pointer to the static field. |
| outerEntity | Struct the field was first declared in (in case of inherited field, outerEntity is the parent struct). |
|
noexcept |
Add a static method to the struct.
| methodName | Name of the static method. |
| id | Unique entity id of the static method. |
| returnType | Return type of the static method call. |
| internalMethod | Dynamically allocated NonMemberFunction storing the underlying static method. |
| flags | Method flags. |
|
noexcept |
Add a subclass to this struct.
| subclass | The subclass to add. |
| subclassPointerOffset | Memory offset to add to a subclass instance pointer to obtain a valid pointer to this base struct. |
|
noexcept |
Add a new way to instantiate this struct through the makeUniqueInstance method. The passed static method MUST return a rfk::UniquePtr<StructType>. Otherwise, the behaviour is undefined when calling Struct::makeUniqueInstance.
| instantiator | Pointer to the static method. |
| REFUREKU_API bool rfk::Struct::foreachDirectParent | ( | Visitor< ParentStruct > | visitor, |
| void * | userData | ||
| ) | const |
Execute the given visitor on all direct parents of this struct.
| visitor | Visitor function to call. Return false to abort the foreach loop. |
| userData | Optional user data forwarded to the visitor. |
| Any | exception potentially thrown from the provided visitor. |
| REFUREKU_API bool rfk::Struct::foreachField | ( | Visitor< Field > | visitor, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Execute the given visitor on all fields in this struct.
| visitor | Visitor function to call. Return false to abort the foreach loop. |
| userData | Optional user data forwarded to the visitor. |
| shouldInspectInherited | Should inherited fields be considered as well in the search process? If false, only fields introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided visitor. |
| REFUREKU_API bool rfk::Struct::foreachMethod | ( | Visitor< Method > | visitor, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Execute the given visitor on all methods in this struct.
| visitor | Visitor function to call. Return false to abort the foreach loop. |
| userData | Optional user data forwarded to the visitor. |
| shouldInspectInherited | Should iterate on inherited methods as well? |
| Any | exception potentially thrown from the provided visitor. |
| REFUREKU_API bool rfk::Struct::foreachNestedArchetype | ( | Visitor< Archetype > | visitor, |
| void * | userData | ||
| ) | const |
Execute the given visitor on all archetypes nested in this struct.
| visitor | Visitor function to call. Return false to abort the foreach loop. |
| userData | Optional user data forwarded to the visitor. |
| Any | exception potentially thrown from the provided visitor. |
| REFUREKU_API bool rfk::Struct::foreachStaticField | ( | Visitor< StaticField > | visitor, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Execute the given visitor on all static fields in this struct.
| visitor | Visitor function to call. Return false to abort the foreach loop. |
| userData | Optional user data forwarded to the visitor. |
| shouldInspectInherited | Should inherited static fields be considered as well in the search process? If false, only fields introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided visitor. |
| REFUREKU_API bool rfk::Struct::foreachStaticMethod | ( | Visitor< StaticMethod > | visitor, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Execute the given visitor on all static methods in this struct.
| visitor | Visitor function to call. Return false to abort the foreach loop. |
| userData | Optional user data forwarded to the visitor. |
| shouldInspectInherited | Should iterate on inherited static methods as well? |
| Any | exception potentially thrown from the provided visitor. |
|
noexcept |
Get the class kind of this instance.
|
noexcept |
Get the index'th direct parent of this struct. If index is greater or equal to getDirectParentsCount(), the behaviour is undefined.
|
noexcept |
Get the number of reflected direct parents this struct is inheriting from.
|
noexcept |
Compute the list of all direct reflected subclasses of this struct. Direct subclasses are computed by iterating over all subclasses (direct or not), so this method might have a heavy performance cost on big class hierarchies.
|
noexcept |
| name | Name of the field to retrieve. |
| minFlags | Requirements the queried field should fulfill. Keep in mind that the returned field should contain all of the specified flags, so setting for example Public and Protected will always return nullptr. EFieldFlags::Default means no requirement, so the first field named fieldName will be returned. |
| shouldInspectInherited | Should inherited fields be considered as well in the search process? If false, only fields introduced by this struct will be considered. |
| RFK_NODISCARD REFUREKU_API Field const * rfk::Struct::getFieldByPredicate | ( | Predicate< Field > | predicate, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Retrieve the first field satisfying the provided predicate.
| predicate | Predicate defining a valid field. |
| userData | User data forwarded to the predicate calls. |
| shouldInspectInherited | Should inherited fields be considered as well in the search process? If false, only fields introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided predicate. |
| RFK_NODISCARD REFUREKU_API Vector< Field const * > rfk::Struct::getFieldsByPredicate | ( | Predicate< Field > | predicate, |
| void * | userData, | ||
| bool | shouldInspectInherited = false, |
||
| bool | orderedByDeclaration = false |
||
| ) | const |
Retrieve all fields satisfying the provided predicate.
| predicate | Predicate defining a valid field. |
| userData | User data forwarded to the predicate calls. |
| shouldInspectInherited | Should inherited fields be considered as well in the search process? If false, only fields introduced by this struct will be considered. |
| orderedByDeclaration | Should fields be ordered by declaration order in the result collection? |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
Get the number of fields (including inherited ones) in this struct.
|
noexcept |
Get a method by name and signature. This template overload using signature comes handy when wanting to disambiguate 2 method overloads with and without const qualifier for example.
| name | Name of the method to retrieve. |
| minFlags | Requirements the queried method should fulfill. Keep in mind that the returned method should contain all of the specified flags, so setting for example Public and Protected will always return nullptr. EMethodFlags::Default means no requirement, so the first method named methodName will be returned. |
| shouldInspectInherited | Should inherited methods be considered as well in the search process? If false, only methods introduced by this struct will be considered. |
|
noexcept |
| name | Name of the method to retrieve. |
| minFlags | Requirements the queried method should fulfill. Keep in mind that the returned method should contain all of the specified flags, so setting for example Public and Protected will always return nullptr. EMethodFlags::Default means no requirement, so the first method named methodName will be returned. |
| shouldInspectInherited | Should inherited methods be considered as well in the search process? If false, only methods introduced by this struct will be considered. |
| RFK_NODISCARD REFUREKU_API Method const * rfk::Struct::getMethodByPredicate | ( | Predicate< Method > | predicate, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Retrieve the first method satisfying the provided predicate.
| predicate | Predicate defining a valid method. |
| userData | User data forwarded to the predicate calls. |
| shouldInspectInherited | Should inherited methods be considered as well in the search process? If false, only methods introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
| name | Name of the methods to retrieve. |
| minFlags | Requirements the queried methods should fulfill. Keep in mind that the returned methods should contain all of the specified flags, so setting for example Public and Protected will always return an empty vector. EMethodFlags::Default means no requirement, so all methods named methodName will be returned. |
| shouldInspectInherited | Should inherited methods be considered as well in the search process? If false, only methods introduced by this struct will be considered. |
| RFK_NODISCARD REFUREKU_API Vector< Method const * > rfk::Struct::getMethodsByPredicate | ( | Predicate< Method > | predicate, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Retrieve all methods satisfying the provided predicate.
| predicate | Predicate defining a valid method. |
| userData | User data forwarded to the predicate calls. |
| shouldInspectInherited | Should inherited methods be considered as well in the search process? If false, only methods introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
Get the number of methods (excluding inherited ones) in this struct.
|
noexcept |
Get the number of archetypes nested in this struct.
|
noexcept |
| className | Name of the nested class to look for. |
| access | Access specifier of the nested class in this struct. Use EAccessSpecifier::Undefined if it doesn't matter. |
| RFK_NODISCARD REFUREKU_API Class const * rfk::Struct::getNestedClassByPredicate | ( | Predicate< Class > | predicate, |
| void * | userData | ||
| ) | const |
Retrieve the first nested class satisfying the provided predicate.
| predicate | Predicate defining a valid nested class. |
| userData | User data forwarded to the predicate calls. |
| Any | exception potentially thrown from the provided predicate. |
| RFK_NODISCARD REFUREKU_API Vector< Class const * > rfk::Struct::getNestedClassesByPredicate | ( | Predicate< Class > | predicate, |
| void * | userData | ||
| ) | const |
Retrieve all nested classes satisfying the provided predicate.
| predicate | Predicate defining a valid nested class. |
| userData | User data forwarded to the predicate calls. |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
| enumName | Name of the nested enum to look for. |
| access | Access specifier of the nested enum in this struct. Use EAccessSpecifier::Undefined if it doesn't matter. |
| RFK_NODISCARD REFUREKU_API Enum const * rfk::Struct::getNestedEnumByPredicate | ( | Predicate< Enum > | predicate, |
| void * | userData | ||
| ) | const |
Retrieve the first nested enum satisfying the provided predicate.
| predicate | Predicate defining a valid nested enum. |
| userData | User data forwarded to the predicate calls. |
| Any | exception potentially thrown from the provided predicate. |
| RFK_NODISCARD REFUREKU_API Vector< Enum const * > rfk::Struct::getNestedEnumsByPredicate | ( | Predicate< Enum > | predicate, |
| void * | userData | ||
| ) | const |
Retrieve all nested enums satisfying the provided predicate.
| predicate | Predicate defining a valid nested enum. |
| userData | User data forwarded to the predicate calls. |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
| structName | Name of the nested struct to look for. |
| access | Access specifier of the nested struct in this struct. Use EAccessSpecifier::Undefined if it doesn't matter. |
| RFK_NODISCARD REFUREKU_API Struct const * rfk::Struct::getNestedStructByPredicate | ( | Predicate< Struct > | predicate, |
| void * | userData | ||
| ) | const |
Retrieve the first nested struct satisfying the provided predicate.
| predicate | Predicate defining a valid nested struct. |
| userData | User data forwarded to the predicate calls. |
| Any | exception potentially thrown from the provided predicate. |
| RFK_NODISCARD REFUREKU_API Vector< Struct const * > rfk::Struct::getNestedStructsByPredicate | ( | Predicate< Struct > | predicate, |
| void * | userData | ||
| ) | const |
Retrieve all nested structs satisfying the provided predicate.
| predicate | Predicate defining a valid nested struct. |
| userData | User data forwarded to the predicate calls. |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
Get the pointer offset to transform an instance of this Struct pointer to a pointer of the provided Struct. Search in both directions (whether to is a parent class or a child class).
| to | Struct metadata of the target struct. |
| out_pointerOffset | The resulting pointer offset if found. |
|
noexcept |
| name | Name of the static field to retrieve. |
| minFlags | Requirements the queried static field should fulfill. Keep in mind that the returned static field should contain all of the specified flags, so setting for example Public and Protected will always return nullptr. EFieldFlags::Default means no requirement, so the first static field named fieldName will be returned. Note: It doesn't matter whether you set the Static flag or not as this method is designed to return static fields only. |
| shouldInspectInherited | Should inherited static fields be considered as well in the search process? If false, only static fields introduced by this struct will be considered. |
| RFK_NODISCARD REFUREKU_API StaticField const * rfk::Struct::getStaticFieldByPredicate | ( | Predicate< StaticField > | predicate, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Retrieve the first static field satisfying the provided predicate.
| predicate | Predicate defining a valid static field. |
| userData | User data forwarded to the predicate calls. |
| shouldInspectInherited | Should inherited static fields be considered as well in the search process? If false, only static fields introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided predicate. |
| RFK_NODISCARD REFUREKU_API Vector< StaticField const * > rfk::Struct::getStaticFieldsByPredicate | ( | Predicate< StaticField > | predicate, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Retrieve all static fields satisfying the provided predicate.
| predicate | Predicate defining a valid static field. |
| userData | User data forwarded to the predicate calls. |
| shouldInspectInherited | Should inherited static fields be considered as well in the search process? If false, only static fields introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
Get the number of static fields (including inherited ones) in this struct.
|
noexcept |
| name | Name of the static method to retrieve. |
| minFlags | Requirements the queried static method should fulfill. Keep in mind that the returned static method should contain all of the specified flags, so setting for example Public and Protected will always return nullptr. EMethodFlags::Default means no requirement, so the first static method named methodName will be returned. Note: It doesn't matter whether you set the Static flag or not as this method is designed to return static methods only. |
| shouldInspectInherited | Should inherited static methods be considered as well in the search process? If false, only static methods introduced by this struct will be considered. |
|
noexcept |
| name | Name of the static method to retrieve. |
| minFlags | Requirements the queried static method should fulfill. Keep in mind that the returned static method should contain all of the specified flags, so setting for example Public and Protected will always return nullptr. EMethodFlags::Default means no requirement, so the first static method named methodName will be returned. Note: It doesn't matter whether you set the Static flag or not as this method is designed to return static methods only. |
| shouldInspectInherited | Should inherited static methods be considered as well in the search process? If false, only static methods introduced by this struct will be considered. |
| RFK_NODISCARD REFUREKU_API StaticMethod const * rfk::Struct::getStaticMethodByPredicate | ( | Predicate< StaticMethod > | predicate, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Retrieve the first static method satisfying the provided predicate.
| predicate | Predicate defining a valid static method. |
| userData | User data forwarded to the predicate calls. |
| shouldInspectInherited | Should inherited static methods be considered as well in the search process? If false, only static methods introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
| methodName | Name of the static methods to retrieve. |
| minFlags | Requirements the queried static methods should fulfill. Keep in mind that the returned static methods should contain all of the specified flags, so setting for example Public and Protected will always return an empty vector. EMethodFlags::Default means no requirement, so all static methods named methodName will be returned. Note: It doesn't matter whether you set the Static flag or not as this method is designed to return static methods only. |
| shouldInspectInherited | Should inherited static methods be considered as well in the search process? If false, only static methods introduced by this struct will be considered. |
| RFK_NODISCARD REFUREKU_API Vector< StaticMethod const * > rfk::Struct::getStaticMethodsByPredicate | ( | Predicate< StaticMethod > | predicate, |
| void * | userData, | ||
| bool | shouldInspectInherited = false |
||
| ) | const |
Retrieve all static methods satisfying the provided predicate.
| predicate | Predicate defining a valid static method. |
| userData | User data forwarded to the predicate calls. |
| shouldInspectInherited | Should inherited static methods be considered as well in the search process? If false, only static methods introduced by this struct will be considered. |
| Any | exception potentially thrown from the provided predicate. |
|
noexcept |
Get the number of static methods (excluding inherited ones) in this struct.
|
noexcept |
Get the pointer offset to transform an instance of this Struct pointer to a pointer of the provided Struct. Only search the offset in this struct subclasses. If to is a parent of this struct, false will be returned.
| to | Struct metadata of the target struct. |
| out_pointerOffset | The resulting pointer offset if found. |
|
noexcept |
Check if this struct is a base class of another struct/class.
| archetype | Archetype of the tested child struct/class. |
|
noexcept |
Check if this struct is a subclass of another struct/class.
| archetype | Archetype of the tested parent struct/class. |
| RFK_NODISCARD rfk::SharedPtr< ReturnType > rfk::Struct::makeSharedInstance | ( | ArgTypes &&... | args | ) | const |
Make an instance of the class represented by this archetype with the matching instantiator. One can add new instantiators to any class by using the Instantiator method property.
| Any | exception potentially thrown by the used instantiator. |
| RFK_NODISCARD rfk::UniquePtr< ReturnType > rfk::Struct::makeUniqueInstance | ( | ArgTypes &&... | args | ) | const |
Make an instance of the class represented by this archetype with the matching instantiator. One can add new instantiators to any class by using the Instantiator method property.
| Any | exception potentially thrown by the used instantiator. |
|
noexcept |
Set the number of direct parents for this struct. Useful to avoid reallocations and avoid having unused memory. If the number of direct parents is already >= to the provided count, this method has no effect.
| capacity | The number of direct parents of this struct. |
|
noexcept |
Internally pre-allocate enough memory for the provided number of fields. If the number of fields is already >= to the provided capacity, this method has no effect.
| capacity | The number of fields to pre-allocate. |
|
noexcept |
Internally pre-allocate enough memory for the provided number of methods. If the number of methods is already >= to the provided capacity, this method has no effect.
| capacity | The number of methods to pre-allocate. |
|
noexcept |
Internally pre-allocate enough memory for the provided number of nested archetypes. If the number of nested archetypes is already >= to the provided capacity, this method has no effect.
| capacity | The number of nested archetypes to pre-allocate. |
|
noexcept |
Internally pre-allocate enough memory for the provided number of static fields. If the number of static fields is already >= to the provided capacity, this method has no effect.
| capacity | The number of static fields to pre-allocate. |
|
noexcept |
Internally pre-allocate enough memory for the provided number of static methods. If the number of static methods is already >= to the provided capacity, this method has no effect.
| capacity | The number of static methods to pre-allocate. |