00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_SINGLETON_H_
00028 #define CEYLAN_SINGLETON_H_
00029
00030
00031 #include "CeylanException.h"
00032
00033 #include <string>
00034
00035
00036
00037 namespace Ceylan
00038 {
00039
00040
00041
00043 class CEYLAN_DLL SingletonException: public Ceylan::Exception
00044 {
00045
00046 public:
00047
00048 explicit SingletonException( const std::string & reason ) ;
00049 virtual ~SingletonException() throw() ;
00050
00051 } ;
00052
00053
00054
00074 class CEYLAN_DLL Singleton
00075 {
00076
00077
00078 public:
00079
00080
00089 static Singleton & GetSingleton() ;
00090
00091
00093 static void DeleteSingleton() ;
00094
00095
00096
00097 protected:
00098
00099
00101 Singleton() ;
00102
00103
00105 virtual ~Singleton() throw() ;
00106
00107
00108
00109 private:
00110
00111
00121 Singleton( const Singleton & source ) ;
00122
00123
00131 Singleton & operator = ( const Singleton & source ) ;
00132
00133
00135 static Singleton * _InternalSingleton ;
00136
00137
00138
00139 } ;
00140
00141 }
00142
00143
00144
00145 #endif // CEYLAN_SINGLETON_H_
00146