template <typename T>

class WellDefinedCopyable

Defined at line 103 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

Protected Members

T instance_

Public Methods

template <typename... Args, typename = std::enable_if_t<std::is_constructible_v<T, Args...>>>
void WellDefinedCopyable<T> (Args &&... args)

Defined at line 109 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

void ~WellDefinedCopyable<T> ()

Defined at line 110 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

void WellDefinedCopyable<T> (const WellDefinedCopyable<T> & )

No copy, no move.

Defined at line 113 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

void WellDefinedCopyable<T> (WellDefinedCopyable<T> && )

Defined at line 114 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

WellDefinedCopyable<T> & operator= (const WellDefinedCopyable<T> & )

Defined at line 115 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

WellDefinedCopyable<T> & operator= (WellDefinedCopyable<T> && )

Defined at line 116 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

template <SyncOpt kSyncOpt = SyncOpt::AcqRelOps>
void Read (T & dst, SyncOptType<kSyncOpt> )

Read from the wrapped object into the destination buffer provided by the caller.

Defined at line 120 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

template <SyncOpt kSyncOpt = SyncOpt::AcqRelOps>
void Update (const T & src, SyncOptType<kSyncOpt> )

Update the wrapped object from the source buffer provided by the caller.

Defined at line 126 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h

const T & unsynchronized_get ()

WARNING: There be dragons here!

|unsynchronized_get| provides direct read-only access to the underlying

instance of |T|. Accessing the buffer this way is _only_ safe if the user

can guarantee that no write operations may be concurrently performed

against the storage while the user is reading the instance.

One example of a legitimate use of this method might be when a user is

operating in the write exclusive portion of a sequence lock. They are

guaranteed to be the only potential writer of the wrapped object, so while

it is still important that they continue to use Update when they wish to

mutate their instance of T, it is OK for them to read T directly without

using Read as this will not cause any undefined behavior when done

concurrently with other readers in the system.

Note that the method returns a `const T

&

`, but is not flagged as being

`const` itself. This helps to guarantee that users who need to read data

in the exclusive portion of a sequence lock can do so, but cannot do so

while in the middle of a shared read transaction.

Defined at line 149 of file ../../zircon/system/ulib/concurrent/include/lib/concurrent/copy.h