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

Method getComponents

src/platforms/shared/ui/json/ui_manager.cpp.hpp:112–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112fl::vector<JsonUiInternalPtr> JsonUiManager::getComponents() FL_NOEXCEPT {
113 fl::unique_lock<fl::mutex> lock(mMutex);
114 fl::vector<JsonUiInternalPtr> out;
115 for (auto &component : mComponents) {
116 if (auto ptr = component.lock()) {
117 out.push_back(ptr);
118 } else {
119 FL_WARN("*** WARNING: Component weak_ptr is expired, skipping");
120 }
121 }
122 // Sort components by ID to ensure consistent serialization order
123 fl::sort(out.begin(), out.end(), [](const JsonUiInternalPtr& a, const JsonUiInternalPtr& b) FL_NOEXCEPT {
124 return a->id() < b->id();
125 });
126 return out;
127}
128
129JsonUiInternalPtr JsonUiManager::findUiComponent(const char* id_or_name) FL_NOEXCEPT {
130 auto components = getComponents();

Callers

nothing calls this directly

Calls 6

sortFunction · 0.85
lockMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected