26#include <unordered_map>
40 assert(
s_nRefCount > 0 &&
"OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
44 for (
auto const& elem : *
s_pMap)
83 std::unique_lock aGuard(theMutex());
93 assert(s_nRefCount &&
"OIdPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
94 std::unique_lock aGuard(theMutex());
96 auto& rEntry = (*s_pMap)[
nId];
99 rEntry = createArrayHelper(
nId);
100 assert(rEntry &&
"OIdPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned nonsense !");
102 return (*s_pMap)[
nId];
static OIdPropertyArrayMap * s_pMap
static std::mutex & theMutex()
virtual ~OIdPropertyArrayUsageHelper()
::cppu::IPropertyArrayHelper * getArrayHelper(sal_Int32 nId)
call this in the getInfoHelper method of your derived class.
virtual ::cppu::IPropertyArrayHelper * createArrayHelper(sal_Int32 nId) const =0
used to implement the creation of the array helper which is shared amongst all instances of the class...
OIdPropertyArrayUsageHelper()
static sal_Int32 s_nRefCount
std::unordered_map< sal_Int32, ::cppu::IPropertyArrayHelper * > OIdPropertyArrayMap