swift
Public Member Functions | Friends | List of all members
swift::misc::LockFreeSharedWriter< T > Class Template Reference

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

Public Member Functions

LockFreeSharedWriteroperator= (const T &other)
 Replace the stored value by copying from a T. The change is applied by evaluating in a bool context.
 
LockFreeSharedWriteroperator= (T &&other) noexcept(std::is_nothrow_move_assignable_v< T >)
 Replace the stored value by moving from a T. The change is applied by evaluating in a bool context.
 
bool operator! ()
 Try to overwrite the original object with the new one stored in the writer, and return false on success. If true is returned, then the caller must try again. This would happen if another simultaneous write had occurred.
 
 operator bool ()
 Try to overwrite the original object with the new one stored in the writer, and return true on success. If false is returned, then the caller must try again. This would happen if another simultaneous write had occurred.
 
 ~LockFreeSharedWriter ()
 Destructor. The writer's changes must be committed before this is called.
 
 LockFreeSharedWriter (LockFreeSharedWriter &&other) noexcept
 Move constructor.
 
LockFreeSharedWriteroperator= (LockFreeSharedWriter &&other) noexcept
 Move assignment operator.
 
T & get ()
 The value can be modified through the returned reference. The modification is applied by evaluating in a bool context.
 
T * operator-> ()
 The value can be modified through the returned reference. The modification is applied by evaluating in a bool context.
 
T & operator* ()
 The value can be modified through the returned reference. The modification is applied by evaluating in a bool context.
 
 operator T& ()
 The value can be modified through the returned reference. The modification is applied by evaluating in a bool context.
 
 LockFreeSharedWriter (const LockFreeSharedWriter &)=delete
 LockFreeSharedWriter cannot be copied.
 
LockFreeSharedWriteroperator= (const LockFreeSharedWriter &)=delete
 LockFreeSharedWriter cannot be copied.
 

Friends

class LockFree< T >
 

Detailed Description

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

Return value of LockFree::sharedWrite().

Allows any one thread to safely write to the lock-free object.

Definition at line 128 of file lockfree.h.


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