37 #ifndef _SINGLETON_H__ 38 #define _SINGLETON_H__ 43 #if OGRE_COMPILER == OGRE_COMPILER_MSVC 45 # pragma warning (disable : 4311) 46 # pragma warning (disable : 4312) 47 # pragma warning (disable : 4661) 50 #if defined ( OGRE_GCC_VISIBILITY ) 51 # pragma GCC visibility push(default) 80 assert( !msSingleton );
81 #if defined( _MSC_VER ) && _MSC_VER < 1200 83 msSingleton = (T*)((
int)
this + offset);
85 msSingleton =
static_cast< T*
>( this );
89 { assert( msSingleton ); msSingleton = 0; }
91 { assert( msSingleton );
return ( *msSingleton ); }
99 #if defined ( OGRE_GCC_VISIBILITY ) 100 # pragma GCC visibility pop
static T * getSingletonPtr(void)
static T & getSingleton(void)
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
Template class for creating single-instance global classes.
Singleton & operator=(const Singleton< T > &)
Private operator= .