MCPcopy Create free account
hub / github.com/dobin/RedEdr / remove_callback

Function remove_callback

RedEdrShared/loguru.cpp:1005–1019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1003 }
1004
1005 bool remove_callback(const char* id)
1006 {
1007 std::lock_guard<std::recursive_mutex> lock(s_mutex);
1008 auto it = std::find_if(begin(s_callbacks), end(s_callbacks), [&](const Callback& c) { return c.id == id; });
1009 if (it != s_callbacks.end()) {
1010 if (it->close) { it->close(it->user_data); }
1011 s_callbacks.erase(it);
1012 on_callback_change();
1013 return true;
1014 }
1015 else {
1016 LOG_F(ERROR, "Failed to locate callback with id '" LOGURU_FMT(s) "'", id);
1017 return false;
1018 }
1019 }
1020
1021 void remove_all_callbacks()
1022 {

Callers

nothing calls this directly

Calls 6

on_callback_changeFunction · 0.85
closeMethod · 0.80
eraseMethod · 0.80
beginFunction · 0.70
endFunction · 0.70
endMethod · 0.45

Tested by

no test coverage detected