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 >
194 template<
class SingletonClass >
199 #endif // INCLUDED_SALHELPER_SINGLETONREF_HXX A helper functor for the rtl_Instance template.
Definition: getglobalmutex.hxx:31
Definition: condition.hxx:29
A mutual exclusion synchronization object.
Definition: mutex.hxx:30
SingletonRef()
standard ctor.
Definition: singletonref.hxx:96
template for implementing singleton classes.
Definition: singletonref.hxx:69
Guard< Mutex > MutexGuard
Definition: mutex.hxx:224
SingletonClass & operator*() const
Allows (*rSingle).someBodyOp().
Definition: singletonref.hxx:152
~SingletonRef()
standard dtor.
Definition: singletonref.hxx:120
#define OSL_ENSURE(c, m)
Definition: diagnose.h:101
SingletonClass * operator->() const
Allows rSingle->someBodyOp().
Definition: singletonref.hxx:140
A helper class for mutex objects and interfaces.
Definition: mutex.hxx:108