Repository navigation
Expand file tree
/
Copy pathFileMonitor.h
More file actions
61 lines (47 loc) · 1.72 KB
/
Copy pathFileMonitor.h
File metadata and controls
61 lines (47 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include <map>
#include <deque>
#include <CxxPtr/GlibPtr.h>
#include <CxxPtr/GioPtr.h>
#include "Config.h"
#include "SessionsSharedData.h"
struct FilesMonitorsContext;
struct FilesMonitorContext {
FilesMonitorContext(
const FilesMonitorsContext *const monitorsContext,
const std::string& streamer,
GFilePtr&& dirPtr,
GFileMonitorPtr&& monitor) :
monitorsContext(monitorsContext),
streamer(streamer),
dirPtr(std::move(dirPtr)),
monitorPtr(std::move(monitor)) {}
const FilesMonitorsContext *const monitorsContext;
const std::string streamer;
GFilePtr dirPtr;
GFileMonitorPtr monitorPtr;
std::map<std::string, uint64_t> files; // file name -> file timestamp
};
struct FilesMonitorsContext {
FilesMonitorsContext(GMainContextPtr&& mainContextPtr, SessionsSharedData* sharedData) :
mainContextPtr(std::move(mainContextPtr)), sharedData(sharedData) {}
const GMainContextPtr mainContextPtr;
SessionsSharedData *const sharedData;
std::deque<FilesMonitorContext> monitors;
};
void FilesMonitorsInitAction(
FilesMonitorsContext& context,
const std::deque<std::pair<std::string, std::string>>& monitorList);
struct RecordingsMonitorContext {
RecordingsMonitorContext(const RecordConfig& config, GFilePtr&& dirPtr, GFileMonitorPtr&& monitor) :
config(config), dirPtr(std::move(dirPtr)), monitorPtr(std::move(monitor)) {}
const RecordConfig config;
GFilePtr dirPtr;
GFileMonitorPtr monitorPtr;
};
struct RecordingsCleanupContext {
std::deque<RecordingsMonitorContext> monitors;
};
void RecordingsCleanupInitAction(
RecordingsCleanupContext& context,
const std::deque<RecordConfig>& cleanupList);