Ark Server API (ASE) - Wiki
|
#include <AutoPtr.h>
Public Member Functions | |
AutoPtr () | |
AutoPtr (C *ptr) | |
AutoPtr (C *ptr, bool shared) | |
AutoPtr (const AutoPtr &ptr) | |
AutoPtr (AutoPtr &&ptr) noexcept | |
template<class Other > | |
AutoPtr (const AutoPtr< Other > &ptr) | |
~AutoPtr () | |
AutoPtr & | assign (C *ptr) |
AutoPtr & | assign (C *ptr, bool shared) |
AutoPtr & | assign (const AutoPtr &ptr) |
template<class Other > | |
AutoPtr & | assign (const AutoPtr< Other > &ptr) |
void | reset () |
void | reset (C *ptr) |
void | reset (C *ptr, bool shared) |
void | reset (const AutoPtr &ptr) |
template<class Other > | |
void | reset (const AutoPtr< Other > &ptr) |
AutoPtr & | operator= (C *ptr) |
AutoPtr & | operator= (const AutoPtr &ptr) |
AutoPtr & | operator= (AutoPtr &&ptr) noexcept |
template<class Other > | |
AutoPtr & | operator= (const AutoPtr< Other > &ptr) |
void | swap (AutoPtr &ptr) |
template<class Other > | |
AutoPtr< Other > | cast () const |
template<class Other > | |
AutoPtr< Other > | unsafeCast () const |
C * | operator-> () |
const C * | operator-> () const |
C & | operator* () |
const C & | operator* () const |
C * | get () |
const C * | get () const |
operator C* () | |
operator const C * () const | |
bool | operator! () const |
bool | isNull () const |
C * | duplicate () |
bool | operator== (const AutoPtr &ptr) const |
bool | operator== (const C *ptr) const |
bool | operator== (C *ptr) const |
bool | operator== (std::nullptr_t ptr) const |
bool | operator!= (const AutoPtr &ptr) const |
bool | operator!= (const C *ptr) const |
bool | operator!= (C *ptr) const |
bool | operator!= (std::nullptr_t ptr) const |
bool | operator< (const AutoPtr &ptr) const |
bool | operator< (const C *ptr) const |
bool | operator< (C *ptr) const |
bool | operator<= (const AutoPtr &ptr) const |
bool | operator<= (const C *ptr) const |
bool | operator<= (C *ptr) const |
bool | operator> (const AutoPtr &ptr) const |
bool | operator> (const C *ptr) const |
bool | operator> (C *ptr) const |
bool | operator>= (const AutoPtr &ptr) const |
bool | operator>= (const C *ptr) const |
bool | operator>= (C *ptr) const |
Private Attributes | |
C * | _ptr |
AutoPtr is a "smart" pointer for classes implementing reference counting based garbage collection. To be usable with the AutoPtr template, a class must implement the following behaviour: A class must maintain a reference count. The constructors of the object initialize the reference count to one. The class must implement a public duplicate() method: void duplicate(); that increments the reference count by one. The class must implement a public release() method: void release() that decrements the reference count by one, and, if the reference count reaches zero, deletes the object.
AutoPtr works in the following way: If an AutoPtr is assigned an ordinary pointer to an object (via the constructor or the assignment operator), it takes ownership of the object and the object's reference count remains unchanged. If the AutoPtr is assigned another AutoPtr, the object's reference count is incremented by one by calling duplicate() on its object. The destructor of AutoPtr calls release() on its object. AutoPtr supports dereferencing with both the -> and the * operator. An attempt to dereference a null AutoPtr results in a NullPointerException being thrown. AutoPtr also implements all relational operators. Note that AutoPtr allows casting of its encapsulated data types.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |