摘要:
一.ArrayBase ArrayBase提供基本的数组数据结构存储,其中还提供了一个迭代器 二.Array:ArrayBase 基本的数组类 三.ListBase:ArrayBase,List : public ListBase 提过动态添加元素的列表 四.SortedList : public ListBase 阅读全文
随笔分类 - Gac source code
Gac代码库分析(3)智能指针
2012-12-09 22:01 by Clingingboy, 335 阅读, 收藏, 编辑
摘要:
主要在于引用计数的使用 代码示例: template<typename T>class Ptr{ template<typename X> friend class Ptr;protected: vint* counter; T* reference; void Inc() { ... 阅读全文
Gac代码库分析(2)Event和Func
2012-12-09 21:43 by Clingingboy, 455 阅读, 收藏, 编辑
摘要:
一.Event 1.Event一般都是Func的封装,即Func的集合执行. 以2个参数的为例 template< typename T0,typename T1>class Event<void(T0,T1)> : public Object, private NotCopyable{protected: collections::SortedList<Func<void(T0... 阅读全文
Gac代码库分析(1)
2012-12-09 20:27 by Clingingboy, 462 阅读, 收藏, 编辑
摘要:
基础类:Basic.h 重在学习思想,难得的开源库 简单介绍,猜测意图 一.基本类型 1.NotCopyable 意图:阻止继承子类被拷贝 .h class NotCopyable{private: NotCopyable(const NotCopyable&); NotCopyable& operator=(const NotCopyable&);public: ... 阅读全文