MCPcopy Create free account
hub / github.com/FastLED/FastLED / getId

Method getId

src/fl/channels/id_tracker.cpp.hpp:30–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30bool IdTracker::getId(void* ptr, int* outId) FL_NOEXCEPT {
31 if (!ptr || !outId) {
32 return false;
33 }
34
35 // Lock for thread safety
36 mMutex.lock();
37
38 auto it = mPointerToId.find(ptr);
39 bool found = (it != mPointerToId.end());
40 if (found) {
41 *outId = it->second;
42 }
43
44 mMutex.unlock();
45 return found;
46}
47
48bool IdTracker::removeId(void* ptr) FL_NOEXCEPT {
49 if (!ptr) {

Callers

nothing calls this directly

Calls 4

lockMethod · 0.45
findMethod · 0.45
endMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected