# data_pool **Repository Path**: xin_chong/data_pool ## Basic Information - **Project Name**: data_pool - **Description**: 一个简单并有意思的环形池 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-07-10 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 相应对象类型硬性需要定义以下: ```c++ struct simple{ static const unsigned int POOL_SIZE = 2; //对象池大小 static void clear_data(std::shared_ptr data){ ... //对象数据抹除操作 } } ``` 对象池可以非常简单的改动就可以变为线程对象安全池。 获取的对象被inclosure_elem模板包裹着 ``` template class inclosure_elem{ ... }; ``` 通过被重载的"T* operator->()"、"T& operator*()"、"operator bool()"进行操作数据对象。 提供的"clear()"成员方法用于释放所持有的数据对象。