FastLED 3.10.9
Loading...
Searching...
No Matches

◆ instance()

ChannelManager & fl::ChannelManager::instance ( )
static

Get the global singleton instance.

Returns
Reference to the singleton ChannelManager
Note
Thread-safe singleton initialization

The first call registers the platform's default channel drivers (platforms::initChannelDrivers()). Runtime-selection callers (FastLED.add(cfg), driver queries, Channel dispatch) use this.

Definition at line 32 of file manager.cpp.hpp.

32 {
33 auto& out = registry();
34 // Lazy initialization of platform-specific channel drivers
35 // C++11 guarantees thread-safe static initialization
36 static bool sInitialized = false; // okay static in header
37 if (!sInitialized) {
38 sInitialized = true;
39 platforms::initChannelDrivers();
40 }
41 return out;
42}
static ChannelManager & registry() FL_NO_EXCEPT
Get the singleton WITHOUT registering platform default drivers.

References ChannelManager(), fl::FL_NO_EXCEPT, and registry().

Referenced by fl::channelManager(), fl::Channel::resolveDynamicDriver(), fl::Channel::submitFrame(), and DriverTestRunner::testSingleDriver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: