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;
104 m_pInstance =
new SingletonClass();
106 OSL_ENSURE(m_nRef>0 && m_pInstance,
"Race? Ref count of singleton >0, but instance is NULL!");
168 struct SingletonLockInit
172 static ::osl::Mutex aInstance;
186 template<
class SingletonClass >
189 template<
class SingletonClass >
194 #endif // INCLUDED_SALHELPER_SINGLETONREF_HXX A helper class for mutex objects and interfaces.
Definition: mutex.hxx:108
template for implementing singleton classes.
Definition: singletonref.hxx:69
A helper functor for the rtl_Instance template.
Definition: getglobalmutex.hxx:31
~SingletonRef()
standard dtor.
Definition: singletonref.hxx:118
A mutual exclusion synchronization object.
Definition: mutex.hxx:30
SingletonClass * operator->() const
Allows rSingle->someBodyOp().
Definition: singletonref.hxx:137
SingletonClass & operator*() const
Allows (*rSingle).someBodyOp().
Definition: singletonref.hxx:148
Guard< Mutex > MutexGuard
Definition: mutex.hxx:224
SingletonRef()
standard ctor.
Definition: singletonref.hxx:95
Definition: condition.hxx:29
#define OSL_ENSURE(c, m)
If cond is false, reports an error with message msg.
Definition: diagnose.h:85
Provides simple diagnostic support.