21template<
typename T,
typename... Args>
23template<
typename T,
typename A,
typename... Args>
87template<
typename T,
typename Deleter = default_delete<T>>
120 bool object_constructed;
130 constexpr fl::size_t align = control_block_alignment<T>::value;
133 static void operator delete(
void* ptr) {
147 if (object_constructed) {
149 object_constructed =
false;
213 template<typename Y, typename = typename fl::enable_if<fl::is_base_of<T, Y>::value>
::type>
220 other.mPtr =
nullptr;
221 other.mControlBlock =
nullptr;
225 template<typename Y, typename = typename fl::enable_if<fl::is_base_of<T, Y>::value>
::type>
227 other.mPtr =
nullptr;
228 other.mControlBlock =
nullptr;
253 if (
this != &other) {
263 template<typename Y, typename = typename fl::enable_if<fl::is_base_of<T, Y>::value>
::type>
266 mPtr =
static_cast<T*
>(other.mPtr);
273 if (
this != &other) {
281 template<typename Y, typename = typename fl::enable_if<fl::is_base_of<T, Y>::value>
::type>
283 if (
static_cast<void*
>(
this) !=
static_cast<void*
>(&other)) {
285 mPtr =
static_cast<T*
>(other.mPtr);
287 other.mPtr =
nullptr;
288 other.mControlBlock =
nullptr;
370 return mPtr ==
nullptr;
374 return mPtr !=
nullptr;
390 template<
typename Y,
typename Deleter>
402 template<
typename Y,
typename... Args>
405 template<
typename Y,
typename Deleter,
typename... Args>
408 template<
typename Y,
typename A,
typename... Args>
422template<
typename T,
typename... Args>
435 void* mem = detail::InlinedControlBlock<T>::operator
new(
436 sizeof(detail::InlinedControlBlock<T>));
437 if (mem ==
nullptr) {
440 auto* control = ::new (mem) detail::InlinedControlBlock<T>();
441 T* obj = control->get_object();
443 control->object_constructed =
true;
448template<
typename T,
typename Deleter,
typename... Args>
451 if (obj ==
nullptr) {
455 if (control ==
nullptr) {
476 if (arr ==
nullptr) {
480 if (control ==
nullptr) {
489template<
typename T,
typename A,
typename... Args>
498template<
typename T,
typename Y>
500 return lhs.get() == rhs.get();
503template<
typename T,
typename Y>
505 return lhs.get() != rhs.get();
508template<
typename T,
typename Y>
510 return lhs.get() < rhs.get();
513template<
typename T,
typename Y>
515 return lhs.get() <= rhs.get();
518template<
typename T,
typename Y>
520 return lhs.get() > rhs.get();
523template<
typename T,
typename Y>
525 return lhs.get() >= rhs.get();
530 return lhs.get() ==
nullptr;
535 return nullptr == rhs.get();
540 return lhs.get() !=
nullptr;
545 return nullptr != rhs.get();
555template<
typename T,
typename Y>
560template<
typename T,
typename Y>
565template<
typename T,
typename Y>
577#define FASTLED_SHARED_PTR(type) \
579 using type##Ptr = fl::shared_ptr<type>;
582#define FASTLED_SHARED_PTR_STRUCT(type) \
584 using type##Ptr = fl::shared_ptr<type>;
588#define FASTLED_SHARED_PTR_NO_FWD(type) using type##Ptr = fl::shared_ptr<type>;
591#define FASTLED_SMART_PTR(type) FASTLED_SHARED_PTR(type)
592#define FASTLED_SMART_PTR_STRUCT(type) FASTLED_SHARED_PTR_STRUCT(type)
593#define FASTLED_SMART_PTR_NO_FWD(type) FASTLED_SHARED_PTR_NO_FWD(type)
Keeps fl's generic templates out of argument-dependent lookup (ADL).
Alignment macros and utilities for FastLED.
void reset(shared_ptr &&other) FL_NO_EXCEPT
fl::RxChannel element_type
bool operator!=(fl::nullptr_t) const FL_NO_EXCEPT
detail::ControlBlockBase * mControlBlock
shared_ptr() FL_NO_EXCEPT
void reset() FL_NO_EXCEPT
shared_ptr(Y *ptr, Deleter d) FL_NO_EXCEPT
void swap(shared_ptr &other) FL_NO_EXCEPT
void swap(shared_ptr &&other) FL_NO_EXCEPT
weak_ptr< fl::RxChannel > weak_type
T * get() const FL_NO_EXCEPT
friend shared_ptr< Y > make_shared_array(size_t n) FL_NO_EXCEPT
shared_ptr(Y *ptr) FL_NO_EXCEPT
long use_count() const FL_NO_EXCEPT
T * operator->() const FL_NO_EXCEPT
bool unique() const FL_NO_EXCEPT
bool operator==(fl::nullptr_t) const FL_NO_EXCEPT
friend shared_ptr< Y > make_shared_with_deleter(Deleter d, Args &&... args) FL_NO_EXCEPT
shared_ptr(T *ptr, detail::ControlBlockBase *control_block, detail::no_tracking_tag) FL_NO_EXCEPT
shared_ptr(const weak_ptr< Y > &weak) FL_NO_EXCEPT
shared_ptr(shared_ptr &&other) FL_NO_EXCEPT
T & operator[](ptrdiff_t idx) const FL_NO_EXCEPT
shared_ptr(const shared_ptr< Y > &other, T *ptr) FL_NO_EXCEPT
shared_ptr(shared_ptr< Y > &&other) FL_NO_EXCEPT
shared_ptr(T *ptr, detail::ControlBlockBase *control_block, detail::make_shared_tag) FL_NO_EXCEPT
shared_ptr(fl::nullptr_t) FL_NO_EXCEPT
~shared_ptr() FL_DTOR_NOEXCEPT
bool is_no_tracking() const FL_NO_EXCEPT
shared_ptr & operator=(shared_ptr< Y > &&other) FL_NO_EXCEPT
shared_ptr & operator=(shared_ptr &&other) FL_NO_EXCEPT
shared_ptr & operator=(const shared_ptr &other) FL_NO_EXCEPT
shared_ptr(const shared_ptr &other) FL_NO_EXCEPT
void acquire() FL_NO_EXCEPT
shared_ptr & operator=(const shared_ptr< Y > &other) FL_NO_EXCEPT
shared_ptr(const shared_ptr< Y > &other) FL_NO_EXCEPT
friend shared_ptr< Y > make_shared_no_tracking(Y &obj) FL_NO_EXCEPT
T & operator*() const FL_NO_EXCEPT
shared_ptr< T > allocate_shared(const A &alloc, Args &&... args) FL_NO_EXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Compile-time linker keep-alive hook for a single fl::Bus.
constexpr T && forward(typename remove_reference< T >::type &t) FL_NO_EXCEPT
decltype(nullptr) nullptr_t
void swap(array< T, N > &lhs, array< T, N > &rhs) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
constexpr int type_rank< T >::value
shared_ptr< T > const_pointer_cast(const shared_ptr< Y > &other) FL_NO_EXCEPT
FASTLED_FORCE_INLINE bool operator==(const CRGB &lhs, const CRGB &rhs) FL_NO_EXCEPT
Check if two CRGB objects have the same color data.
atomic< fl::u32 > atomic_u32
FASTLED_FORCE_INLINE bool operator>(const CRGB &lhs, const CRGB &rhs) FL_NO_EXCEPT
Check if the sum of the color channels in one CRGB object is greater than another.
shared_ptr< T > make_shared_array(size_t n) FL_NO_EXCEPT
FASTLED_FORCE_INLINE bool operator<=(const CRGB &lhs, const CRGB &rhs) FL_NO_EXCEPT
Check if the sum of the color channels in one CRGB object is less than or equal to another.
struct FL_ALIGNAS(4) Wave3BitExpansionLut
Lookup table for nibble-to-waveform expansion in wave3 format (32 bytes)
To bit_cast(const From &from) FL_NO_EXCEPT
void aligned_free(void *ptr) FL_NO_EXCEPT
shared_ptr< T > make_shared_no_tracking(T &obj) FL_NO_EXCEPT
shared_ptr< T > static_pointer_cast(const shared_ptr< Y > &other) FL_NO_EXCEPT
FASTLED_FORCE_INLINE void * aligned_alloc(fl::size_t alignment, fl::size_t size) FL_NO_EXCEPT
FASTLED_FORCE_INLINE bool operator!=(const CRGB &lhs, const CRGB &rhs) FL_NO_EXCEPT
Check if two CRGB objects do not have the same color data.
shared_ptr< T > reinterpret_pointer_cast(const shared_ptr< Y > &other) FL_NO_EXCEPT
FASTLED_FORCE_INLINE bool operator>=(const CRGB &lhs, const CRGB &rhs) FL_NO_EXCEPT
Check if the sum of the color channels in one CRGB object is greater than or equal to another.
shared_ptr< T > make_shared_with_deleter(Deleter d, Args &&... args) FL_NO_EXCEPT
FASTLED_FORCE_INLINE bool operator<(const CRGB &lhs, const CRGB &rhs) FL_NO_EXCEPT
Check if the sum of the color channels in one CRGB object is less than another.
Base definition for an LED controller.
void destroy_object() FL_NO_EXCEPT override
void destroy_control_block() FL_NO_EXCEPT override
ControlBlock(T *p, Deleter d=Deleter(), bool track=true) FL_NO_EXCEPT
static constexpr fl::u32 NO_TRACKING_VALUE
virtual void destroy_control_block() FL_NO_EXCEPT=0
fl::atomic_u32 shared_count
void add_shared_ref() FL_NO_EXCEPT
virtual void destroy_object() FL_NO_EXCEPT=0
ControlBlockBase(bool track=true) FL_NO_EXCEPT
bool is_no_tracking() const FL_NO_EXCEPT
bool remove_shared_ref() FL_NO_EXCEPT
virtual ~ControlBlockBase() FL_DTOR_NOEXCEPT
fl::atomic_u32 weak_count
void operator()(T *ptr) const FL_NO_EXCEPT
static constexpr fl::size value
void operator()(T *ptr) const FL_NO_EXCEPT
void operator()(T *) const FL_NO_EXCEPT