Cross-platform C++17 Runtime Reflection Library
MIT License
Bot releases are visible (Hide)
Field::getUnsafe<>(void [const]* instance)
Field::setUnsafe<>(void [const]* instance, Value value)
Field::setUnsafe(void [const]* instance, void const* valuePtr, size_t valueSize)
Field::getPtrUnsafe(void [const]* instance)
Field::getConstPtrUnsafe(void [const]* instance)
Method::invokeUnsafe(void [const]* caller, ArgTypes&&... args)
Method::checkedInvokeUnsafe(void [const]* caller, ArgTypes&&... args)
Since the static and dynamic archetypes of provided instances is unknown, no pointer adjustment can be performed explaining the "unsafe" naming, but it is nearly always safe as long as instances do not use multiple inheritance.
InvalidCaller
exception was renamed InvalidArchetype
InvalidArchetype
exception is thrown.
Field::get<>
Field::set<>
Field::set
Field::getPtr
Field::getConstPtr
Method::invoke
Method::checkedInvoke
The rfk::Object
inheritance requirement is heavy so I'm thinking about a way to tell the generator to generate the getArchetype base definition / override if the parsed class is or inherits from any of a user-customizable set of classes.
Published by github-actions[bot] over 2 years ago
orderedByDeclaration
has been added to the method rfk::Struct::getFieldsByPredicate
. As its name states it, the returned fields are ordered by declaration order (inherited fields first) when orderedByDeclaration
is set to true. You can now easily iterate over all fields of a Struct in the right order with the following lines:rfk::Struct const& yourStruct = ...;
for (rfk::Field const* field : yourStruct.getFieldsByPredicate([](rfk::Field const&, void*){ return true; }, nullptr, true, true))
{
}
getArchetype
method for class templates from a given template signature://Before 2.1.2
namespace rfk
{
template <template <typename, int> typename>
rfk::Archetype const* getArchetype() noexcept { return nullptr; }
}
//From 2.1.2
RFK_DEFINE_GET_ARCHETYPE_TEMPLATE(typename, int)
template <typename T, int U>
class CLASS() ClassTemplateWithDifferentTemplateParamTypes
{
ClassTemplateWithDifferentTemplateParamTypes_GENERATED
};
rfk::getArchetype<>
and rfk::getEnum<>
now return valid metadata in contexts where said archetypes are accessible (it was retruning nullptr before).#include "Generated/ExampleClass.rfkh.h"
class CLASS() ExampleClass
{
private:
class CLASS() NestedPrivateClass
{
ExampleClass_NestedPrivateClass_GENERATED
};
enum class ENUM() NestedPrivateEnum
{
};
void testMethod()
{
//Both of those calls do not return nullptr anymore
rfk::getArchetype<NestedPrivateClass>();
rfk::getEnum<NestedPrivateEnum>();
}
ExampleClass_GENERATED
};
File_ExampleClass_GENERATED
Published by github-actions[bot] over 2 years ago
This patch brings some fixes and stability improvements:
rfk::Struct::makeSharedInstance
and rfk::Struct::makeUniqueInstance
methods, the pointer is correctly adjusted if the return type has a non-zero memory offset compared to the instantiated class (happens when the class uses multiple inheritance with polymorphic parents -> multiple virtual tables).class CLASS() A
{
public:
virtual ~A() = default;
A_GENERATED
};
class CLASS() B
{
public:
virtual ~B() = default;
B_GENERATED
};
class CLASS() C : public A, public B
{
C_GENERATED
};
//....
//Was valid before since casting from C to A doesn't change the pointer address
C::staticGetArchetype().makeSharedInstance<A>();
//Was not valid before since casting from C to B does change the pointer address
//but Refureku was not doing the pointer adjustment internally
//This is now fixed with version 2.1.1
C::staticGetArchetype().makeSharedInstance<B>();
Published by github-actions[bot] over 2 years ago
The 2.1.0 minor update introduces a few new features, some slight performance/memory improvements and patch some bugs.
rfk::Method::invoke
and rfk::Method::checkedInvoke
on children instances without crash. However, rfk::Method::checkedInvoke
now requires the caller to inherit from rfk::Object, and rfk::Method::invoke
is not safe if the method is virtual, the caller pointer doesn't immediately point to the called method vtable, and the caller doesn't inherit from rfk::Object.Published by github-actions[bot] over 2 years ago
This patch brings some fixes when Refureku is used on dynamic libraries.
With the generator c++ API:
kodgen::MacroCodeGenUnitSettings codeGenUnitSettings;
codeGenUnitSettings.setExportSymbolMacroName("YOUR_EXPORT_MACRO");
With the toml settings file:
[CodeGenUnitSettings]
exportSymbolMacroName = "YOUR_EXPORT_MACRO"
Published by github-actions[bot] almost 3 years ago
This new patch version brings a few quality of life slight modifications not related to the API:
-DBUILD_TESTING=OFF
CMake flag (in which case Google tests won't be fetched).#if REFUREKU_VERSION >= 20002
//This Refureku version is >= to v2.0.2
#endif
Published by github-actions[bot] almost 3 years ago
This update only fixes a few generator bugs by updating Kodgen to the latest version. See Kodgen release notes for more info.
Published by github-actions[bot] almost 3 years ago
It’s been nearly a year since the last Refureku release (v1.4.0). I was really busy and unfortunately couldn’t spend much time on the project. I had a lot of feedbacks from users and realized a bunch of things were not right, which is the reason for this major jump to v2. This release brings new interesting features and is overall more robust and stable than the previous major release.
Published by jsoysouvanh almost 4 years ago
/
Published by jsoysouvanh almost 4 years ago
Published by jsoysouvanh about 4 years ago
Published by jsoysouvanh over 4 years ago
Published by jsoysouvanh over 4 years ago
Published by jsoysouvanh over 4 years ago
This release brings a lot of documentation and a bunch of new features that make Refureku easier to use.