|
| constexpr | rcu (allocator_type allocator=allocator_type{}) noexcept |
| | Construct a new rcu object.
|
| |
|
| rcu (rcu const &)=delete |
| |
|
| rcu (rcu &&)=delete |
| |
|
rcu & | operator= (rcu const &)=delete |
| |
|
rcu & | operator= (rcu &&)=delete |
| |
| void | read_lock () noexcept |
| | Lock the rcu pointer for reading.
|
| |
| void | read_unlock () noexcept |
| | Unlock the rcu pointer for reading.
|
| |
| void | write_lock () noexcept |
| | Lock the rcu pointer for writing.
|
| |
| void | write_unlock () noexcept |
| | Unlock the rcu pointer for writing.
|
| |
| value_type const * | get () noexcept |
| | get the rcu-pointer.
|
| |
| value_type const * | unsafe_get () noexcept |
| | Derefence the rcu-pointer.
|
| |
| uint64_t | version () const noexcept |
| | The version of the lock.
|
| |
| size_t | capacity () const noexcept |
| | Number of object that are currently allocated.
|
| |
| value_type * | exchange (value_type *ptr) noexcept |
| | Exchange the rcu-pointers.
|
| |
| value_type * | copy () const noexcept |
| | Create a copy of the value.
|
| |
| template<typename... Args> |
| void | emplace (Args &&...args) noexcept |
| | Emplace a new value.
|
| |
|
bool | empty () const noexcept |
| |
|
| operator bool () const noexcept |
| |
|
void | reset () noexcept |
| |
|
rcu & | operator= (nullptr_t) noexcept |
| |
| void | add_old_copy (uint64_t old_version, value_type *old_ptr) noexcept |
| | Add an old copy.
|
| |
template<typename T, typename Allocator = std::allocator<T>>
class v1::rcu< T, Allocator >
Read-copy-update.
- Template Parameters
-
| T | The type managed by RCU. |
| Allocator | The allocator used to allocate objects of type T. |
template<typename T , typename Allocator = std::allocator<T>>
template<typename... Args>
| void v1::rcu< T, Allocator >::emplace |
( |
Args &&... | args | ) |
|
|
inlinenoexcept |
Emplace a new value.
This function will allocate and construct a new value, then replace the current value.
This function will also destroy and deallocate old values when no other threads are reading them.
- Parameters
-
| args | The arguments passed to the constructor of the value. |