Implement gdxx::GodotExternClass #3

Open
opened 2026-10-21 01:06:18 -07:00 by queertherians.org · 1 comment
Owner

Starting at line 18 in include/GodotClass.hpp:

template<StringLiteral GodotBaseClassName>
class GodotExternClass : public GodotClass
{
    #warning TODO: implement GodotExternClass

    GodotExternClass(const GodotExternClass&) = delete;
    void operator=(const GodotExternClass&) = delete;
    GodotExternClass(GodotExternClass&&) = delete;
    void operator=(GodotExternClass&&) = delete;
};

This class is meant to provide access to a Godot Class that is implemented in the Godot Runtime without extending/registering it as a new class of its own. The naming of "extern" borrows from extern declarations, which are declared to be filled in by a symbol elsewhere.

It is meant to be derived in C++ specifically for providing the StringLiteral name of the class to pull from, and for methods to be declared (and eventually defined? by macros or reflection?) in the derived class to redirect such method calls to the actual Godot Class to be represented. Will include constructor and destructor initialization.

Speculative: Possible handoff to Godot Runtime may be implemented via a special move operator that releases ownership, should ownership need to exit Native Space and be held in Godot Space. (edit: addressed in #1 and #2)

Refer to #2 for implementation details/complications regarding basic copy/move constructors.

Starting at line 18 in [`include/GodotClass.hpp`](https://barkvr.dev/queertherians.org/gdxx/src/commit/188b63a6e5915e28418e8637cabd3aa441de3bd1/include/GodotClass.hpp#L18): ```cpp template<StringLiteral GodotBaseClassName> class GodotExternClass : public GodotClass { #warning TODO: implement GodotExternClass GodotExternClass(const GodotExternClass&) = delete; void operator=(const GodotExternClass&) = delete; GodotExternClass(GodotExternClass&&) = delete; void operator=(GodotExternClass&&) = delete; }; ``` This class is meant to provide access to a Godot Class that is implemented in the Godot Runtime without extending/registering it as a new class of its own. The naming of "extern" borrows from `extern` declarations, which are declared to be filled in by a symbol elsewhere. It is meant to be derived in C++ specifically for providing the `StringLiteral` name of the class to pull from, and for methods to be declared (and eventually defined? by macros or reflection?) in the derived class to redirect such method calls to the actual Godot Class to be represented. Will include constructor and destructor initialization. ~~Speculative: Possible handoff to Godot Runtime may be implemented via a special move operator that releases ownership, should ownership need to exit Native Space and be held in Godot Space.~~ (edit: addressed in #1 and #2) ~~Refer to #2 for implementation details/complications regarding basic copy/move constructors.~~
Author
Owner

This now needs to be worked on due to our requirement of ClassDB in #1 (GodotCustomClass), except we should probably finish method binding and translation properly before then, so actually this issue is still blocked just by something else, whoops

This now needs to be worked on due to our requirement of ClassDB in #1 (GodotCustomClass), except we should probably finish method binding and translation properly before then, so actually this issue is still blocked just by something else, whoops
Sign in to join this conversation.
No description provided.