#ifndef ICONBUFFER_H_INCLUDED #define ICONBUFFER_H_INCLUDED #ifndef FFS_WIN header should be used in the windows build only! #endif #include #include "../shared/zstring.h" #include class wxCriticalSection; class WorkerThread; class IconDB; class IconDbSequence; class wxIcon; namespace FreeFileSync { class IconBuffer { friend class ::WorkerThread; public: static IconBuffer& getInstance(); bool requestIcon(const Zstring& fileName, wxIcon* icon = NULL); //returns false if icon is not in buffer void setWorkload(const std::vector& load); //(re-)set new workload of icons to be retrieved; static const int ICON_SIZE = 16; //size in pixel static const size_t BUFFER_SIZE = 800; //maximum number if icons to buffer private: IconBuffer(); ~IconBuffer(); //methods used by worker thread void insertIntoBuffer(const DefaultChar* fileName, const wxIcon& icon); //---------------------- Shared Data ------------------------- std::auto_ptr lockIconDB; std::auto_ptr buffer; //use synchronisation when accessing this! //------------------------------------------------------------ std::auto_ptr bufSequence; //save sequence of buffer entry to delte olderst elements std::auto_ptr worker; }; } #endif // ICONBUFFER_H_INCLUDED