32 std::lock_guard<std::mutex> lock(
m_mutex);
33 std::lock_guard<std::mutex> lock_other(other.m_mutex);
42 std::lock_guard<std::mutex> lock(
m_mutex);
43 std::lock_guard<std::mutex> lock_other(other.m_mutex);
44 m_value = std::move(other.m_value);
54 std::lock_guard<std::mutex> lock(
m_mutex);
55 std::lock_guard<std::mutex> lock_other(other.m_mutex);
68 std::lock_guard<std::mutex> lock(
m_mutex);
69 std::lock_guard<std::mutex> lock_other(other.m_mutex);
70 m_value = std::move(other.m_value);
81 std::lock_guard<std::mutex> lock(
m_mutex);
92 std::lock_guard<std::mutex> lock(
m_mutex);
107 std::strong_ordering operator<=>(const
Mutexed& other) const noexcept {
109 std::lock_guard<std::mutex> lock_this(
m_mutex);
110 std::lock_guard<std::mutex> lock_other(other.m_mutex);
113 if (
m_value == other.m_value) {
114 return std::strong_ordering::equal;
115 }
else if (
m_value < other.m_value) {
116 return std::strong_ordering::less;
118 return std::strong_ordering::greater;
128 return operator<=>(other) != std::strong_ordering::equal;
Definition mutexed.hxx:14
Mutexed(const Mutexed< T > &other) noexcept
Copy constructor.
Definition mutexed.hxx:31
void Unlock() const
Unlocks the mutex.
Definition mutexed.hxx:173
virtual Mutexed< T > & operator=(T &&value) noexcept
Assignment move operator.
Definition mutexed.hxx:91
virtual Mutexed< T > & operator=(const T &value) noexcept
Assignment operator.
Definition mutexed.hxx:80
virtual T & operator*() noexcept
Dereference operator (use with explicit locking).
Definition mutexed.hxx:135
virtual const T & operator*() const noexcept
Dereference operator (use with explicit locking).
Definition mutexed.hxx:143
Mutexed< T > & operator=(const Mutexed< T > &other) noexcept
Copy assignment operator.
Definition mutexed.hxx:52
Mutexed(Mutexed< T > &&other) noexcept
Move constructor.
Definition mutexed.hxx:41
void Lock() const
Locks the mutex.
Definition mutexed.hxx:166
bool operator!=(const Mutexed &other) const noexcept
Inequality operator.
Definition mutexed.hxx:127
Mutexed< T > & operator=(Mutexed< T > &&other) noexcept
Move assignment operator.
Definition mutexed.hxx:66
virtual ~Mutexed() noexcept=default
Destructor.
virtual T * operator->() noexcept
Pointer dereference operator (use with explicit locking).
Definition mutexed.hxx:151
std::mutex m_mutex
Mutex.
Definition mutexed.hxx:179
virtual const T * operator->() const noexcept
Pointer dereference operator (use with explicit locking).
Definition mutexed.hxx:159
std::strong_ordering operator<=>(const Mutexed &other) const noexcept
Spaceship operator for comparison.
Definition mutexed.hxx:107
Mutexed() noexcept=default
Default constructor.
T m_value
Value.
Definition mutexed.hxx:178
Main namespace for the StormByte library.