24#ifndef INCLUDED_SALHELPER_SINGLETONREF_HXX
25#define INCLUDED_SALHELPER_SINGLETONREF_HXX
31#include "osl/mutex.hxx"
32#include "rtl/instance.hxx"
33#include "osl/diagnose.h"
34#include "osl/getglobalmutex.hxx"
72template<
class SingletonClass >
110 OSL_ENSURE(
m_nRef>0 &&
m_pInstance,
"Race? Ref count of singleton >0, but instance is NULL!");
138#if defined LIBO_INTERNAL_ONLY
179 static ::osl::Mutex aInstance;
186 return *rtl_Instance< ::osl::Mutex,
193template<
class SingletonClass >
196template<
class SingletonClass >
template for implementing singleton classes.
SingletonClass * operator->() const
Allows rSingle->someBodyOp().
~SingletonRef()
standard dtor.
::osl::Mutex & ownStaticLock() const
static SingletonClass * m_pInstance
pointer to the internal wrapped singleton.
SingletonRef()
standard ctor.
SingletonRef(SingletonRef &) SAL_DELETED_FUNCTION
SingletonClass & operator*() const
Allows (*rSingle).someBodyOp().
static sal_Int32 m_nRef
ref count, which regulate creation and removing of m_pInstance.
creates an own mutex for guarding static contents.
::osl::Mutex * operator()()