Protected storage for restartable data. More...
#include <RestartableDataMap.h>
Classes | |
class | WriteKey |
Public Types | |
using | values_type = typename std::vector< std::unique_ptr< RestartableDataValue > > |
using | iterator = DereferenceIterator< typename values_type::iterator > |
using | const_iterator = DereferenceIterator< typename values_type::const_iterator > |
Public Member Functions | |
RestartableDataValue & | addPointer (std::unique_ptr< RestartableDataValue > &&ptr, const WriteKey) |
std::size_t | size () const |
bool | empty () const |
bool | hasValue (const std::size_t i) const |
iterator | begin () |
Begin and end iterators to the underlying data. More... | |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
const RestartableDataValue & | operator[] (const std::size_t i) const |
RestartableDataValue & | operator[] (const std::size_t i) |
const RestartableDataValue * | queryValue (const std::size_t i) const |
RestartableDataValue * | queryValue (const std::size_t i) |
Protected Member Functions | |
void | setPointer (const std::size_t i, std::unique_ptr< RestartableDataValue > &&ptr) |
Sets the underlying unique_ptr at index i to ptr . More... | |
RestartableDataValue & | addPointer (std::unique_ptr< RestartableDataValue > &&ptr) |
Adds the given object in ptr to the storage. More... | |
void | resize (const std::size_t size) |
Resizes the underlying vector. More... | |
void | clear () |
Clears the underlying vector. More... | |
Protected storage for restartable data.
Definition at line 33 of file RestartableDataMap.h.
|
inherited |
Definition at line 72 of file UniqueStorage.h.
|
inherited |
Definition at line 71 of file UniqueStorage.h.
|
inherited |
Definition at line 70 of file UniqueStorage.h.
|
inline |
Definition at line 43 of file RestartableDataMap.h.
Referenced by RestartableDataMap::addData().
|
inlineprotectedinherited |
Adds the given object in ptr
to the storage.
Definition at line 153 of file UniqueStorage.h.
|
inlineinherited |
Begin and end iterators to the underlying data.
Note that dereferencing these iterators may lead to an assertion or the dereference of a nullptr whether or not the underlying data is initialized.
Definition at line 82 of file UniqueStorage.h.
|
inlineinherited |
Definition at line 84 of file UniqueStorage.h.
|
inlineprotectedinherited |
Clears the underlying vector.
Definition at line 167 of file UniqueStorage.h.
|
inlineinherited |
Definition at line 116 of file UniqueStorage.h.
|
inlineinherited |
Definition at line 83 of file UniqueStorage.h.
|
inlineinherited |
Definition at line 85 of file UniqueStorage.h.
|
inlineinherited |
is
initialized Definition at line 121 of file UniqueStorage.h.
|
inlineinherited |
i
.Note that the underlying data may not necessarily be initialized, in which case this will throw an assertion or dereference a nullptr.
You can check whether or not the underlying data is initialized with hasValue(i).
Definition at line 98 of file UniqueStorage.h.
|
inlineinherited |
Definition at line 103 of file UniqueStorage.h.
|
inlineinherited |
i
The pointer will be nullptr if !hasValue(i), that is, if the unique_ptr at index i
is not initialized
Definition at line 130 of file UniqueStorage.h.
|
inlineinherited |
Definition at line 131 of file UniqueStorage.h.
|
inlineprotectedinherited |
Resizes the underlying vector.
Definition at line 162 of file UniqueStorage.h.
|
inlineprotectedinherited |
Sets the underlying unique_ptr at index i
to ptr
.
This can be used to construct objects in the storage, i.e., setPointer(0, std::make_unique<T>(...));
Definition at line 144 of file UniqueStorage.h.
|
inlineinherited |
Note that this is not necessarily the size of constructed objects, as underlying objects could be uninitialized
Definition at line 112 of file UniqueStorage.h.