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();
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Helper that protects access to setDeclared() to only MooseApp.
void store(std::ostream &stream)
Stores the value into the stream stream and sets it as stored.
virtual void loadInternal(std::istream &stream)=0
Internal method that loads the value from the stream stream in the specialized class.
bool stored() const
Whether or not this data has been loaded.
virtual void storeJSONValue(nlohmann::json &json) const =0
Internal method for storing the underlying JSON value.
bool declared() const
Whether or not this data has been declared.
const std::string & name() const
The full (unique) name of this particular piece of data.
RestartableDataValue(const std::string &name, void *const context)
Constructor.
void setDeclared(const SetDeclaredKey)
Sets that this restartable value has been declared.
void load(std::istream &stream)
Loads the value from the stream stream and sets it as loaded.
virtual std::string type() const =0
String identifying the type of parameter stored.
virtual bool hasStoreJSON() const =0
bool _stored
Whether or not this has value has been stored.
bool _declared
Whether or not this data has been declared (true) or only retreived (false)
bool loaded() const
Whether or not this data has been loaded.
virtual void storeInternal(std::ostream &stream)=0
Internal method that stores the value into the stream stream in the specialized class.
bool _loaded
Whether or not this has value has been loaded.
Struct that represents parameters for how to store the JSON value via store.