nx_server_plugin_sdk 1.0 Server Plugin SDK

dir_contents_manager.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <map>
6 #include <string>
7
8 #include <camera/camera_plugin.h>
9
10 #include "mutex.h"
11
13 class DirContentsManager
14 {
15 public:
16 DirContentsManager(
17 const std::string& imageDir,
18 unsigned int frameDurationUsec );
19
23 std::map<nxcip::UsecUTCTimestamp, std::string> dirContents() const;
24 void add( const nxcip::UsecUTCTimestamp& timestamp, const std::string& filePath );
25
26 nxcip::UsecUTCTimestamp minTimestamp() const;
27 nxcip::UsecUTCTimestamp maxTimestamp() const;
28
29 private:
30 std::string m_imageDir;
31 std::map<nxcip::UsecUTCTimestamp, std::string> m_dirContents;
32 unsigned int m_frameDurationUsec;
33 mutable Mutex m_mutex;
34
35 void readDirContents();
36 };
DirContentsManager::dirContents
std::map< nxcip::UsecUTCTimestamp, std::string > dirContents() const
Definition: dir_contents_manager.cpp:29
DirContentsManager
Manages information about image directory contents: Provides file list, generates timestamps of files...
Definition: dir_contents_manager.h:13
Mutex
Non-recursive non-named mutex.
Definition: mutex.h:11