fastdo  0.5.12
winux::SharedHandle< _HTy > 模板类 参考

引用计数共享句柄,管理各种资源的自动释放 更多...

#include <smartptr.hpp>

winux::SharedHandle< _HTy > 的协作图:

struct  SharedHandleData
 

Public 类型

typedef _HTy HType
 

Public 成员函数

 SharedHandle ()
 
 SharedHandle (_HTy h, _HTy failVal)
 
template<typename _Dt >
 SharedHandle (_HTy h, _HTy failVal, _Dt dt)
 
template<typename _HTy2 >
 SharedHandle (_HTy2 h, _HTy2 failVal)
 
template<typename _HTy2 , typename _Dt >
 SharedHandle (_HTy2 h, _HTy2 failVal, _Dt dt)
 
virtual ~SharedHandle ()
 
 SharedHandle (SharedHandle const &other)
 
SharedHandleoperator= (SharedHandle const &other)
 
template<typename _HTy2 >
 SharedHandle (SharedHandle< _HTy2 > const &other)
 
template<typename _HTy2 >
SharedHandleoperator= (SharedHandle< _HTy2 > const &other)
 
void attachNew (_HTy h, _HTy failVal)
 
template<typename _Dt >
void attachNew (_HTy h, _HTy failVal, _Dt dt)
 
template<typename _HTy2 >
void attachNew (_HTy2 h, _HTy2 failVal)
 
template<typename _HTy2 , typename _Dt >
void attachNew (_HTy2 h, _HTy2 failVal, _Dt dt)
 
void attach (SharedHandleData const &data, bool isIncRef)
 管理一个资源 更多...
 
template<typename _HTy2 >
void attach (typename SharedHandle< _HTy2 >::SharedHandleData const &data, bool isIncRef)
 管理一个资源 更多...
 
template<typename _HTy2 >
void attach (_HTy2 h, SharedDeleterContext *ctx, bool isIncRef)
 管理一个资源 更多...
 
SharedHandleData detach ()
 
SharedHandleData peek () const
 
void reset ()
 
_HTy get () const
 
 operator bool () const
 
_HTy operator-> ()
 
_HTy operator-> () const
 

Protected 成员函数

template<typename _HTy2 >
void _reset0 (_HTy2 newH, SharedDeleterContext *newCtx)
 减少自身引用计数,管理新资源 更多...
 
template<typename _HTy2 >
void _reset (_HTy2 otherH, SharedDeleterContext *otherCtx)
 增加另一个shared的资源引用计数,减少自身计数。管理另一个shared的资源 更多...
 
template<typename _HTy2 >
void _reset (SharedHandle< _HTy2 > const &other)
 增加另一个shared的资源引用计数,减少自身计数。管理另一个shared的资源 更多...
 

Protected 属性

SharedHandleData _self
 

友元

template<typename _HTy0 >
class SharedHandle
 
template<typename _HTy0 >
class WeakHandle
 

详细描述

template<typename _HTy>
class winux::SharedHandle< _HTy >

引用计数共享句柄,管理各种资源的自动释放

可以赋值,还能指定一个failVal指示资源分配失败后的句柄值,当不等于这个值时才会创建删除器场景释放资源

在文件 smartptr.hpp439 行定义.

成员类型定义说明

template<typename _HTy>
typedef _HTy winux::SharedHandle< _HTy >::HType

在文件 smartptr.hpp442 行定义.

构造及析构函数说明

template<typename _HTy>
winux::SharedHandle< _HTy >::SharedHandle ( )
inline

在文件 smartptr.hpp453 行定义.

template<typename _HTy>
winux::SharedHandle< _HTy >::SharedHandle ( _HTy  h,
_HTy  failVal 
)
inline

在文件 smartptr.hpp455 行定义.

template<typename _HTy>
template<typename _Dt >
winux::SharedHandle< _HTy >::SharedHandle ( _HTy  h,
_HTy  failVal,
_Dt  dt 
)
inline

在文件 smartptr.hpp458 行定义.

template<typename _HTy>
template<typename _HTy2 >
winux::SharedHandle< _HTy >::SharedHandle ( _HTy2  h,
_HTy2  failVal 
)
inline

在文件 smartptr.hpp461 行定义.

template<typename _HTy>
template<typename _HTy2 , typename _Dt >
winux::SharedHandle< _HTy >::SharedHandle ( _HTy2  h,
_HTy2  failVal,
_Dt  dt 
)
inline

在文件 smartptr.hpp464 行定义.

template<typename _HTy>
virtual winux::SharedHandle< _HTy >::~SharedHandle ( )
inlinevirtual

在文件 smartptr.hpp466 行定义.

template<typename _HTy>
winux::SharedHandle< _HTy >::SharedHandle ( SharedHandle< _HTy > const &  other)
inline

在文件 smartptr.hpp471 行定义.

template<typename _HTy>
template<typename _HTy2 >
winux::SharedHandle< _HTy >::SharedHandle ( SharedHandle< _HTy2 > const &  other)
inline

在文件 smartptr.hpp483 行定义.

成员函数说明

template<typename _HTy>
template<typename _HTy2 >
void winux::SharedHandle< _HTy >::_reset ( _HTy2  otherH,
SharedDeleterContext otherCtx 
)
inlineprotected

增加另一个shared的资源引用计数,减少自身计数。管理另一个shared的资源

在文件 smartptr.hpp616 行定义.

template<typename _HTy>
template<typename _HTy2 >
void winux::SharedHandle< _HTy >::_reset ( SharedHandle< _HTy2 > const &  other)
inlineprotected

增加另一个shared的资源引用计数,减少自身计数。管理另一个shared的资源

在文件 smartptr.hpp625 行定义.

template<typename _HTy>
template<typename _HTy2 >
void winux::SharedHandle< _HTy >::_reset0 ( _HTy2  newH,
SharedDeleterContext newCtx 
)
inlineprotected

减少自身引用计数,管理新资源

在文件 smartptr.hpp606 行定义.

template<typename _HTy>
void winux::SharedHandle< _HTy >::attach ( SharedHandleData const &  data,
bool  isIncRef 
)
inline

管理一个资源

若资源是从另一个shared::detach()而来,则isIncRef应设为false;
若资源是新建而来,则isIncRef应设为false;
若资源是从另一个shared窥视而来,则isIncRef应设为true。

在文件 smartptr.hpp523 行定义.

template<typename _HTy>
template<typename _HTy2 >
void winux::SharedHandle< _HTy >::attach ( typename SharedHandle< _HTy2 >::SharedHandleData const &  data,
bool  isIncRef 
)
inline

管理一个资源

若资源是新建而来,则isIncRef应设为false;
若资源是从另一个shared::detach()而来,则isIncRef应设为false;
若资源是从另一个shared窥视而来,则isIncRef应设为true。

在文件 smartptr.hpp541 行定义.

template<typename _HTy>
template<typename _HTy2 >
void winux::SharedHandle< _HTy >::attach ( _HTy2  h,
SharedDeleterContext ctx,
bool  isIncRef 
)
inline

管理一个资源

若资源是新建而来,则isIncRef应设为false;
若资源是从另一个shared::detach()而来,则isIncRef应设为false;
若资源是从另一个shared窥视而来,则isIncRef应设为true。

在文件 smartptr.hpp559 行定义.

template<typename _HTy>
void winux::SharedHandle< _HTy >::attachNew ( _HTy  h,
_HTy  failVal 
)
inline

在文件 smartptr.hpp495 行定义.

template<typename _HTy>
template<typename _Dt >
void winux::SharedHandle< _HTy >::attachNew ( _HTy  h,
_HTy  failVal,
_Dt  dt 
)
inline

在文件 smartptr.hpp501 行定义.

template<typename _HTy>
template<typename _HTy2 >
void winux::SharedHandle< _HTy >::attachNew ( _HTy2  h,
_HTy2  failVal 
)
inline

在文件 smartptr.hpp507 行定义.

template<typename _HTy>
template<typename _HTy2 , typename _Dt >
void winux::SharedHandle< _HTy >::attachNew ( _HTy2  h,
_HTy2  failVal,
_Dt  dt 
)
inline

在文件 smartptr.hpp513 行定义.

template<typename _HTy>
SharedHandleData winux::SharedHandle< _HTy >::detach ( )
inline

在文件 smartptr.hpp571 行定义.

template<typename _HTy>
_HTy winux::SharedHandle< _HTy >::get ( ) const
inline

在文件 smartptr.hpp589 行定义.

template<typename _HTy>
winux::SharedHandle< _HTy >::operator bool ( ) const
inline

在文件 smartptr.hpp591 行定义.

template<typename _HTy>
_HTy winux::SharedHandle< _HTy >::operator-> ( )
inline

在文件 smartptr.hpp593 行定义.

template<typename _HTy>
_HTy winux::SharedHandle< _HTy >::operator-> ( ) const
inline

在文件 smartptr.hpp598 行定义.

template<typename _HTy>
SharedHandle& winux::SharedHandle< _HTy >::operator= ( SharedHandle< _HTy > const &  other)
inline

在文件 smartptr.hpp476 行定义.

template<typename _HTy>
template<typename _HTy2 >
SharedHandle& winux::SharedHandle< _HTy >::operator= ( SharedHandle< _HTy2 > const &  other)
inline

在文件 smartptr.hpp489 行定义.

template<typename _HTy>
SharedHandleData winux::SharedHandle< _HTy >::peek ( ) const
inline

在文件 smartptr.hpp579 行定义.

template<typename _HTy>
void winux::SharedHandle< _HTy >::reset ( )
inline

在文件 smartptr.hpp584 行定义.

友元及相关函数文档

template<typename _HTy>
template<typename _HTy0 >
friend class SharedHandle
friend

在文件 smartptr.hpp633 行定义.

template<typename _HTy>
template<typename _HTy0 >
friend class WeakHandle
friend

在文件 smartptr.hpp635 行定义.

类成员变量说明

template<typename _HTy>
SharedHandleData winux::SharedHandle< _HTy >::_self
protected

在文件 smartptr.hpp630 行定义.


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