4 #ifndef INCLUDED_SALHELPER_SINGLETONREF_HXX 5 #define INCLUDED_SALHELPER_SINGLETONREF_HXX 52 template<
class SingletonClass >
61 static SingletonClass* m_pInstance;
64 static sal_Int32 m_nRef;
88 m_pInstance =
new SingletonClass();
90 OSL_ENSURE(m_nRef>0 && m_pInstance,
"Race? Ref count of singleton >0, but instance is NULL!");
118 #if defined LIBO_INTERNAL_ONLY 155 struct SingletonLockInit
159 static ::osl::Mutex aInstance;
173 template<
class SingletonClass >
176 template<
class SingletonClass >
181 #endif // INCLUDED_SALHELPER_SINGLETONREF_HXX ~SingletonRef()
standard dtor.
Definition: singletonref.hxx:102
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:358
Object lifetime scoped mutex object or interface lock.
Definition: mutex.hxx:103
Provides simple diagnostic support.
A helper functor for the rtl_Instance template.
Definition: getglobalmutex.hxx:15
Guard< Mutex > MutexGuard
Definition: mutex.hxx:235
SingletonClass * operator->() const
Allows rSingle->someBodyOp().
Definition: singletonref.hxx:124
template for implementing singleton classes.
Definition: singletonref.hxx:53
A mutual exclusion synchronization object.
Definition: mutex.hxx:15
SingletonClass & operator*() const
Allows (*rSingle).someBodyOp().
Definition: singletonref.hxx:135
Definition: condition.hxx:13
#define OSL_ENSURE(c, m)
If cond is false, reports an error with message msg.
Definition: diagnose.h:67
SingletonRef()
standard ctor.
Definition: singletonref.hxx:79