A class which creates public interface functions for declaring and getting restartable data. More...
#include <PublicRestartable.h>
Public Member Functions | |
PublicRestartable (MooseApp &moose_app, const std::string &name, const std::string &system_name, THREAD_ID tid, const bool read_only=false, const RestartableDataMapName &metaname="") | |
This class constructor is used for non-Moose-based objects like interfaces. More... | |
template<typename T , typename... Args> | |
T & | declareRestartableData (const std::string &data_name, Args &&... args) |
Declare a piece of data as "restartable" and initialize it. More... | |
template<typename T , typename... Args> | |
const T & | getRestartableData (const std::string &data_name) const |
Declare a piece of data as "restartable" and initialize it Similar to declareRestartableData but returns a const reference to the object. More... | |
Protected Member Functions | |
ManagedValue< T > | declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
T & | declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
T & | declareRecoverableData (const std::string &data_name, Args &&... args) |
T & | declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args) |
T & | declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args) |
std::string | restartableName (const std::string &data_name) const |
Protected Attributes | |
MooseApp & | _restartable_app |
const std::string | _restartable_system_name |
const THREAD_ID | _restartable_tid |
const bool | _restartable_read_only |
A class which creates public interface functions for declaring and getting restartable data.
This is needed for objects which need to store Restartable as a data member instead of inheriting from it.
Definition at line 20 of file PublicRestartable.h.
|
inline |
This class constructor is used for non-Moose-based objects like interfaces.
A name for the storage as well as a system name must be passed in along with the thread ID explicitly.
moose_app | Reference to the application |
name | The name which is used when constructing the full-names of the restartable data. It is used with the following logic: system_name/name/data_name . (e.g. UserObjects/diffusion_kernel/coefficient). In most of the cases this is the name of the moose object. |
system_name | The name of the system where this object belongs to. |
tid | The thread ID. |
read_only | Switch to restrict the data for read-only. |
metaname | The name of the datamap where the restartable objects should be registered to. |
Definition at line 36 of file PublicRestartable.h.
|
inline |
Declare a piece of data as "restartable" and initialize it.
This means that in the event of a restart this piece of data will be restored back to its previous value.
NOTE: This returns a reference! Make sure you store it in a reference!
data_name | The name of the data (usually just use the same name as the member variable) |
args | Arguments to forward to the constructor of the data |
Definition at line 58 of file PublicRestartable.h.
Referenced by RestartableModelInterface::declareModelData().
|
inline |
Declare a piece of data as "restartable" and initialize it Similar to declareRestartableData
but returns a const reference to the object.
Forwarded arguments are not allowed in this case because we assume that the object is restarted and we won't need different constructors to initialize it.
NOTE: This returns a const reference! Make sure you store it in a const reference!
data_name | The name of the data (usually just use the same name as the member variable) |
Definition at line 74 of file PublicRestartable.h.
Referenced by RestartableModelInterface::getModelData().