联盟首页 协同开发 共创软件 开放源码 软件工程 共创论坛 关于联盟
  您的位置 » 开放源码库【成熟 - 项目摘要 首页 | 分类源码 | 提交源码 | 下载统计 | 原创源码 | 成熟源码 | 代码片断
 
 Smart Pointer Class - 项目摘要
摘要 | 管理 | 论坛
文档 | 软件包

源码库中源码数量为19221
有贡献人员名单:

-= 更多 =-
  • ffdshow
  • jasperreports
  • PoolMan
  • Air Traffic Controller
  • virtualdub-win
  • CppUnit
  • Apache-SSL-Jserv
  • FCK editor
  • Async Professional
  • GLgraph
  • -= 更多 =-

    项目描述:
    This smart pointer package provides 2 main classes for use
    1. CountedPtr - Is a reference counted smart pointer that can be used with any type - Allows direct assignment to base class smart pointer by a derived class - Supports static and dynamic casts where they are supported by the underlying types - Uses the copy constructor to clone the pointed to object - Calls the right delete when done with object

    2. BackPtr - Is a class for backward references, when the pointer is not owned - Can be assigned a CountedPtr - Can check if the underlying object is still valid - Can get a CountedPtr from a BackPtr if the underlying object is valid, otherwise an exception will be thrown. This prevents the problem of dangling pointers

    这个智能指针类提供了两个主要的类:
    1. CountedPtr -是一个引用计数的智能指针,可以用于任何类型;可以将直接分配到基类的指针用于派生类;支持静态和动态类型转换;可以使用拷贝构造函数来复制指向的对象;当处理完对象后会调用正确的delete 方法。
    2. BackPtr - 当没有指针时,是一个向后引用的类;可以分配一个 CountedPtr;可以检查潜在的对象是否有效;如果潜在的对象有效,可以从BackPtr 中得到一个CountedPtr ,否则将返回一个异常。这样可以防止指针错误。
    来源: http://www.codeguru.com/cpp_mfc/SmartPointerLove.shtml
    类别:
    发布者: cbd002

    最新发布源码包
    软件包 版本号 日期 本地下载
    SmartPointerLove  1.0  2004-04-09 下载

    原始下载连接(国外) http://www.codeguru.com/code/legacy/cpp_mfc/SmartPointerLove_src.zip

      » 合 作 伙 伴