MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / TaskFile

Class TaskFile

FastCopy/TaskFile.h:6–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <mutex>
5#include "../FastCopyShellExtension/CopyOperation.h"
6class TaskFile
7{
8public:
9 template<typename Iterator>
10 class TaskFileIterator
11 {
12 Iterator m_iter;
13 mutable std::mutex m_lock;
14 public:
15 TaskFileIterator() = default;
16 TaskFileIterator(Iterator iter) : m_iter{ iter } {}
17 TaskFileIterator& operator++()
18 {
19 std::lock_guard lock{ m_lock };
20 ++m_iter;
21 return *this;
22 }
23
24 auto operator<=>(Iterator rhs) const
25 {
26 std::lock_guard lock{ m_lock };
27 return m_iter <=> rhs;
28 }
29
30 bool operator==(Iterator rhs) const
31 {
32 std::lock_guard lock{ m_lock };
33 return m_iter == rhs;
34 }
35
36 auto operator<=>(TaskFileIterator<Iterator> const& rhs) const
37 {
38 std::lock_guard lock{ m_lock };
39 return m_iter <=> rhs.m_iter;
40 }
41
42 bool operator==(TaskFileIterator<Iterator> const& rhs) const
43 {
44 std::lock_guard lock{ m_lock };
45 return m_iter == rhs.m_iter;
46 }
47
48 auto& operator*()
49 {
50 std::lock_guard lock{ m_lock };
51 return *m_iter;
52 }
53
54 auto& operator->()
55 {
56 std::lock_guard lock{ m_lock };
57 return &(*m_iter);
58 }
59
60 auto get() const
61 {
62 std::lock_guard lock{ m_lock };
63 return m_iter;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected