1
0

cacheManager.h 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef NULLSOFT_WINAMP_CACHE_MANAGER_HEADER
  2. #define NULLSOFT_WINAMP_CACHE_MANAGER_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "./ifc_omcachemanager.h"
  8. #include <vector>
  9. class CacheGroup;
  10. class CacheManager : public ifc_omcachemanager
  11. {
  12. protected:
  13. CacheManager();
  14. ~CacheManager();
  15. public:
  16. static HRESULT CreateInstance(CacheManager **instace);
  17. public:
  18. /* Dispatchable */
  19. size_t AddRef();
  20. size_t Release();
  21. int QueryInterface(GUID interface_guid, void **object);
  22. HRESULT Load();
  23. /* group managment */
  24. HRESULT Find(LPCWSTR pszGroup, BOOL fInsertMissing, CacheGroup **groupOut, BOOL *created);
  25. HRESULT Delete(LPCWSTR pszGroup);
  26. HRESULT Clear();
  27. HRESULT GetPath(LPWSTR pszBuffer, UINT cchBufferMax);
  28. protected:
  29. RECVS_DISPATCH;
  30. typedef std::vector<CacheGroup*> GroupList;
  31. protected:
  32. size_t ref;
  33. GroupList groupList;
  34. };
  35. #endif //NULLSOFT_WINAMP_CACHE_MANAGER_HEADER