随笔分类 -  C++

摘要:ObjectPool.h#include class ObjectPool{private: ObjectPool(unsigned int step, unsigned int size); ~ObjectPool();public: static ObjectPool& get... 阅读全文
posted @ 2015-10-15 21:01 liusijian 阅读(226) 评论(0) 推荐(0)
摘要:#pragma once#include "KRYObject.h"template class KRYFunction{};templateclass KRYFunction {private: class FunctionBase { public: virtua... 阅读全文
posted @ 2015-10-15 20:57 liusijian 阅读(169) 评论(0) 推荐(0)
摘要:KRYObject.h#pragma onceclass KRYObject{ template friend class KRYRefPtr; template friend class KRYWeakPtr;private: struct KRYRefCount ... 阅读全文
posted @ 2015-10-15 20:34 liusijian 阅读(163) 评论(0) 推荐(0)
摘要:#pragma onceclass KRYPtrCount{public: KRYPtrCount() :shared_count(1), weak_count(0){} void addShared(){ shared_count += 1; } void addWeak(){ ... 阅读全文
posted @ 2015-10-15 20:15 liusijian 阅读(174) 评论(0) 推荐(0)
摘要:#include #include void FileToArray(const char *srcfile, const char *dstfile){ FILE *file = fopen(srcfile, "rb"); if (file) { FILE *sav... 阅读全文
posted @ 2015-07-19 14:32 liusijian 阅读(257) 评论(0) 推荐(0)