19 mooseAssert(
data,
"Not set");
26 mooseAssert(
hasData(name),
"Doesn't have data");
37 auto find_it = std::find_if(
43 mooseAssert(find_it ==
_data.
end(),
"Inconsistent map");
47 const auto index = find_index->second;
48 mooseAssert(index == (std::size_t)std::distance(
_data.
begin(), find_it),
"Inconsistent map");
49 mooseAssert(
_data.
size() > index,
"Invalid index");
52 mooseAssert(
data.
name() == name,
"Inconsistent name");
69 mooseError(
"Restartable data with the name ", name,
" is not registered");
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
RestartableDataValue & addPointer(std::unique_ptr< RestartableDataValue > &&ptr, const WriteKey)
Storage for restartable data that is ordered based on insertion order.
const RestartableDataValue * findData(const std::string &name) const
Tries to find data with the name name; returns nullptr if not found.
RestartableDataValue & addData(std::unique_ptr< RestartableDataValue > data)
Adds the restartable data data to the map.
std::unordered_map< std::string, std::size_t > _name_to_data_index
Mapping from data name -> index in _data for quick indexing.
RestartableDataValue & data(const std::string &name)
bool hasData(const std::string &name) const
RestartableDataMap::Data _data
The registered data.
Abstract definition of a RestartableData value.
const std::string & name() const
The full (unique) name of this particular piece of data.
iterator begin()
Begin and end iterators to the underlying data.