FastUIDraw
|
A wrapper over a pointer to implement reference counting. More...
#include <reference_counted.hpp>
A wrapper over a pointer to implement reference counting.
The class T must implement the static methods
where T::add_reference() increment the reference count and T::remove_reference() decrements the reference count and will delete the object.
See also reference_counted_base and reference_counted.
Definition at line 54 of file reference_counted.hpp.
|
inline |
Ctor, inits the reference_counted_ptr as equivalent to nullptr.
Definition at line 68 of file reference_counted.hpp.
|
inline |
Ctor, initialize from a T*. If passed non-nullptr, then the reference counter is incremented (via T::add_reference()).
p | pointer value from which to initialize |
Definition at line 78 of file reference_counted.hpp.
|
inline |
Copy ctor.
obj | value from which to initialize |
Definition at line 91 of file reference_counted.hpp.
|
inline |
Ctor from a reference_counted_ptr<U> where U* is implicitely convertible to a T*.
U | type where U* is implicitely convertible to a T*. |
obj | value from which to initialize |
Definition at line 107 of file reference_counted.hpp.
|
inline |
Move ctor.
obj | object from which to take. |
Definition at line 120 of file reference_counted.hpp.
|
inline |
Dtor, if pointer is non-nullptr, then reference is decremented (via T::remove_reference()).
Definition at line 130 of file reference_counted.hpp.
|
inline |
Clears the reference_counted_ptr object, equivalent to
Definition at line 326 of file reference_counted.hpp.
|
inline |
Perform const cast to cast (uses const_cast internally).
U | type to which to cast |
Definition at line 351 of file reference_counted.hpp.
|
inline |
Perform dynamic cast to down cast (uses dynamic_cast internally).
U | type to which to cast |
Definition at line 362 of file reference_counted.hpp.
|
inline |
Returns the underlying pointer
Definition at line 197 of file reference_counted.hpp.
|
inline |
Allows one to legally write:
Definition at line 254 of file reference_counted.hpp.
|
inline |
Inequality comparison operator to a pointer value.
U | type where U* is implicitely comparable to a T*. |
rhs | value with which to compare against |
Definition at line 290 of file reference_counted.hpp.
|
inline |
Inequality comparison operator to a reference_counted_ptr value.
U | type where U* is implicitely comparable to a T*. |
rhs | value with which to compare against |
Definition at line 303 of file reference_counted.hpp.
|
inline |
Overload of dererefence operator. Under debug build, assers if pointer is nullptr.
Definition at line 207 of file reference_counted.hpp.
|
inline |
Overload of operator. Under debug build, assers if pointer is nullptr.
Definition at line 218 of file reference_counted.hpp.
|
inline |
Comparison operator for sorting.
rhs | value with which to compare against |
Definition at line 313 of file reference_counted.hpp.
|
inline |
Assignment operator
rhs | value from which to assign |
Definition at line 143 of file reference_counted.hpp.
|
inline |
Assignment operator from a T*.
rhs | value from which to assign |
Definition at line 155 of file reference_counted.hpp.
|
inline |
Move assignment operator
rhs | value from which to assign |
Definition at line 167 of file reference_counted.hpp.
|
inline |
Assignment operator from a reference_counted_ptr<U> where U* is implicitely convertible to a T*.
U | type where U* is implicitely convertible to a T*. |
rhs | value from which to assign |
Definition at line 186 of file reference_counted.hpp.
|
inline |
Equality comparison operator to a pointer value.
rhs | value with which to compare against |
Definition at line 265 of file reference_counted.hpp.
|
inline |
Equality comparison operator to a reference_counted_ptr value.
U | type where U* is implicitely comparable to a T*. |
rhs | value with which to compare against |
Definition at line 278 of file reference_counted.hpp.
|
inline |
Perform static cast to down cast (uses static_cast internally).
U | type to which to cast |
Definition at line 340 of file reference_counted.hpp.
|
inline |
Performs swap without needing to increment or decrement the reference counter.
rhs | object with which to swap |
Definition at line 230 of file reference_counted.hpp.