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

Method is_connected

core/object/object.cpp:1564–1583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1562}
1563
1564bool Object::is_connected(const StringName &p_signal, const Callable &p_callable) const {
1565 ERR_FAIL_COND_V_MSG(p_callable.is_null(), false, vformat("Cannot determine if connected to '%s': the provided callable is null.", p_signal)); // Should use `is_null`, see note in `connect` about the use of `is_valid`.
1566 OBJ_SIGNAL_LOCK
1567
1568 const SignalData *s = signal_map.getptr(p_signal);
1569 if (!s) {
1570 bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal);
1571 if (signal_is_valid) {
1572 return false;
1573 }
1574
1575 if (!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal)) {
1576 return false;
1577 }
1578
1579 ERR_FAIL_V_MSG(false, vformat("Nonexistent signal: '%s'.", p_signal));
1580 }
1581
1582 return s->slot_map.has(*p_callable.get_base_comparator());
1583}
1584
1585bool Object::has_connections(const StringName &p_signal) const {
1586 OBJ_SIGNAL_LOCK

Callers

nothing calls this directly

Calls 6

vformatFunction · 0.85
is_nullMethod · 0.45
getptrMethod · 0.45
has_script_signalMethod · 0.45
hasMethod · 0.45
get_base_comparatorMethod · 0.45

Tested by

no test coverage detected