MLBookProc 1.0
 
Loading...
Searching...
No Matches
SelfRemovingPath.h
1/*
2 * Copyright (C) 2024-2025 Yury Bobylev <bobilev_yury@mail.ru>
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation, version 3.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16
17#ifndef SELFREMOVINGPATH_H
18#define SELFREMOVINGPATH_H
19
20#include <filesystem>
21#ifndef USE_OPENMP
22#include <atomic>
23#else
24#include <omp.h>
25#endif
26
35{
36public:
41
46
51
56
62
68
75 operator=(const std::filesystem::path &path);
76
81 explicit SelfRemovingPath(const std::filesystem::path &path);
82
86 std::filesystem::path path;
87
88private:
89 void
90 deleter();
91
92#ifndef USE_OPENMP
93 std::atomic<uint64_t> *count;
94#else
95 uint64_t *count;
96#endif
97};
98
99#endif // SELFREMOVINGPATH_H
SelfRemovingPath(const std::filesystem::path &path)
SelfRemovingPath constructor.
std::filesystem::path path
Path to be removed on destruction.
Definition SelfRemovingPath.h:86
SelfRemovingPath(SelfRemovingPath &&other)
SelfRemovingPath move constructor.
virtual ~SelfRemovingPath()
SelfRemovingPath destructor.
SelfRemovingPath(const SelfRemovingPath &other)
SelfRemovingPath copy constructor.
SelfRemovingPath()
SelfRemovingPath constructor.
SelfRemovingPath & operator=(const std::filesystem::path &path)
operator =
SelfRemovingPath & operator=(const SelfRemovingPath &other)
operator =
SelfRemovingPath & operator=(SelfRemovingPath &&other)
operator =