Storage for restartable data that is ordered based on insertion order. More...
#include <RestartableDataMap.h>
Classes | |
class | Data |
Protected storage for restartable data. More... | |
Public Member Functions | |
RestartableDataMap () | |
RestartableDataValue & | addData (std::unique_ptr< RestartableDataValue > data) |
Adds the restartable data data to the map. More... | |
bool | hasData (const std::string &name) const |
RestartableDataValue & | data (const std::string &name) |
auto | size () const |
auto | empty () const |
const RestartableDataValue * | findData (const std::string &name) const |
Tries to find data with the name name ; returns nullptr if not found. More... | |
RestartableDataValue * | findData (const std::string &name) |
auto | begin () |
Begin and end iterators to the data. More... | |
auto | end () |
auto | begin () const |
auto | end () const |
Private Attributes | |
RestartableDataMap::Data | _data |
The registered data. More... | |
std::unordered_map< std::string, std::size_t > | _name_to_data_index |
Mapping from data name -> index in _data for quick indexing. More... | |
Storage for restartable data that is ordered based on insertion order.
The intent here is to be able to load declared restartable data in the order that it is instantiated.
Definition at line 27 of file RestartableDataMap.h.
RestartableDataMap::RestartableDataMap | ( | ) |
Definition at line 14 of file RestartableDataMap.C.
RestartableDataValue & RestartableDataMap::addData | ( | std::unique_ptr< RestartableDataValue > | data | ) |
Adds the restartable data data
to the map.
Definition at line 17 of file RestartableDataMap.C.
Referenced by RestartableDataReader::restoreData().
|
inline |
Begin and end iterators to the data.
Definition at line 78 of file RestartableDataMap.h.
|
inline |
Definition at line 80 of file RestartableDataMap.h.
RestartableDataValue & RestartableDataMap::data | ( | const std::string & | name | ) |
name
Definition at line 65 of file RestartableDataMap.C.
Referenced by addData(), and findData().
|
inline |
Definition at line 91 of file RestartableDataMap.h.
|
inline |
Definition at line 79 of file RestartableDataMap.h.
|
inline |
Definition at line 81 of file RestartableDataMap.h.
const RestartableDataValue * RestartableDataMap::findData | ( | const std::string & | name | ) | const |
Tries to find data with the name name
; returns nullptr if not found.
Definition at line 32 of file RestartableDataMap.C.
Referenced by data(), findData(), and hasData().
RestartableDataValue * RestartableDataMap::findData | ( | const std::string & | name | ) |
Definition at line 58 of file RestartableDataMap.C.
bool RestartableDataMap::hasData | ( | const std::string & | name | ) | const |
name
is added Definition at line 74 of file RestartableDataMap.C.
Referenced by addData().
|
inline |
Definition at line 87 of file RestartableDataMap.h.
Referenced by RestartableDataWriter::write().
|
private |
The registered data.
Definition at line 95 of file RestartableDataMap.h.
Referenced by addData(), begin(), empty(), end(), findData(), and size().
|
private |
Mapping from data name -> index in _data
for quick indexing.
Definition at line 97 of file RestartableDataMap.h.
Referenced by addData(), and findData().