33#define FASTLED_SMART_PTR(type) \
35 using type##Ptr = fl::shared_ptr<type>;
37#define FASTLED_SMART_PTR_STRUCT(type) \
39 using type##Ptr = fl::shared_ptr<type>;
41#define FASTLED_SMART_PTR_NO_FWD(type) using type##Ptr = fl::shared_ptr<type>;
45#define FASTLED_SMART_PTR_CONSTRUCTOR(type, constructor) \
46 template <> class PtrTraits<type> { \
48 template <typename... Args> static shared_ptr<type> New(Args... args) { \
49 fl::shared_ptr<type> ptr = constructor(args...); \
58template <
typename T>
class Ptr;
59template <
typename T>
class WeakPtr;
61template <
typename T,
typename... Args> Ptr<T>
NewPtr(Args...
args);
118 template <
typename... Args>
135 template <
typename U,
typename = fl::is_derived<T, U>>
144 Ptr(T *referent) =
delete;
150 Ptr(
Ptr &&other)
noexcept;
171 explicit operator bool() const noexcept {
return referent_ !=
nullptr; }
179 void swap(
Ptr &other)
noexcept;
183 Ptr(T *referent,
bool from_heap);
196 template <
typename U>
203 template <
typename U>
212 operator bool()
const;
237template <
typename T,
typename... Args>
bool operator<(const Ptr &other) const
static Ptr TakeOwnership(T *ptr)
void swap(Ptr &other) noexcept
WeakPtr< T > weakRefNoCreate() const
Ptr(const Ptr< U > &refptr)
bool operator==(const Ptr &other) const
static Ptr NoTracking(T &referent)
bool operator!=(const Ptr &other) const
Ptr & operator=(T *referent)=delete
WeakPtr< T > weakPtr() const
bool operator==(const T *other) const
bool operator!=(const T *other) const
WeakPtr & operator=(const WeakPtr &other)
fl::uptr ptr_value() const
bool operator==(const WeakPtr &other) const
bool operator!=(const WeakPtr &other) const
Implements the FastLED namespace macros.
To bit_cast(const From &from) noexcept
Ptr< T > NewPtr(Args... args)
Ptr< T > NewPtrNoTracking(Args... args)