Add a base class or interface for RefCounted (Resources) #7
Labels
No labels
blocked
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#3 Implement gdxx::GodotExternClass
queertherians.org/gdxx
Reference
queertherians.org/gdxx#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GDExtensionInstanceBindingCallbacks.reference_callbacklets us know whether Godot holds any active references to Godot objects that inherit from a RefCounted type. We should make use of this with a new type of base class, along the lines of agdxx::RefCountedinterface which assigns.reference_callbackin thegdxx::GodotClassclass registration at comptime, and manages the object's refcount accordingly.Clarification to functionality: There will be no gdxx::RefCounted interface tag; it should be determined at registration (comptime if possible, otherwise runtime) if we are deriving from a RefCounted class or not, then registration and callback structuring will be handled accordingly.
RefCounted translations (
gdxx::variant_to_object#5) will need to be wrapped into agdxx::Reference (?)native ref counter of some kind, and templating thegdxx::variant_to_objectcall with a non-Reference wrapped type for a RefCounted type needs to result in an error (static_assert).As mentioned elsewhere (which actually should have been principally mentioned here first... my bad-), this requires ClassDB, which requires GodotExternClass to be implemented first.