FastLED 3.9.7
Loading...
Searching...
No Matches
singleton.h
1#pragma once
2
3#include "fl/namespace.h"
4
5namespace fl {
6
7// A templated singleton class, parameterized by the type of the singleton and an optional integer.
8template<typename T, int N = 0>
9class Singleton {
10public:
11 static T& instance() {
12 static T instance;
13 return instance;
14 }
15 static T* instanceRef() {
16 return &instance();
17 }
18 Singleton(const Singleton&) = delete;
19 Singleton& operator=(const Singleton&) = delete;
20private:
21 Singleton() = default;
22 ~Singleton() = default;
23};
24
25} // namespace fl
Implements the FastLED namespace macros.
Implements a simple red square effect for 2D LED grids.
Definition crgb.h:16