MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / call

Method call

core/object/object.h:893–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891
892 template <typename... VarArgs>
893 Variant call(const StringName &p_method, VarArgs... p_args) {
894 Variant args[sizeof...(p_args) + 1] = { p_args..., Variant() }; // +1 makes sure zero sized arrays are also supported.
895 const Variant *argptrs[sizeof...(p_args) + 1];
896 for (uint32_t i = 0; i < sizeof...(p_args); i++) {
897 argptrs[i] = &args[i];
898 }
899 Callable::CallError cerr;
900 const Variant ret = callp(p_method, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args), cerr);
901 return (cerr.error == Callable::CallError::CALL_OK) ? ret : Variant();
902 }
903
904 /// Depending on the boolean, we call either the virtual function _notification_backward or _notification_forward.
905 /// - Forward calls subclasses in descending order (e.g. Object -> Node -> Node3D -> extension -> script).

Callers 6

_process_taskMethod · 0.45
callpMethod · 0.45
call_constMethod · 0.45
cleanupMethod · 0.45
set_propertyMethod · 0.45
get_propertyMethod · 0.45

Calls 2

callpFunction · 0.85
VariantClass · 0.50

Tested by

no test coverage detected