29#ifndef ETL_REFERENCE_COUNTED_OBJECT_INCLUDED
30#define ETL_REFERENCE_COUNTED_OBJECT_INCLUDED
77 virtual void set_reference_count(
int32_t value) = 0;
78 virtual void increment_reference_count() = 0;
79 ETL_NODISCARD
virtual int32_t decrement_reference_count() = 0;
80 ETL_NODISCARD
virtual int32_t get_reference_count()
const = 0;
86 template <
typename TCounter>
104 reference_count = value;
122 return int32_t(--reference_count);
130 return int32_t(reference_count);
204 template <
typename TObject,
typename TCounter>
231 template <
typename...
TArgs>
281#if ETL_USING_CPP11 && ETL_HAS_ATOMIC
286 template <
typename TObject>
Base for all reference counted objects.
Definition reference_counted_object.h:191
The base of all reference counters.
Definition reference_counted_object.h:73
Definition reference_counted_object.h:61
Definition reference_counted_object.h:206
virtual ETL_NODISCARD ireference_counter & get_reference_counter() ETL_OVERRIDE
Get a reference to the reference counter.
Definition reference_counted_object.h:258
reference_counted_object()
Constructor.
Definition reference_counted_object.h:215
ETL_NODISCARD value_type & get_object()
Get a reference to the counted object.
Definition reference_counted_object.h:241
reference_counted_object(const TObject &object_)
Constructor.
Definition reference_counted_object.h:222
virtual ETL_NODISCARD const ireference_counter & get_reference_counter() const ETL_OVERRIDE
Get a const reference to the reference counter.
Definition reference_counted_object.h:266
ETL_NODISCARD const value_type & get_object() const
Get a const reference to the counted object.
Definition reference_counted_object.h:250
reference_counter()
Constructor.
Definition reference_counted_object.h:149
virtual void set_reference_count(int32_t) ETL_OVERRIDE
Set the reference count.
Definition reference_counted_object.h:157
virtual ETL_NODISCARD int32_t get_reference_count() const ETL_OVERRIDE
Get the current reference count.
Definition reference_counted_object.h:181
virtual void increment_reference_count() ETL_OVERRIDE
Increment the reference count.
Definition reference_counted_object.h:165
virtual ETL_NODISCARD int32_t decrement_reference_count() ETL_OVERRIDE
Decrement the reference count.
Definition reference_counted_object.h:173
A specific type of reference counter.
Definition reference_counted_object.h:88
virtual ETL_NODISCARD int32_t get_reference_count() const ETL_OVERRIDE
Get the current reference count.
Definition reference_counted_object.h:128
virtual void increment_reference_count() ETL_OVERRIDE
Increment the reference count.
Definition reference_counted_object.h:110
reference_counter()
Constructor.
Definition reference_counted_object.h:94
virtual void set_reference_count(int32_t value) ETL_OVERRIDE
Set the reference count.
Definition reference_counted_object.h:102
virtual ETL_NODISCARD int32_t decrement_reference_count() ETL_OVERRIDE
Decrement the reference count.
Definition reference_counted_object.h:118
Definition reference_counted_object.h:48
#define ETL_ASSERT(b, e)
Definition error_handler.h:316
Definition exception.h:47
bitset_ext
Definition absolute.h:38
pair holds two objects of arbitrary type
Definition utility.h:164