Move PluginMonitor out of TLuaEngine

This commit is contained in:
Lion Kortlepel
2022-05-26 20:59:53 +02:00
parent f06f31c2a0
commit 36547d1e9e
7 changed files with 110 additions and 84 deletions

23
include/TPluginMonitor.h Normal file
View File

@@ -0,0 +1,23 @@
#pragma once
#include "Common.h"
#include "IThreaded.h"
#include <atomic>
#include <memory>
#include <unordered_map>
class TLuaEngine;
class TPluginMonitor : IThreaded, public std::enable_shared_from_this<TPluginMonitor> {
public:
TPluginMonitor(const fs::path& Path, std::shared_ptr<TLuaEngine> Engine);
void operator()();
private:
std::shared_ptr<TLuaEngine> mEngine;
fs::path mPath;
std::atomic_bool mShutdown;
std::unordered_map<std::string, fs::file_time_type> mFileTimes;
};