|
ReXGlue SDK
|
#include <rex/kernel/object/object.h>
Public Member Functions | |
| PublishedPtr (std::unique_ptr< T > owner) | |
| PublishedPtr & | operator= (std::unique_ptr< T > owner) |
| T * | get () noexcept |
| const T * | get () const noexcept |
| T * | operator-> () noexcept |
| const T * | operator-> () const noexcept |
| operator bool () const noexcept | |
| void | Replace (std::unique_ptr< T > next) |
| std::unique_ptr< T > | Take () noexcept |
Friends | |
| bool | operator== (const PublishedPtr &value, std::nullptr_t) noexcept |
Owns a host primitive that any thread reads without a lock and one writer at a time can replace. A replaced primitive stays alive until the owner is destroyed, so a reader holding the old pointer stays valid.
| T | A primitive type with a virtual destructor. |
|
inline |
| owner | The primitive to publish. |
|
inlinenoexcept |
|
inline |
Publishes a primitive and keeps the previous one alive. Callers serialize the writes.
| next | The primitive readers load from now on. |
|
inlinenodiscardnoexcept |
Takes the primitive of an object no other thread can see yet.