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 >
174 SingletonClass* SingletonRef< SingletonClass >::m_pInstance = NULL;
176 template<
class SingletonClass >
177 sal_Int32 SingletonRef< SingletonClass >::m_nRef = 0;
181 #endif // INCLUDED_SALHELPER_SINGLETONREF_HXX
SingletonClass * operator->() const
Allows rSingle->someBodyOp().
Definition: singletonref.hxx:124
A helper functor for the rtl_Instance template.
Definition: getglobalmutex.hxx:15
template for implementing singleton classes.
Definition: singletonref.hxx:53
Guard< Mutex > MutexGuard
Definition: mutex.hxx:235
#define OSL_ENSURE(c, m)
If cond is false, reports an error with message msg.
Definition: diagnose.h:67
A mutual exclusion synchronization object.
Definition: mutex.hxx:15
Provides simple diagnostic support.
Object lifetime scoped mutex object or interface lock.
Definition: mutex.hxx:103
SingletonClass & operator*() const
Allows (*rSingle).someBodyOp().
Definition: singletonref.hxx:135
~SingletonRef()
standard dtor.
Definition: singletonref.hxx:102
SingletonRef()
standard ctor.
Definition: singletonref.hxx:79
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:358