FastLED
3.9.3
Loading...
Searching...
No Matches
singleton.h
1
#pragma once
2
3
#include "namespace.h"
4
5
FASTLED_NAMESPACE_BEGIN
6
7
// A templated singleton class, parameterized by the type of the singleton and an optional integer.
8
template
<
typename
T,
int
N = 0>
9
class
Singleton
{
10
public
:
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
;
20
private
:
21
Singleton
() =
default
;
22
~Singleton
() =
default
;
23
};
24
25
FASTLED_NAMESPACE_END
Singleton
Definition
singleton.h:9
src
singleton.h
Generated on Thu Nov 14 2024 00:00:34 for FastLED by
1.11.0