Files
myxlib/src/myx/filesystem/paths_mt.hpp

60 lines
1.2 KiB
C++

/**
* @file paths.hpp
* @brief Стандартные пути к каталогам и файлам
*/
#ifndef MYX_FILESYSTEM_PATHS_MT_HPP_
#define MYX_FILESYSTEM_PATHS_MT_HPP_
#pragma once
#include <myx/base/config.hpp>
#include <myx/filesystem/current_executable.hpp>
#include <myx/filesystem/paths.hpp>
#include <QDir>
#include <QFileInfo>
#include <QString>
#include <atomic>
#include <future>
#include <mutex>
#include <thread>
namespace myx {
namespace filesystem {
/// @brief Потокобезопасная версия класса myx::filesystem::Paths
class PathsMT : public Paths
{
PathsMT();
~PathsMT() = default;
static std::atomic< PathsMT* > mInstance;
static std::mutex mMutex;
public:
PathsMT( const PathsMT& ) = delete;
PathsMT& operator=( const PathsMT& ) = delete;
PathsMT( PathsMT&& ) = delete;
PathsMT& operator=( PathsMT&& ) = delete;
/**
* @brief getInstance
* @return Уникальный экземпляр класса PathsMT
*/
static PathsMT& instance();
}; // class PathsMT
} // namespace filesystem
} // namespace myx
#ifdef MYXLIB_HEADER_ONLY
#include "paths_mt-inl.hpp"
#endif
#endif // MYX_FILESYSTEM_PATHS_MT_HPP_