#include <spimpl.hpp>
Collaboration diagram for MynahSA::SharedPtr< T >:
Public Member Functions | |
SharedPtr () | |
default constructor - creates a null pointer | |
SharedPtr (T *p) | |
SharedPtr (const SharedPtr &p) | |
copy constructor | |
SharedPtr (Detail::SPBase *p) | |
virtual | ~SharedPtr () |
Destructor - destroyes instance if reference count goes to zero. | |
T * | get () const |
Provides direct access to the underlying pointer. | |
T & | operator * () const |
dereference operator. | |
T * | operator-> () const |
pointer dereference operator | |
bool | operator< (const SharedPtr &in) const |
LT comparable. Allows sorting of pointer objects. | |
SharedPtr & | operator= (const SharedPtr &in) |
Assignment - allows copying of a shared pointer while preserving S.P. behavior. | |
bool | operator== (const SharedPtr &in) const |
Shared pointer equality test. | |
bool | operator== (T *ptr) const |
Shared pointer equality to base pointer (generally used for zero test). | |
operator bool () const | |
cast to bool - true if pointer is not zero. | |
template<class B> | |
operator SharedPtr () const | |
Pointer conversion operator. Allows type conversion of shared pointers. | |
Friends | |
template<class B, class A> | |
SharedPtr< B > | StaticPtrCast (const SharedPtr< A > &src) |
This shared pointer implementation uses template specialization and an underlying container to allow conversions to and from void types and up and down class hierarchies. The conversions are performed using the function StaticPtrCast. Casting a pointer from one type to another preserves the reference count.
When all holders of a shared pointer are deleted the object held by the shared pointer is also deleted.
Definition at line 113 of file spimpl.hpp.
|
Constructor - creates a new shared pointer of type T, along with pointer carrier and reference count. Initially the reference count is set to 1.
Definition at line 129 of file spimpl.hpp.
|
|
This is a compiler workaround constructor. Some compilers have issues dealing with friendship relations between instances with different template parameters. This constructor is designed as a work-around by passing in the pointer carrier. It is not intended for general use.
Definition at line 148 of file spimpl.hpp. References MynahSA::Detail::SPBase::ref().
Here is the call graph for this function: |