root/src/CopyManager.h @ 2c54c4c3
| 2c54c4c3 | david.sorber | /********************************************************************
|
|
* CONFIDENTIAL - All source code is the propriety and confidential *
|
|||
* information of David Sorber. *
|
|||
* *
|
|||
* Copyright 2024 David Sorber *
|
|||
* Unpublished -- all rights reserved under the copyright laws *
|
|||
* of the United States. *
|
|||
********************************************************************/
|
|||
#ifndef __COPYTOOL_COPYMANAGER_H_
|
|||
#define __COPYTOOL_COPYMANAGER_H_
|
|||
#include <atomic>
|
|||
#include <cstdint>
|
|||
#include <filesystem>
|
|||
#include <map>
|
|||
#include <string>
|
|||
#include <thread>
|
|||
#include <vector>
|
|||
#include "CopyManagerOptions.h"
|
|||
#include "ProtectedQueue.h"
|
|||
namespace sfs = std::filesystem;
|
|||
namespace DBS
|
|||
{
|
|||
class CopyManager
|
|||
{
|
|||
public:
|
|||
static inline const sfs::directory_entry ENTRY_TERMINATOR{};
|
|||
CopyManager(CopyManagerOptions& options);
|
|||
~CopyManager();
|
|||
int run();
|
|||
private:
|
|||
void mainThreadBody();
|
|||
void processThreadBody();
|
|||
CopyManagerOptions& r_options;
|
|||
ProtectedQueue<sfs::directory_entry> m_entryQueue;
|
|||
std::atomic_bool m_terminate;
|
|||
std::thread* p_mainThread;
|
|||
std::vector<std::thread*> m_procThreads;
|
|||
};
|
|||
} // namespace DBS
|
|||
#endif //__COPYTOOL_COPYMANAGER_H_
|