24#include <osl/doublecheckedlocking.h>
25#include <osl/getglobalmutex.hxx>
26#include <unordered_map>
54 ImageContainer::iterator iImage =
maContainer.find(rResourceId);
57 aResult =
Image(StockImage::Yes, rResourceId);
61 aResult = iImage->second;
72 ::osl::GetGlobalMutex aMutexFunctor;
73 ::osl::MutexGuard aGuard(aMutexFunctor());
78 ::std::unique_ptr<SdGlobalResource>(pCache));
79 OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
85 OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
std::unordered_map< OUString, Image > ImageContainer
static IconCache * s_pIconCache
This pointer holds a valid reference from first time that IconCache::Instance() is called to the end ...
Image GetIcon(const OUString &rResourceId)
ImageContainer maContainer
This simple class stores frequently used icons so that the classes that use the icons do not have to ...
Image GetIcon(const OUString &rResourceId)
Return the icon with the given resource id.
static IconCache & Instance()
The lifetime of the returned reference is limited to that of the sd module.
virtual ~IconCache() override
This destructor is called by SdGlobalResourceContainer.
IconCache()
The constructor creates the one instance of the cache and registers it at the SdGlobalResourceContain...
::std::unique_ptr< Implementation > mpImpl
void AddResource(::std::unique_ptr< SdGlobalResource > pResource)
Add a resource to the container.
static SdGlobalResourceContainer & Instance()
#define DBG_ASSERT(sCon, aError)