FastLED 3.9.15
Loading...
Searching...
No Matches

◆ instance()

template<typename T, int N = 0>
static T & fl::Singleton< T, N >::instance ( )
inlinestatic

Definition at line 41 of file singleton.h.

41 {
42 // Aligned char buffer storage — never destroyed
44 char data[sizeof(T)];
45 };
46
48 static T* ptr = nullptr;
49 if (!ptr) {
50#if FL_HAS_SANITIZER_LSAN
52#endif
53 ptr = new (&storage.data) T();
54 }
55 return *ptr;
56 }

Referenced by fl::audio::Sample::Sample(), fl::audio::Sample::~Sample(), fl::async_log_service(), fl::default_random(), fl::AsyncLogger::disableBackgroundFlush(), fl::AsyncLogger::enableBackgroundFlush(), fl::audio::Sample::fft(), fl::get_rgbw_colorimetric_profile(), fl::get_rgbww_colorimetric_profile(), fl::global_interner(), fl::audio::fft::FFT::globalCache(), gPowerModel(), fl::audio::AudioManager::instance(), fl::ChannelEvents::instance(), fl::ChannelManager::instance(), fl::net::http::FetchManager::instance(), fl::task::Executor::instance(), fl::task::Scheduler::instance(), fl::Singleton< AutoResearchRemoteControl >::instanceRef(), fl::SingletonShared< T, N >::instanceRef(), fl::AsyncLogger::isBackgroundFlushEnabled(), fl::audio::fft::Bins::pool(), fl::rgb_2_rgbw_user_function(), fl::rgb_2_rgbww_user_function(), fl::set_rgb_2_rgbw_function(), fl::set_rgb_2_rgbww_function(), fl::set_rgbw_colorimetric_profile(), fl::set_rgbww_colorimetric_profile(), and fl::pwm_state::state().

+ Here is the caller graph for this function: