template + single instance
来源:互联网 发布:oracle 分页优化 编辑:程序博客网 时间:2024/05/17 07:18
#include <iostream>#include <cstring>using namespace std;template<class T>class Sing{ public: Sing(); virtual ~Sing(); static T* getInstance(); static void destory(); private: static T* instance;};template<class T>T* Sing<T> :: instance = NULL;template<class T>T* Sing<T> :: getInstance(){ if(NULL == instance) { instance = new T(); } return instance;}template<class T>void Sing<T>::destory(){ if(NULL != instance) { delete instance; instance = NULL; }};class TestSing{ public: TestSing() { str = Sing<char>::getInstance(); if(str != NULL) { cout << "single test is ok"<<endl; } } virtual ~TestSing() { Sing<char>::destory(); if(str == NULL) { cout << "single destory is ok"<< endl; } } private: char* str;};int main(int argc, char* argv[]){ TestSing t; return 0;}
- template + single instance
- WPF Single Instance Application
- thread in single instance
- Single-instance applications
- java single instance
- rac restore to single instance
- 单例模式 - Single Instance
- 单实例(Singleton) single instance 模式
- single instance to 3 node rac
- Windows 7 Recipe – Taskbar Single Instance
- idea 15 tomcat single-instance run configuration
- 浅谈ORACLE AWR single instance 一
- 单模板方法(single template strategy)
- oracle 12c Single Instance to Single Instance的Active Database Duplicate测试
- 实现单进程(Single Instance)的.NET WinForm应用程序
- WPF:如何实现单实例的应用程序(Single Instance)
- How to Increase CSS Misscount in single instance ASM installations
- Convert 10g Single-Instance database to 10g RAC
- AS3 事件冒泡理解
- JavaWeb开发第8章标准标签库(JSTL)之三国际化标签
- Unity 读取xml 文件
- openstack数据库主要的表
- pdsh+pdcp
- template + single instance
- SVN图标含义
- unity3.5新粒子系统入门分享。。。一二合集
- sqlserver2008 服务 远程过程调用失败
- __weak
- 在 Visual Studio 2010 (vs)中启动 MPI 群集调试程序
- 交叉编译器
- InternetOpen\InternetOpenUrl\InternetReadFile 等相关Win32 网络API 使用详细说明
- 本公司seo优化参考