cocos2d-x 3.0
- 首页 - 相关页面 - 模块 - 命名空间 - - 文件 -
Public 成员函数 - 图1 Public 成员函数 - 图2)
- 类列表 - 类索引 - 类继承关系 - 类成员

全部)) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义)))

Public 成员函数 | 所有成员列表

RefPtr< T > 模板类 参考

它保持着强劲的引用cocos2dx的cocos2d::Ref*类型的对象包装类。 类似的概念来提高智能指针。 更多…

#include

## Public 成员函数
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)
此函数分配给这个RefPtr<T>但不增加指向对象的引用计数。 有用的分配通过new操作符的RefPtr<T>创建的对象。基本上是在场景用来 其中RefPtr<T>有对象的初始所有权。 更多…

详细描述

template<typename T>

class cocos2d::RefPtr< T >

它保持着强劲的引用cocos2dx的cocos2d::Ref*类型的对象包装类。 类似的概念来提高智能指针。

允许使用的RAII成语与Cocos2dx对象,并有助于自动一些比较 平凡的指针初始化和清理的任务。

类本身是仿照C++11的std::shared_ptr的,并改掉保留一些方法 和功能与std::shared_ptr的一致。

构造及析构函数说明

RefPtr ( )

inline

RefPtr ( RefPtr< T > && other)

inline

RefPtr ( T * ptr)

inline

RefPtr ( std::nullptr_t ptr)

inline

RefPtr ( const RefPtr< T > & other)

inline

~RefPtr ( )

inline

成员函数说明

T* get ( ) const

inline

operator bool ( ) const

inline

operator T * ( ) const

inline

bool operator!= ( const RefPtr< T > & other) const

inline

bool operator!= ( const T * other) const

inline

bool operator!= ( typename std::remove_const< T >::type * other) const

inline

bool operator!= ( const std::nullptr_t other) const

inline

T& operator* ( ) const

inline

T* operator-> ( ) const

inline

bool operator< ( const RefPtr< T > & other) const

inline

bool operator< ( const T * other) const

inline

bool operator< ( typename std::remove_const< T >::type * other) const

inline

bool operator< ( const std::nullptr_t other) const

inline

bool operator<= ( const RefPtr< T > & other) const

inline

bool operator<= ( const T * other) const

inline

bool operator<= ( typename std::remove_const< T >::type * other) const

inline

bool operator<= ( const std::nullptr_t other) const

inline

RefPtr<T>& operator= ( const RefPtr< T > & other)

inline

RefPtr<T>& operator= ( RefPtr< T > && other)

inline

RefPtr<T>& operator= ( T * other)

inline

RefPtr<T>& operator= ( std::nullptr_t other)

inline

bool operator== ( const RefPtr< T > & other) const

inline

bool operator== ( const T * other) const

inline

bool operator== ( typename std::remove_const< T >::type * other) const

inline

bool operator== ( const std::nullptr_t other) const

inline

bool operator> ( const RefPtr< T > & other) const

inline

bool operator> ( const T * other) const

inline

bool operator> ( typename std::remove_const< T >::type * other) const

inline

bool operator> ( const std::nullptr_t other) const

inline

bool operator>= ( const RefPtr< T > & other) const

inline

bool operator>= ( const T * other) const

inline

bool operator>= ( typename std::remove_const< T >::type * other) const

inline

bool operator>= ( const std::nullptr_t other) const

inline

void reset ( )

inline

void swap ( RefPtr< T > & other)

inline

void weakAssign ( const RefPtr< T > & other)

inline

此函数分配给这个RefPtr<T>但不增加指向对象的引用计数。 有用的分配通过new操作符的RefPtr<T>创建的对象。基本上是在场景用来 其中RefPtr<T>有对象的初始所有权。

例如: RefPtr<cocos2d::Image>image; image.weakAssign(new cocos2d::Image());

代替: RefPtr<cocos2d::Image> image; image = new cocos2d::Image(); image->release(); //必需的,因为new创建的对象已经具有'1引用计数“。


该类的文档由以下文件生成:

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/base/CCRefPtr.h
  • cocos2d
  • RefPtr
  • 生成于 2014年 五月 29日 星期四 09:41:49 , 为 cocos2d-x使用 doxygen 1.8.6