Skip to content

v2.2.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 13 May 06:04

New

  • (#11) A bunch of new methods were added to the Field and Method classes to have more control when instances are stored in void* variables.
    • 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.

Updates

  • The InvalidCaller exception was renamed InvalidArchetype
  • Since unsafe methods have been added to Field and Method classes, all originally available methods are now completely safe and require the provided instance to be reflected and implement both the static staticGetArchetype method and override the virtual getArchetype method inherited from rfk::Object. If the provided instance has an invalid type to access the field / call the method, the 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.

  • TypeTemplateArgument class now stores a Type instead of an Archetype.

Fixes

  • Field class methods now correctly perform the instance pointer adjustment when necessary.