29#ifndef ETL_REFERENCE_COUNTED_OBJECT_INCLUDED
30#define ETL_REFERENCE_COUNTED_OBJECT_INCLUDED
51 reference_counting_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
52 :
exception(reason_, file_name_, line_number_)
65 reference_count_overrun(string_type file_name_, numeric_type line_number_)
80 virtual void set_reference_count(int32_t value) = 0;
81 virtual void increment_reference_count() = 0;
83 virtual int32_t decrement_reference_count() = 0;
85 virtual int32_t get_reference_count()
const = 0;
91 template <
typename TCounter>
109 reference_count = value;
128 return int32_t(--reference_count);
137 return int32_t(reference_count);
142 TCounter reference_count;
215 template <
typename TObject,
typename TCounter>
220 typedef TObject value_type;
221 typedef TCounter counter_type;
240 template <
typename... TArgs>
242 : object(
etl::forward<TArgs>(args)...)
271 return reference_counter;
280 return reference_counter;
293#if ETL_USING_CPP11 && ETL_HAS_ATOMIC
298 template <
typename TObject>
Base for all reference counted objects.
Definition reference_counted_object.h:200
The base of all reference counters.
Definition reference_counted_object.h:76
Definition reference_counted_object.h:62
Definition reference_counted_object.h:217
virtual ETL_NODISCARD ireference_counter & get_reference_counter() ETL_OVERRIDE
Get a reference to the reference counter.
Definition reference_counted_object.h:269
reference_counted_object()
Constructor.
Definition reference_counted_object.h:226
ETL_NODISCARD value_type & get_object()
Get a reference to the counted object.
Definition reference_counted_object.h:251
reference_counted_object(const TObject &object_)
Constructor.
Definition reference_counted_object.h:231
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:278
ETL_NODISCARD const value_type & get_object() const
Get a const reference to the counted object.
Definition reference_counted_object.h:260
reference_counter()
Constructor.
Definition reference_counted_object.h:156
virtual void set_reference_count(int32_t) ETL_OVERRIDE
Set the reference count.
Definition reference_counted_object.h:164
virtual ETL_NODISCARD int32_t get_reference_count() const ETL_OVERRIDE
Get the current reference count.
Definition reference_counted_object.h:190
virtual void increment_reference_count() ETL_OVERRIDE
Increment the reference count.
Definition reference_counted_object.h:172
virtual ETL_NODISCARD int32_t decrement_reference_count() ETL_OVERRIDE
Decrement the reference count.
Definition reference_counted_object.h:181
A specific type of reference counter.
Definition reference_counted_object.h:93
virtual ETL_NODISCARD int32_t get_reference_count() const ETL_OVERRIDE
Get the current reference count.
Definition reference_counted_object.h:135
virtual void increment_reference_count() ETL_OVERRIDE
Increment the reference count.
Definition reference_counted_object.h:115
reference_counter()
Constructor.
Definition reference_counted_object.h:99
virtual void set_reference_count(int32_t value) ETL_OVERRIDE
Set the reference count.
Definition reference_counted_object.h:107
virtual ETL_NODISCARD int32_t decrement_reference_count() ETL_OVERRIDE
Decrement the reference count.
Definition reference_counted_object.h:124
Definition reference_counted_object.h:48
#define ETL_ASSERT(b, e)
Definition error_handler.h:511
ETL_EXCEPTION_CONSTEXPR exception(string_type reason_, string_type, numeric_type)
Constructor.
Definition exception.h:81
Definition exception.h:59
bitset_ext
Definition absolute.h:40