20 #ifndef INCLUDED_SALHELPER_SINGLETONREF_HXX
21 #define INCLUDED_SALHELPER_SINGLETONREF_HXX
68 template<
class SingletonClass >
77 static SingletonClass* m_pInstance;
80 static sal_Int32 m_nRef;
105 m_pInstance =
new SingletonClass();
107 OSL_ENSURE(m_nRef>0 && m_pInstance,
"Race? Ref count of singleton >0, but instance is NULL!");
173 struct SingletonLockInit
177 static ::osl::Mutex aInstance;
191 template<
class SingletonClass >
192 SingletonClass* SingletonRef< SingletonClass >::m_pInstance = NULL;
194 template<
class SingletonClass >
195 sal_Int32 SingletonRef< SingletonClass >::m_nRef = 0;
199 #endif // INCLUDED_SALHELPER_SINGLETONREF_HXX
SingletonClass * operator->() const
Allows rSingle->someBodyOp().
Definition: singletonref.hxx:140
A helper class for mutex objects and interfaces.
Definition: mutex.hxx:108
~SingletonRef()
standard dtor.
Definition: singletonref.hxx:120
Definition: condition.hxx:29
SingletonClass & operator*() const
Allows (*rSingle).someBodyOp().
Definition: singletonref.hxx:152
template for implementing singleton classes.
Definition: singletonref.hxx:69
A mutual exclusion synchronization object.
Definition: mutex.hxx:30
Guard< Mutex > MutexGuard
Definition: mutex.hxx:224
A helper functor for the rtl_Instance template.
Definition: getglobalmutex.hxx:31
SingletonRef()
standard ctor.
Definition: singletonref.hxx:96
#define OSL_ENSURE(c, m)
Definition: diagnose.h:101