main.cpp
来自「Many applications use connection/object 」· C++ 代码 · 共 27 行
CPP
27 行
#include <iostream>
#include "PoolMgr.h"
#include "GenericObject.h"
using namespace std;
// poll test
int main()
{
// get the pool instance
PoolMgr<GenericObject> *pMgr = PoolMgr<GenericObject>::GetInstance();
// initialize the pool
pMgr->Init(10,600, false);
// checkout the object
GenericObject *pObj = pMgr->Checkout();
if(pObj)
pMgr->Checkin(pObj); // checkin the object
// reset the pool
pMgr->ResetPool();
// delete the pool
PoolMgr<GenericObject>::DeletePool();
cout << "Enter any key to exit :";
cin.get();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?