summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp/classes
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-04-24 14:26:06 -0500
committerDavid Snopek <dsnopek@gmail.com>2024-04-24 14:49:26 -0500
commitca46ef4d256c727a116366334b705ecda0a06c5d (patch)
treee86a7a9ae33484bb1734d9306bf16c1ebfa52aa4 /include/godot_cpp/classes
parente23b117ac32fdbeb0920f234e193e6d31307c0ad (diff)
downloadredot-cpp-ca46ef4d256c727a116366334b705ecda0a06c5d.tar.gz
Give compile-time error if registering a class without its own `_bind_methods()` function
Diffstat (limited to 'include/godot_cpp/classes')
-rw-r--r--include/godot_cpp/classes/wrapped.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp
index 97f9a6e..ce8c968 100644
--- a/include/godot_cpp/classes/wrapped.hpp
+++ b/include/godot_cpp/classes/wrapped.hpp
@@ -214,6 +214,7 @@ protected:
\
public: \
typedef m_class self_type; \
+ typedef m_inherits parent_type; \
\
static void initialize_class() { \
static bool initialized = false; \
@@ -381,6 +382,7 @@ private:
private: \
inline static ::godot::internal::EngineClassRegistration<m_class> _gde_engine_class_registration_helper; \
void operator=(const m_class &p_rval) {} \
+ friend class ::godot::ClassDB; \
\
protected: \
virtual const GDExtensionInstanceBindingCallbacks *_get_bindings_callbacks() const override { \
@@ -390,6 +392,8 @@ protected:
m_class(const char *p_godot_class) : m_inherits(p_godot_class) {} \
m_class(GodotObject *p_godot_object) : m_inherits(p_godot_object) {} \
\
+ static void _bind_methods() {} \
+ \
static void (*_get_bind_methods())() { \
return nullptr; \
} \
@@ -432,6 +436,7 @@ protected:
\
public: \
typedef m_class self_type; \
+ typedef m_inherits parent_type; \
\
static void initialize_class() {} \
\