Init public repo
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "ISaveThread.h"
|
||||
#include "../SaverLib.h"
|
||||
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
class SaveThread : public ISaveThread
|
||||
{
|
||||
struct Msg
|
||||
{
|
||||
std::string msg;
|
||||
ISaver::ImportanceMessage importance;
|
||||
};
|
||||
SaverLib& saver_;
|
||||
|
||||
std::list<Msg> queue_;
|
||||
std::mutex m_queue_;
|
||||
|
||||
/*
|
||||
* Поток сохранения логов
|
||||
*/
|
||||
std::unique_ptr<std::thread> save_thread_;
|
||||
void SaveThreadMethod();
|
||||
std::atomic_bool is_runing_;
|
||||
public:
|
||||
SaveThread(SaverLib& saver);
|
||||
~SaveThread();
|
||||
|
||||
void save(const std::string& msg, ISaver::ImportanceMessage importance) override;
|
||||
};
|
||||
Reference in New Issue
Block a user