FastLED
3.9.3
Loading...
Searching...
No Matches
ref.cpp
1
#include "ref.h"
2
3
#include "namespace.h"
4
5
FASTLED_NAMESPACE_BEGIN
6
7
Referent::Referent() : mRefCount(0) {}
8
Referent::~Referent() =
default
;
9
void
Referent::ref() { mRefCount++; }
10
11
int
Referent::ref_count()
const
{
return
mRefCount; }
12
13
void
Referent::unref() {
14
if
(--mRefCount == 0) {
15
if
(mWeakRef) {
16
mWeakRef->setReferent(
nullptr
);
17
mWeakRef.reset();
18
}
19
destroy();
20
}
21
}
22
23
void
Referent::destroy() {
delete
this
; }
24
25
Referent::Referent(
const
Referent
&) =
default
;
26
Referent
&Referent::operator=(
const
Referent
&) =
default
;
27
Referent::Referent(
Referent
&&) =
default
;
28
Referent
&Referent::operator=(
Referent
&&) =
default
;
29
30
FASTLED_NAMESPACE_END
Referent
Definition
ref.h:384
src
ref.cpp
Generated on Thu Nov 14 2024 00:00:34 for FastLED by
1.11.0