cacheGroup.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef NULLSOFT_WINAMP_CACHE_GROUP_HEADER
  2. #define NULLSOFT_WINAMP_CACHE_GROUP_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "./ifc_omcachegroup.h"
  8. #include <vector>
  9. class CacheRecord;
  10. class CacheManager;
  11. class CacheGroup : public ifc_omcachegroup
  12. {
  13. protected:
  14. CacheGroup(LPCWSTR pszName);
  15. ~CacheGroup();
  16. public:
  17. static HRESULT CreateInstance(LPCWSTR pszName, CacheGroup **instace);
  18. public:
  19. /* Dispatchable */
  20. size_t AddRef();
  21. size_t Release();
  22. int QueryInterface(GUID interface_guid, void **object);
  23. HRESULT SetOwner(CacheManager *group);
  24. HRESULT IsEqual(CacheGroup *group);
  25. HRESULT IsEqualName(LPCWSTR pszGroup);
  26. HRESULT IsEmpty();
  27. HRESULT GetName(LPWSTR pszBuffer, UINT cchBufferMax);
  28. HRESULT Find(LPCWSTR pszName, BOOL fInsertMissing, CacheRecord **recordOut, BOOL *created);
  29. HRESULT Delete(LPCWSTR pszName);
  30. HRESULT Clear();
  31. HRESULT Store(LPCWSTR pszName, LPCWSTR pszPath);
  32. HRESULT Load();
  33. HRESULT GetPath(LPWSTR pszBuffer, UINT cchBufferMax);
  34. protected:
  35. HRESULT Sort();
  36. protected:
  37. RECVS_DISPATCH;
  38. typedef std::vector<CacheRecord*> RecordList;
  39. protected:
  40. size_t ref;
  41. LPWSTR name;
  42. CacheManager *owner;
  43. RecordList recordList;
  44. };
  45. #endif //NULLSOFT_WINAMP_CACHE_HEADER