13 : _name(
name), _context(context), _declared(false), _loaded(false), _stored(false)
20 mooseAssert(!
_declared,
"Already declared");
46 mooseError(
"Failed to output restartable data '",
48 "' as JSON because a to_json method is not implemented for the type '",
53 json[
"type"] =
type();
55 json[
"name"] =
name();
std::string name(const ElemQuality q)
bool stored() const
Whether or not this data has been loaded.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
virtual bool hasStoreJSON() const =0
bool _loaded
Whether or not this has value has been loaded.
virtual void storeInternal(std::ostream &stream)=0
Internal method that stores the value into the stream stream in the specialized class.
RestartableDataValue(const std::string &name, void *const context)
Constructor.
Helper that protects access to setDeclared() to only MooseApp.
virtual void storeJSONValue(nlohmann::json &json) const =0
Internal method for storing the underlying JSON value.
bool _stored
Whether or not this has value has been stored.
virtual void loadInternal(std::istream &stream)=0
Internal method that loads the value from the stream stream in the specialized class.
virtual std::string type() const =0
String identifying the type of parameter stored.
bool loaded() const
Whether or not this data has been loaded.
bool declared() const
Whether or not this data has been declared.
void load(std::istream &stream)
Loads the value from the stream stream and sets it as loaded.
void store(std::ostream &stream)
Stores the value into the stream stream and sets it as stored.
Struct that represents parameters for how to store the JSON value via store.
bool _declared
Whether or not this data has been declared (true) or only retreived (false)
void setDeclared(const SetDeclaredKey)
Sets that this restartable value has been declared.
const std::string & name() const
The full (unique) name of this particular piece of data.