|
cocos2d-x
3.3
|
Wrapper class which maintains a strong reference to a cocos2dx cocos2d::Ref* type object. More...
#include <CCRefPtr.h>
Public Member Functions | |
| RefPtr () | |
| RefPtr (RefPtr< T > &&other) | |
| RefPtr (T *ptr) | |
| RefPtr (std::nullptr_t ptr) | |
| RefPtr (const RefPtr< T > &other) | |
| ~RefPtr () | |
| RefPtr< T > & | operator= (const RefPtr< T > &other) |
| RefPtr< T > & | operator= (RefPtr< T > &&other) |
| RefPtr< T > & | operator= (T *other) |
| RefPtr< T > & | operator= (std::nullptr_t other) |
| operator T * () const | |
| T & | operator* () const |
| T * | operator-> () const |
| T * | get () const |
| bool | operator== (const RefPtr< T > &other) const |
| bool | operator== (const T *other) const |
| bool | operator== (typename std::remove_const< T >::type *other) const |
| bool | operator== (const std::nullptr_t other) const |
| bool | operator!= (const RefPtr< T > &other) const |
| bool | operator!= (const T *other) const |
| bool | operator!= (typename std::remove_const< T >::type *other) const |
| bool | operator!= (const std::nullptr_t other) const |
| bool | operator> (const RefPtr< T > &other) const |
| bool | operator> (const T *other) const |
| bool | operator> (typename std::remove_const< T >::type *other) const |
| bool | operator> (const std::nullptr_t other) const |
| bool | operator< (const RefPtr< T > &other) const |
| bool | operator< (const T *other) const |
| bool | operator< (typename std::remove_const< T >::type *other) const |
| bool | operator< (const std::nullptr_t other) const |
| bool | operator>= (const RefPtr< T > &other) const |
| bool | operator>= (const T *other) const |
| bool | operator>= (typename std::remove_const< T >::type *other) const |
| bool | operator>= (const std::nullptr_t other) const |
| bool | operator<= (const RefPtr< T > &other) const |
| bool | operator<= (const T *other) const |
| bool | operator<= (typename std::remove_const< T >::type *other) const |
| bool | operator<= (const std::nullptr_t other) const |
| operator bool () const | |
| void | reset () |
| void | swap (RefPtr< T > &other) |
| void | weakAssign (const RefPtr< T > &other) |
| This function assigns to this RefPtr<T> but does not increase the reference count of the object pointed to. More... | |
Wrapper class which maintains a strong reference to a cocos2dx cocos2d::Ref* type object.
Similar in concept to a boost smart pointer.
Enables the use of the RAII idiom with Cocos2dx objects and helps automate some of the more mundane tasks of pointer initialization and cleanup.
The class itself is modelled on C++ 11 std::shared_ptr, and trys to keep some of the methods and functionality consistent with std::shared_ptr.
|
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 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This function assigns to this RefPtr<T> but does not increase the reference count of the object pointed to.
Useful for assigning an object created through the 'new' operator to a RefPtr<T>. Basically used in scenarios where the RefPtr<T> has the initial ownership of the object.
E.G: RefPtr<cocos2d::Image> image; image.weakAssign(new cocos2d::Image());
Instead of: RefPtr<cocos2d::Image> image; image = new cocos2d::Image(); image->release(); // Required because new'd object already has a reference count of '1'.