Base Framework
|
Automation pointer that counts the number of references to an object. More...
#include <base/mem/ProtectedReference.h>
Public Member Functions | |
ProtectedReference (TYPE *_value) | |
ProtectedReference (const ProtectedReference ©) noexcept | |
template<class POLY > | |
ProtectedReference (const ProtectedReference< POLY > ©) | |
template<class POLY > | |
ProtectedReference< POLY > | cast () |
template<class POLY > | |
const ProtectedReference< POLY > | cast () const |
ProtectedReference & | operator= (const ProtectedReference &assign) |
template<class POLY > | |
ProtectedReference & | operator= (const ProtectedReference< POLY > &assign) |
bool | operator== (const ProtectedReference &compare) const noexcept |
bool | operator!= (const ProtectedReference &compare) const noexcept |
bool | isMultiReferenced () const noexcept |
void | copyOnWrite () |
TYPE * | operator-> () noexcept |
const TYPE * | operator-> () const noexcept |
~ProtectedReference () | |
Automation pointer that counts the number of references to an object.
Automation pointer for reference counting objects. This class is responsible for counting the total number of references to an object. The pointer automatically deletes a reference counted object when the number of references reaches zero. This pointer can only be used to reference count objects of type ReferenceCountedObject but is faster than ReferenceCounter. The ProtectedReference class is relocateable.
|
inline |
Initializes an automation pointer with the specified pointer value. The automation pointer may be implicitly initialized. Raises NullPointer is value is invalid.
value | The desired pointer value. |
|
inlinenoexcept |
Initialization of automation pointer from other automation pointer.
|
inline |
Initialization of automation pointer from other automation pointer using compile time polymorphism.
|
inline |
Destroys the automation pointer. Raises the exceptions raised by the destructor of the object.
|
inline |
Dynamic cast. Raises CastException if unable to cast.
|
inline |
Dynamic cast. Raises CastException if unable to cast.
|
inline |
Makes a new copy of the reference counted object if referenced by more than one automation pointer. This member function is invocated by some classes before a object is modified. The reference counted object must implement the default copy constructor for this to work. Raises the exceptions raised by the default copy constructor of the object.
|
inlinenoexcept |
Returns true if the reference counted object is referenced by more than one automation pointer.
|
inlinenoexcept |
Returns true if the references are non-equal.
|
inlinenoexcept |
Returns the reference counted object for non-modifying access.
|
inlinenoexcept |
Returns the reference counted object for modifying access.
|
inline |
Assignment of automation pointer to this automation pointer using compile time polymorphism. Raises the exceptions raised by the destructor of the object.
|
inline |
Assignment of automation pointer to this automation pointer using compile time polymorphism. Raises the exceptions raised by the destructor of the object.
|
inlinenoexcept |
Returns true if the references are equal.