RecorderMutex.h 584 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef UTIL_RECORDERMUTEX_H
  2. #define UTIL_RECORDERMUTEX_H
  3. #include <mutex>
  4. #include <string>
  5. #include <vector>
  6. namespace CameraRecorder {
  7. namespace Util {
  8. class RecorderMutex
  9. {
  10. public:
  11. RecorderMutex();
  12. void RegisterRecording(const std::string& ipAddress);
  13. void UnregisterRecording(const std::string& ipAddress);
  14. bool IsRecording(const std::string& ipAddress);
  15. private:
  16. std::mutex m_mutex;
  17. std::vector<std::string> m_activeRecordings;
  18. };
  19. typedef RecorderMutex* const RecorderMutexPointer;
  20. } // namespace Util
  21. } // namespace CameraRecorder
  22. #endif // UTIL_RECORDERMUTEX_H