|
Aegis
4.25.D505
|
#include <aegis.h>
Public Member Functions | |
| bool | valid () const |
| ~aegis_shared_ptr () | |
| void | swap (aegis_shared_ptr &rhs) |
| void | reset () |
| aegis_shared_ptr () | |
| template<class Y > | |
| aegis_shared_ptr (Y *rhs) | |
| aegis_shared_ptr (const aegis_shared_ptr &rhs) | |
| template<class Y > | |
| aegis_shared_ptr (const aegis_shared_ptr< Y > &rhs) | |
| aegis_shared_ptr & | operator= (const aegis_shared_ptr &rhs) |
| template<class Y > | |
| aegis_shared_ptr & | operator= (const aegis_shared_ptr< Y > &rhs) |
| T & | operator* () const |
| T * | operator-> () const |
| T * | get () const |
| operator bool () const | |
| bool | operator! () const |
| bool | operator== (const aegis_shared_ptr &rhs) const |
| template<class U > | |
| bool | operator== (const aegis_shared_ptr< U > &rhs) const |
| bool | operator!= (aegis_shared_ptr &rhs) const |
| template<class U > | |
| bool | operator!= (aegis_shared_ptr< U > &rhs) const |
| bool | operator< (aegis_shared_ptr &rhs) const |
| template<class U > | |
| bool | operator< (aegis_shared_ptr< U > &rhs) const |
Private Attributes | |
| long * | reference_count |
| T * | subject |
Friends | |
| class | aegis_shared_ptr |
The aegis_shared_ptr class is used to represent a smart pointer with reference counted copy semantics. The object pointed to is deleted when the last aegis_shared_ptr pointing to it is destroyed or reset.
This class is only used of std::tr1::shared_ptr and boost::shared_ptr are both unavailable. It only implements as much of a shared_ptr as the Aegis code actually uses.
| aegis_shared_ptr< T >::~aegis_shared_ptr | ( | ) | [inline] |
| aegis_shared_ptr< T >::aegis_shared_ptr | ( | ) | [inline] |
| aegis_shared_ptr< T >::aegis_shared_ptr | ( | Y * | rhs | ) | [inline, explicit] |
| aegis_shared_ptr< T >::aegis_shared_ptr | ( | const aegis_shared_ptr< T > & | rhs | ) | [inline] |
| aegis_shared_ptr< T >::aegis_shared_ptr | ( | const aegis_shared_ptr< Y > & | rhs | ) | [inline] |
| T* aegis_shared_ptr< T >::get | ( | ) | const [inline] |
| aegis_shared_ptr< T >::operator bool | ( | ) | const [inline] |
| bool aegis_shared_ptr< T >::operator! | ( | ) | const [inline] |
| bool aegis_shared_ptr< T >::operator!= | ( | aegis_shared_ptr< T > & | rhs | ) | const [inline] |
| bool aegis_shared_ptr< T >::operator!= | ( | aegis_shared_ptr< U > & | rhs | ) | const [inline] |
| T& aegis_shared_ptr< T >::operator* | ( | ) | const [inline] |
| T* aegis_shared_ptr< T >::operator-> | ( | ) | const [inline] |
| bool aegis_shared_ptr< T >::operator< | ( | aegis_shared_ptr< T > & | rhs | ) | const [inline] |
| bool aegis_shared_ptr< T >::operator< | ( | aegis_shared_ptr< U > & | rhs | ) | const [inline] |
| aegis_shared_ptr& aegis_shared_ptr< T >::operator= | ( | const aegis_shared_ptr< T > & | rhs | ) | [inline] |
| aegis_shared_ptr& aegis_shared_ptr< T >::operator= | ( | const aegis_shared_ptr< Y > & | rhs | ) | [inline] |
| bool aegis_shared_ptr< T >::operator== | ( | const aegis_shared_ptr< T > & | rhs | ) | const [inline] |
| bool aegis_shared_ptr< T >::operator== | ( | const aegis_shared_ptr< U > & | rhs | ) | const [inline] |
| void aegis_shared_ptr< T >::reset | ( | ) | [inline] |
| void aegis_shared_ptr< T >::swap | ( | aegis_shared_ptr< T > & | rhs | ) | [inline] |
| bool aegis_shared_ptr< T >::valid | ( | ) | const [inline] |
friend class aegis_shared_ptr [friend] |
long* aegis_shared_ptr< T >::reference_count [private] |
The reference_count instance variable is used to remember the location of the reference count. By having the reference count separate from the subject, we can cope with compatible pointers, not just exact pointers.
This is not ideal because it allocates huge numbers of small objects. Some heap implementations go slowly when faced with many small allocations. Some heap implementations waste a lot of memory when faced with many small allocations.
T* aegis_shared_ptr< T >::subject [private] |
1.7.6.1