29 #ifndef _SALHELPER_SINGLETONREF_HXX_
30 #define _SALHELPER_SINGLETONREF_HXX_
80 template<
class SingletonClass >
89 static SingletonClass* m_pInstance;
92 static sal_Int32 m_nRef;
117 m_pInstance =
new SingletonClass();
119 OSL_ENSURE(m_nRef>0 && m_pInstance,
"Race? Ref count of singleton >0, but instance is NULL!");
185 struct SingletonLockInit
189 static ::osl::Mutex aInstance;
203 template<
class SingletonClass >
204 SingletonClass* SingletonRef< SingletonClass >::m_pInstance = 0;
206 template<
class SingletonClass >
207 sal_Int32 SingletonRef< SingletonClass >::m_nRef = 0;
211 #endif // _SALHELPER_SINGLETONREF_HXX_