GlnkClientMgr
- 这个类负责生成GlnkClientMgr唯一实例
class GlnkClientMgr
{
- 函数名: getInstance
- 作用 : 获取GlnkClientMgr实例
- 参数 : 无
- 返回值: 成功:GlnkClientMgr实例指针;失败:NULL
static GlnkClientMgr *getInstance();
- 函数名: release
- 作用 : 释放GlnkClientMgr实例
- 参数 : 无
- 返回值: 无
static void release();
- 函数名: getGlnkClient
- 作用 : 获取GlnkClient唯一实例
- 参数 : 无
- 返回值: 成功:GlnkClient实例指针;失败:NULL
GlnkClient* getGlnkClient();
以下函数不需调用
GlnkClientMgr();
~GlnkClientMgr();
};
DEMO
#include "GlnkClientMgr.h"
int main()
{
GlnkClientMgr* clientMgr = GlnkClientMgr::getInstance();
if(clientMgr)
{
GlnkClient* client = clientMgr->getGlnkClient();
if(client)
...
...
}
return 0;
}