godot/core/object/class_db.cpp

/**************************************************************************/
/*  class_db.cpp                                                          */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "class_db.h"

#include "core/config/engine.h"
#include "core/io/resource_loader.h"
#include "core/object/script_language.h"
#include "core/os/mutex.h"
#include "core/version.h"

#define OBJTYPE_RLOCK
#define OBJTYPE_WLOCK

#ifdef DEBUG_METHODS_ENABLED

MethodDefinition D_METHODP(const char *p_name, const char *const **p_args, uint32_t p_argcount) {}

#endif

ClassDB::APIType ClassDB::current_api =;
HashMap<ClassDB::APIType, uint32_t> ClassDB::api_hashes_cache;

void ClassDB::set_current_api(APIType p_api) {}

ClassDB::APIType ClassDB::get_current_api() {}

HashMap<StringName, ClassDB::ClassInfo> ClassDB::classes;
HashMap<StringName, StringName> ClassDB::resource_base_extensions;
HashMap<StringName, StringName> ClassDB::compat_classes;

#ifdef TOOLS_ENABLED
HashMap<StringName, ObjectGDExtension> ClassDB::placeholder_extensions;

class PlaceholderExtensionInstance {};
#endif

bool ClassDB::_is_parent_class(const StringName &p_class, const StringName &p_inherits) {}

bool ClassDB::is_parent_class(const StringName &p_class, const StringName &p_inherits) {}

void ClassDB::get_class_list(List<StringName> *p_classes) {}

#ifdef TOOLS_ENABLED
void ClassDB::get_extensions_class_list(List<StringName> *p_classes) {}

void ClassDB::get_extension_class_list(const Ref<GDExtension> &p_extension, List<StringName> *p_classes) {}
#endif

void ClassDB::get_inheriters_from_class(const StringName &p_class, List<StringName> *p_classes) {}

void ClassDB::get_direct_inheriters_from_class(const StringName &p_class, List<StringName> *p_classes) {}

StringName ClassDB::get_parent_class_nocheck(const StringName &p_class) {}

bool ClassDB::get_inheritance_chain_nocheck(const StringName &p_class, Vector<StringName> &r_result) {}

StringName ClassDB::get_compatibility_remapped_class(const StringName &p_class) {}

StringName ClassDB::_get_parent_class(const StringName &p_class) {}

StringName ClassDB::get_parent_class(const StringName &p_class) {}

ClassDB::APIType ClassDB::get_api_type(const StringName &p_class) {}

uint32_t ClassDB::get_api_hash(APIType p_api) {}

bool ClassDB::class_exists(const StringName &p_class) {}

void ClassDB::add_compatibility_class(const StringName &p_class, const StringName &p_fallback) {}

StringName ClassDB::get_compatibility_class(const StringName &p_class) {}

Object *ClassDB::_instantiate_internal(const StringName &p_class, bool p_require_real_class, bool p_notify_postinitialize) {}

bool ClassDB::_can_instantiate(ClassInfo *p_class_info) {}

Object *ClassDB::instantiate(const StringName &p_class) {}

Object *ClassDB::instantiate_no_placeholders(const StringName &p_class) {}

Object *ClassDB::instantiate_without_postinitialization(const StringName &p_class) {}

#ifdef TOOLS_ENABLED
ObjectGDExtension *ClassDB::get_placeholder_extension(const StringName &p_class) {}
#endif

void ClassDB::set_object_extension_instance(Object *p_object, const StringName &p_class, GDExtensionClassInstancePtr p_instance) {}

bool ClassDB::can_instantiate(const StringName &p_class) {}

bool ClassDB::is_abstract(const StringName &p_class) {}

bool ClassDB::is_virtual(const StringName &p_class) {}

void ClassDB::_add_class2(const StringName &p_class, const StringName &p_inherits) {}

static MethodInfo info_from_bind(MethodBind *p_method) {}

void ClassDB::get_method_list(const StringName &p_class, List<MethodInfo> *p_methods, bool p_no_inheritance, bool p_exclude_from_properties) {}

void ClassDB::get_method_list_with_compatibility(const StringName &p_class, List<Pair<MethodInfo, uint32_t>> *p_methods, bool p_no_inheritance, bool p_exclude_from_properties) {}

bool ClassDB::get_method_info(const StringName &p_class, const StringName &p_method, MethodInfo *r_info, bool p_no_inheritance, bool p_exclude_from_properties) {}

MethodBind *ClassDB::get_method(const StringName &p_class, const StringName &p_name) {}

Vector<uint32_t> ClassDB::get_method_compatibility_hashes(const StringName &p_class, const StringName &p_name) {}

MethodBind *ClassDB::get_method_with_compatibility(const StringName &p_class, const StringName &p_name, uint64_t p_hash, bool *r_method_exists, bool *r_is_deprecated) {}

void ClassDB::bind_integer_constant(const StringName &p_class, const StringName &p_enum, const StringName &p_name, int64_t p_constant, bool p_is_bitfield) {}

void ClassDB::get_integer_constant_list(const StringName &p_class, List<String> *p_constants, bool p_no_inheritance) {}

int64_t ClassDB::get_integer_constant(const StringName &p_class, const StringName &p_name, bool *p_success) {}

bool ClassDB::has_integer_constant(const StringName &p_class, const StringName &p_name, bool p_no_inheritance) {}

StringName ClassDB::get_integer_constant_enum(const StringName &p_class, const StringName &p_name, bool p_no_inheritance) {}

void ClassDB::get_enum_list(const StringName &p_class, List<StringName> *p_enums, bool p_no_inheritance) {}

void ClassDB::get_enum_constants(const StringName &p_class, const StringName &p_enum, List<StringName> *p_constants, bool p_no_inheritance) {}

void ClassDB::set_method_error_return_values(const StringName &p_class, const StringName &p_method, const Vector<Error> &p_values) {}

Vector<Error> ClassDB::get_method_error_return_values(const StringName &p_class, const StringName &p_method) {}

bool ClassDB::has_enum(const StringName &p_class, const StringName &p_name, bool p_no_inheritance) {}

bool ClassDB::is_enum_bitfield(const StringName &p_class, const StringName &p_name, bool p_no_inheritance) {}

void ClassDB::add_signal(const StringName &p_class, const MethodInfo &p_signal) {}

void ClassDB::get_signal_list(const StringName &p_class, List<MethodInfo> *p_signals, bool p_no_inheritance) {}

bool ClassDB::has_signal(const StringName &p_class, const StringName &p_signal, bool p_no_inheritance) {}

bool ClassDB::get_signal(const StringName &p_class, const StringName &p_signal, MethodInfo *r_signal) {}

void ClassDB::add_property_group(const StringName &p_class, const String &p_name, const String &p_prefix, int p_indent_depth) {}

void ClassDB::add_property_subgroup(const StringName &p_class, const String &p_name, const String &p_prefix, int p_indent_depth) {}

void ClassDB::add_property_array_count(const StringName &p_class, const String &p_label, const StringName &p_count_property, const StringName &p_count_setter, const StringName &p_count_getter, const String &p_array_element_prefix, uint32_t p_count_usage) {}

void ClassDB::add_property_array(const StringName &p_class, const StringName &p_path, const String &p_array_element_prefix) {}

// NOTE: For implementation simplicity reasons, this method doesn't allow setters to have optional arguments at the end.
void ClassDB::add_property(const StringName &p_class, const PropertyInfo &p_pinfo, const StringName &p_setter, const StringName &p_getter, int p_index) {}

void ClassDB::set_property_default_value(const StringName &p_class, const StringName &p_name, const Variant &p_default) {}

void ClassDB::add_linked_property(const StringName &p_class, const String &p_property, const String &p_linked_property) {}

void ClassDB::get_property_list(const StringName &p_class, List<PropertyInfo> *p_list, bool p_no_inheritance, const Object *p_validator) {}

void ClassDB::get_linked_properties_info(const StringName &p_class, const StringName &p_property, List<StringName> *r_properties, bool p_no_inheritance) {}

bool ClassDB::get_property_info(const StringName &p_class, const StringName &p_property, PropertyInfo *r_info, bool p_no_inheritance, const Object *p_validator) {}

bool ClassDB::set_property(Object *p_object, const StringName &p_property, const Variant &p_value, bool *r_valid) {}

bool ClassDB::get_property(Object *p_object, const StringName &p_property, Variant &r_value) {}

int ClassDB::get_property_index(const StringName &p_class, const StringName &p_property, bool *r_is_valid) {}

Variant::Type ClassDB::get_property_type(const StringName &p_class, const StringName &p_property, bool *r_is_valid) {}

StringName ClassDB::get_property_setter(const StringName &p_class, const StringName &p_property) {}

StringName ClassDB::get_property_getter(const StringName &p_class, const StringName &p_property) {}

bool ClassDB::has_property(const StringName &p_class, const StringName &p_property, bool p_no_inheritance) {}

void ClassDB::set_method_flags(const StringName &p_class, const StringName &p_method, int p_flags) {}

bool ClassDB::has_method(const StringName &p_class, const StringName &p_method, bool p_no_inheritance) {}

int ClassDB::get_method_argument_count(const StringName &p_class, const StringName &p_method, bool *r_is_valid, bool p_no_inheritance) {}

void ClassDB::bind_method_custom(const StringName &p_class, MethodBind *p_method) {}
void ClassDB::bind_compatibility_method_custom(const StringName &p_class, MethodBind *p_method) {}

void ClassDB::_bind_compatibility(ClassInfo *type, MethodBind *p_method) {}

void ClassDB::_bind_method_custom(const StringName &p_class, MethodBind *p_method, bool p_compatibility) {}

MethodBind *ClassDB::_bind_vararg_method(MethodBind *p_bind, const StringName &p_name, const Vector<Variant> &p_default_args, bool p_compatibility) {}

#ifdef DEBUG_METHODS_ENABLED
MethodBind *ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind, bool p_compatibility, const MethodDefinition &method_name, const Variant **p_defs, int p_defcount) {}

void ClassDB::add_virtual_method(const StringName &p_class, const MethodInfo &p_method, bool p_virtual, const Vector<String> &p_arg_names, bool p_object_core) {}

void ClassDB::get_virtual_methods(const StringName &p_class, List<MethodInfo> *p_methods, bool p_no_inheritance) {}

void ClassDB::add_extension_class_virtual_method(const StringName &p_class, const GDExtensionClassVirtualMethodInfo *p_method_info) {}

void ClassDB::set_class_enabled(const StringName &p_class, bool p_enable) {}

bool ClassDB::is_class_enabled(const StringName &p_class) {}

bool ClassDB::is_class_exposed(const StringName &p_class) {}

bool ClassDB::is_class_reloadable(const StringName &p_class) {}

bool ClassDB::is_class_runtime(const StringName &p_class) {}

void ClassDB::add_resource_base_extension(const StringName &p_extension, const StringName &p_class) {}

void ClassDB::get_resource_base_extensions(List<String> *p_extensions) {}

bool ClassDB::is_resource_extension(const StringName &p_extension) {}

void ClassDB::get_extensions_for_type(const StringName &p_class, List<String> *p_extensions) {}

HashMap<StringName, HashMap<StringName, Variant>> ClassDB::default_values;
HashSet<StringName> ClassDB::default_values_cached;

Variant ClassDB::class_get_default_property_value(const StringName &p_class, const StringName &p_property, bool *r_valid) {}

void ClassDB::register_extension_class(ObjectGDExtension *p_extension) {}

void ClassDB::unregister_extension_class(const StringName &p_class, bool p_free_method_binds) {}

HashMap<StringName, ClassDB::NativeStruct> ClassDB::native_structs;
void ClassDB::register_native_struct(const StringName &p_name, const String &p_code, uint64_t p_current_size) {}

void ClassDB::get_native_struct_list(List<StringName> *r_names) {}

String ClassDB::get_native_struct_code(const StringName &p_name) {}

uint64_t ClassDB::get_native_struct_size(const StringName &p_name) {}

RWLock ClassDB::lock;

void ClassDB::cleanup_defaults() {}

void ClassDB::cleanup() {}

// Array to use in optional parameters on methods and the DEFVAL_ARRAY macro.
Array ClassDB::default_array_arg =;

bool ClassDB::is_default_array_arg(const Array &p_array) {}

//