1
0

discoveryMonitor.h 769 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DISCOVERY_MONITOR_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DISCOVERY_MONITOR_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "ifc_deviceprovider.h"
  7. #include <vector>
  8. class DiscoveryMonitor
  9. {
  10. public:
  11. DiscoveryMonitor();
  12. ~DiscoveryMonitor();
  13. public:
  14. BOOL Register(ifc_deviceprovider *provider);
  15. BOOL Unregister(ifc_deviceprovider *provider);
  16. BOOL IsActive();
  17. BOOL Reset();
  18. protected:
  19. void Lock();
  20. void Unlock();
  21. private:
  22. typedef struct ActiveDiscovery
  23. {
  24. intptr_t providerId;
  25. size_t ref;
  26. } ActiveDiscovery;
  27. typedef std::vector<ActiveDiscovery> ActivityList;
  28. private:
  29. CRITICAL_SECTION lock;
  30. ActivityList activityList;
  31. };
  32. #endif // _NULLSOFT_WINAMP_DEVICES_DISCOVERY_MONITOR_HEADER