FastLED
3.9.15
Loading...
Searching...
No Matches
ref.cpp
Go to the documentation of this file.
1
#include "
fl/ptr.h
"
2
3
#include "
fl/namespace.h
"
4
5
namespace
fl
{
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
(
mWeakPtr
) {
16
mWeakPtr
->setReferent(
nullptr
);
17
mWeakPtr
.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
}
// namespace fl
fl::Referent::ref_count
virtual int ref_count() const
Definition
ref.cpp:11
fl::Referent::operator=
Referent & operator=(const Referent &)
fl::Referent::mWeakPtr
Ptr< WeakReferent > mWeakPtr
Definition
ptr.h:411
fl::Referent::mRefCount
int mRefCount
Definition
ptr.h:410
fl::Referent::~Referent
virtual ~Referent()
fl::Referent::ref
virtual void ref()
Definition
ref.cpp:9
fl::Referent::Referent
Referent()
Definition
ref.cpp:7
fl::Referent::destroy
virtual void destroy()
Definition
ref.cpp:23
fl::Referent::unref
virtual void unref()
Definition
ref.cpp:13
fl::Referent
Definition
ptr.h:387
ptr.h
namespace.h
Implements the FastLED namespace macros.
fl
Implements a simple red square effect for 2D LED grids.
Definition
crgb.h:16
fl
ref.cpp
Generated on Fri Apr 18 2025 03:39:31 for FastLED by
1.13.2