A smart pointer class that manages the lifetime of an object using reference counting. More...
#include <SSharedPtr.hpp>
Public Member Functions | |
| SSharedPtr () | |
| Default constructor. | |
| SSharedPtr (T *ptr) | |
| Constructor. | |
| SSharedPtr (const SSharedPtr< T, Disposer > &obj) | |
| Copy constructor. | |
| ~SSharedPtr () | |
| Destructor. | |
| SSharedPtr & | operator= (const SSharedPtr< T, Disposer > &obj) |
| Assignment operator. | |
| const T * | operator-> () const |
| Returns the object pointer. | |
| T * | operator-> () |
| Returns the object pointer. | |
| const T * | ptr () const |
| Returns the object pointer. | |
| T * | ptr () |
| Returns the object pointer. | |
| const T & | operator* () const |
| Returns the object reference. | |
| T & | operator* () |
| Returns the object reference. | |
| bool | operator== (T *ptr) const |
| Compares the pointer with another pointer. | |
| bool | operator== (const SSharedPtr< T, Disposer > &obj) const |
| Compares the pointer with another SSharedPtr object. | |
A smart pointer class that manages the lifetime of an object using reference counting.
| T | The type of the pointer. |
| Disposer | The disposer class used to delete the pointer. |
This class automatically deletes the managed object when the last reference to it is destroyed.
Definition at line 134 of file SSharedPtr.hpp.
|
inline |
Default constructor.
Initializes the shared pointer with a null pointer.
Definition at line 141 of file SSharedPtr.hpp.
|
inline |
|
inline |
Copy constructor.
| obj | Another SSharedPtr object. |
Increments the reference count of the managed pointer.
Definition at line 158 of file SSharedPtr.hpp.
|
inline |
Destructor.
Decrements the reference count of the managed pointer.
Definition at line 167 of file SSharedPtr.hpp.
|
inline |
Returns the object reference.
Definition at line 240 of file SSharedPtr.hpp.
|
inline |
Returns the object reference.
Definition at line 231 of file SSharedPtr.hpp.
|
inline |
Returns the object pointer.
Definition at line 204 of file SSharedPtr.hpp.
|
inline |
Returns the object pointer.
Definition at line 195 of file SSharedPtr.hpp.
|
inline |
Assignment operator.
| obj | Another SSharedPtr object. |
Decrements the reference count of the original pointer and increments the reference count of the new pointer.
Definition at line 178 of file SSharedPtr.hpp.
|
inline |
Compares the pointer with another SSharedPtr object.
| obj | SSharedPtr object to compare with. |
Definition at line 260 of file SSharedPtr.hpp.
|
inline |
Compares the pointer with another pointer.
| ptr | Pointer to compare with. |
Definition at line 250 of file SSharedPtr.hpp.
|
inline |
Returns the object pointer.
Definition at line 222 of file SSharedPtr.hpp.
|
inline |
Returns the object pointer.
Definition at line 213 of file SSharedPtr.hpp.