PMDK C++ bindings
1.11
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Class for storing thread local data. More...
#include <libpmemobj++/detail/enumerable_thread_specific.hpp>
Public Member Functions | |
template<typename Handler > | |
void | initialize (Handler handler=[](reference) {}) |
Initialization method. More... | |
enumerable_thread_specific () | |
Constructor. | |
reference | local () |
Returns data reference for the current thread. More... | |
bool | empty () const |
Determines if container is empty or not. More... | |
void | clear () |
Removes all elements from the container. More... | |
size_type | size () const |
Returns number of elements being stored in the container. More... | |
iterator | begin () |
Returns an iterator to the beginning. More... | |
iterator | end () |
Returns an iterator to element after the last. More... | |
const_iterator | begin () const |
Returns an const_iterator to the beginning. More... | |
const_iterator | end () const |
Returns an const_iterator to element after the last. More... | |
Private Member Functions | |
obj::pool_base | get_pool () const noexcept |
Private helper function. More... | |
void | set_cached_size (size_t s) |
Set cached storage size, persist it and make valgrind annotations. | |
size_t | get_cached_size () |
Get cached storage size and make valgrind annotations. | |
Class for storing thread local data.
Needed in concurrent containers for data consistency. Mutex - mutex that satisfies SharedMutex requirements. Storage - persistent container for storing threads data.
enumerable_thread_specific< T, Mutex, Storage >::iterator pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::begin |
Returns an iterator to the beginning.
enumerable_thread_specific< T, Mutex, Storage >::const_iterator pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::begin |
Returns an const_iterator to the beginning.
void pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::clear |
bool pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::empty |
Determines if container is empty or not.
enumerable_thread_specific< T, Mutex, Storage >::iterator pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::end |
Returns an iterator to element after the last.
enumerable_thread_specific< T, Mutex, Storage >::const_iterator pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::end |
Returns an const_iterator to element after the last.
|
privatenoexcept |
Private helper function.
void pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::initialize | ( | Handler | handler = [](reference) {} | ) |
Initialization method.
Uses handler functor to each element stored. It must be used to handle the remaining data after a crash and restore the initial state of a container.
enumerable_thread_specific< T, Mutex, Storage >::reference pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::local |
Returns data reference for the current thread.
For the new thread, element by reference will be default constructed.
enumerable_thread_specific< T, Mutex, Storage >::size_type pmem::detail::enumerable_thread_specific< T, Mutex, Storage >::size |
Returns number of elements being stored in the container.