swift
Loading...
Searching...
No Matches
swift::misc::LockFreeUniqueWriter< T > Class Template Reference

Return value of LockFree::uniqueWrite(). More...

#include <lockfree.h>

Public Member Functions

LockFreeUniqueWriter & operator= (const T &other)
 Replace the stored value by copying from a T. The change is applied in the destructor.
LockFreeUniqueWriter & operator= (T &&other) noexcept(std::is_nothrow_move_assignable_v< T >)
 Replace the stored value by moving from a T. The change is applied in the destructor.
 LockFreeUniqueWriter (LockFreeUniqueWriter &&other) noexcept
 Move constructor.
LockFreeUniqueWriter & operator= (LockFreeUniqueWriter &&other) noexcept
 Move assignment operator.
 ~LockFreeUniqueWriter ()
 Destructor. The original object will be overwritten by the new one stored in the writer.
T & get ()
 The value can be modified through the returned reference. The modification is applied in the destructor.
T * operator-> ()
 The value can be modified through the returned reference. The modification is applied in the destructor.
T & operator* ()
 The value can be modified through the returned reference. The modification is applied in the destructor.
 operator T& ()
 The value can be modified through the returned reference. The modification is applied in the destructor.
 LockFreeUniqueWriter (const LockFreeUniqueWriter &)=delete
 LockFreeUniqueWriter cannot be copied.
LockFreeUniqueWriter & operator= (const LockFreeUniqueWriter &)=delete
 LockFreeUniqueWriter cannot be copied.

Friends

class LockFree< T >

Detailed Description

template<typename T>
class swift::misc::LockFreeUniqueWriter< T >

Return value of LockFree::uniqueWrite().

Allows any one thread to safely write to the lock-free object, as long as no other thread write to it.

Definition at line 60 of file lockfree.h.

Constructor & Destructor Documentation

◆ LockFreeUniqueWriter()

template<typename T>
swift::misc::LockFreeUniqueWriter< T >::LockFreeUniqueWriter ( LockFreeUniqueWriter< T > && other)
inlinenoexcept

Move constructor.

Definition at line 92 of file lockfree.h.

◆ ~LockFreeUniqueWriter()

template<typename T>
swift::misc::LockFreeUniqueWriter< T >::~LockFreeUniqueWriter ( )
inline

Destructor. The original object will be overwritten by the new one stored in the writer.

Definition at line 105 of file lockfree.h.

Member Function Documentation

◆ get()

template<typename T>
T & swift::misc::LockFreeUniqueWriter< T >::get ( )
inline

The value can be modified through the returned reference. The modification is applied in the destructor.

Definition at line 65 of file lockfree.h.

◆ operator T&()

template<typename T>
swift::misc::LockFreeUniqueWriter< T >::operator T& ( )
inline

The value can be modified through the returned reference. The modification is applied in the destructor.

Definition at line 68 of file lockfree.h.

◆ operator*()

template<typename T>
T & swift::misc::LockFreeUniqueWriter< T >::operator* ( )
inline

The value can be modified through the returned reference. The modification is applied in the destructor.

Definition at line 67 of file lockfree.h.

◆ operator->()

template<typename T>
T * swift::misc::LockFreeUniqueWriter< T >::operator-> ( )
inline

The value can be modified through the returned reference. The modification is applied in the destructor.

Definition at line 66 of file lockfree.h.

◆ operator=() [1/3]

template<typename T>
LockFreeUniqueWriter & swift::misc::LockFreeUniqueWriter< T >::operator= ( const T & other)
inline

Replace the stored value by copying from a T. The change is applied in the destructor.

Definition at line 72 of file lockfree.h.

◆ operator=() [2/3]

template<typename T>
LockFreeUniqueWriter & swift::misc::LockFreeUniqueWriter< T >::operator= ( LockFreeUniqueWriter< T > && other)
inlinenoexcept

Move assignment operator.

Definition at line 97 of file lockfree.h.

◆ operator=() [3/3]

template<typename T>
LockFreeUniqueWriter & swift::misc::LockFreeUniqueWriter< T >::operator= ( T && other)
inlinenoexcept

Replace the stored value by moving from a T. The change is applied in the destructor.

Definition at line 79 of file lockfree.h.

◆ LockFree< T >

template<typename T>
friend class LockFree< T >
friend

Definition at line 105 of file lockfree.h.


The documentation for this class was generated from the following file: