From fc46c19a61d26fb610d173bb8fc5420eea966caa Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 19 Feb 2014 19:07:45 +0000 Subject: Dropbox: - global object replaced by singleton - added ability to upload folders git-svn-id: http://svn.miranda-ng.org/main/trunk@8183 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/singleton.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugins/Dropbox/src/singleton.h (limited to 'plugins/Dropbox/src/singleton.h') diff --git a/plugins/Dropbox/src/singleton.h b/plugins/Dropbox/src/singleton.h new file mode 100644 index 0000000000..432e2ed7f0 --- /dev/null +++ b/plugins/Dropbox/src/singleton.h @@ -0,0 +1,29 @@ +#ifndef _SINGLETON_H_ +#define _SINGLETON_H_ + +template +class Singleton +{ +public: + static T *GetInstance() + { + if (!instance) + instance = new T; + return instance; + } + +private: + static T* instance; + + Singleton(); + Singleton(Singleton const&); + + ~Singleton(); + + Singleton &operator=(Singleton const&); +}; + +template T *Singleton::instance = 0; + + +#endif //_SINGLETON_H_ \ No newline at end of file -- cgit v1.2.3