@@ -184,6 +184,44 @@ namespace aspect
184184 virtual
185185 void
186186 parse_parameters (ParameterHandler &prm);
187+
188+ /* *
189+ * Save the state of this object to the argument given to this
190+ * function. This function is in support of checkpoint/restart
191+ * functionality.
192+ *
193+ * Derived classes can implement this function and should store their
194+ * state in a string that is deposited under a key in the map through
195+ * which the respective class can later find the status again when the
196+ * program is restarted. A legitimate key to store data under is
197+ * <code>typeid(*this).name()</code>. It is up to derived classes to
198+ * decide how they want to encode their state.
199+ *
200+ * The default implementation of this function does nothing, i.e., it
201+ * represents a stateless object for which nothing needs to be stored
202+ * at checkpoint time and nothing needs to be restored at restart
203+ * time.
204+ *
205+ * @param[in,out] status_strings The object into which implementations
206+ * in derived classes can place their status under a key that they can
207+ * use to retrieve the data.
208+ */
209+ virtual
210+ void save (std::map<std::string, std::string> &status_strings) const ;
211+
212+ /* *
213+ * Restore the state of the object by looking up a description of the
214+ * state in the passed argument under the same key under which it was
215+ * previously stored.
216+ *
217+ * The default implementation does nothing.
218+ *
219+ * @param[in] status_strings The object from which the status will be
220+ * restored by looking up the value for a key specific to this derived
221+ * class.
222+ */
223+ virtual
224+ void load (const std::map<std::string, std::string> &status_strings);
187225 };
188226
189227
@@ -281,13 +319,29 @@ namespace aspect
281319 const unsigned int version) const ;
282320
283321 /* *
284- * Read the data of this object from a stream for the purpose of
285- * serialization.
322+ * Manager classes are also plugins. The InterfaceBase class
323+ * that is common to all plugins has another save() function
324+ * that would be hidden by the one above. Make sure that both
325+ * remain visible.
286326 */
327+ using InterfaceBase::save;
328+
329+ /* *
330+ * Read the data of this object from a stream for the purpose of
331+ * serialization.
332+ */
287333 template <class Archive >
288334 void load (Archive &ar,
289335 const unsigned int version);
290336
337+ /* *
338+ * Manager classes are also plugins. The InterfaceBase class
339+ * that is common to all plugins has another load() function
340+ * that would be hidden by the one above. Make sure that both
341+ * remain visible.
342+ */
343+ using InterfaceBase::load;
344+
291345 BOOST_SERIALIZATION_SPLIT_MEMBER ()
292346
293347 protected:
0 commit comments