FIFE
2008.0
|
#include <sharedptr.h>
Public Member Functions | |
SharedPtr () | |
template<typename U > | |
SharedPtr (U *ptr) | |
SharedPtr (const SharedPtr &rhs) | |
template<typename U > | |
SharedPtr (const SharedPtr< U > &rhs) | |
~SharedPtr () | |
SharedPtr & | operator= (const SharedPtr &rhs) |
template<typename U > | |
SharedPtr & | operator= (const SharedPtr< U > &rhs) |
T & | operator* () const |
T * | operator-> () const |
T * | get () const |
void | reset (T *ptr=0) |
uint32_t | useCount () const |
uint32_t * | useCountPtr () const |
bool | unique () const |
operator bool () const | |
bool | operator! () const |
shared pointer implementation to provide automatic reference counting and deletion when last reference falls out of scope.
Definition at line 42 of file sharedptr.h.
|
inline |
Constructor default constructor creates a null shared pointer
Definition at line 49 of file sharedptr.h.
|
inlineexplicit |
Constructor takes over ownership of the provided pointer and will delete it automatically when last reference falls out of scope.
Definition at line 60 of file sharedptr.h.
|
inline |
Copy Constructor provides ability to properly copy a shared resource
Definition at line 68 of file sharedptr.h.
|
inline |
Constructor shares ownership with the value passed into rhs the pointer type passed in must be convertible to this shared pointer type
Definition at line 80 of file sharedptr.h.
|
inline |
Destructor handles deletion of underlying pointer if the reference count reaches 0
Definition at line 90 of file sharedptr.h.
|
inline |
allows direct access to underlying pointer
Definition at line 155 of file sharedptr.h.
Referenced by FIFE::RenderBackendOpenGL::attachRenderTarget(), FIFE::RenderBackendOpenGLe::attachRenderTarget(), FIFE::RenderBackendOpenGLe::detachRenderTarget(), FIFE::RenderBackendOpenGL::detachRenderTarget(), FIFE::operator!=(), FIFE::SharedPtr< RenderTarget >::operator=(), FIFE::operator==(), FIFE::SharedPtr< RenderTarget >::SharedPtr(), FIFE::GLImage::useSharedImage(), and FIFE::GLeImage::useSharedImage().
|
inline |
provides the ability to convert a shared pointer to a bool, this is a convenience for checking validity of a shared pointer in a conditional
Definition at line 207 of file sharedptr.h.
|
inline |
negation operator overload
Definition at line 213 of file sharedptr.h.
|
inline |
allows dereferencing of shared pointer to act identical to dereferencing the underlying pointer
Definition at line 140 of file sharedptr.h.
|
inline |
allows dereferencing of shared pointer to act identical to dereferencing the underlying pointer
Definition at line 148 of file sharedptr.h.
|
inline |
provides functionality for the equality operator
Definition at line 106 of file sharedptr.h.
|
inline |
provides functionality for the equality operator the passed in pointer type must be convertible to this pointer type
Definition at line 124 of file sharedptr.h.
|
inline |
reset this pointer to a null shared pointer this can be used to lower the reference count of the shared resource or set the underlying pointer to different pointer.
Definition at line 164 of file sharedptr.h.
Referenced by FIFE::SoundEmitter::reset(), FIFE::Cursor::resetDrag(), FIFE::Camera::resetOverlayAnimation(), FIFE::Cursor::set(), and FIFE::Cursor::setDrag().
|
inline |
provides the ability to see if a shared resource is currently only held by a single shared pointer this should only be called on a non-null shared pointer
Definition at line 197 of file sharedptr.h.
|
inline |
returns the current reference count this should only be called on a non-null shared pointer
Definition at line 173 of file sharedptr.h.
|
inline |
returns the current reference count provides direct access to the user count pointer this should really only be used internally
Definition at line 187 of file sharedptr.h.
Referenced by FIFE::SharedPtr< RenderTarget >::SharedPtr().