Line data Source code
1 : //* This file is part of the MOOSE framework
2 : //* https://mooseframework.inl.gov
3 : //*
4 : //* All rights reserved, see COPYRIGHT for full restrictions
5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 : //*
7 : //* Licensed under LGPL 2.1, please see LICENSE for details
8 : //* https://www.gnu.org/licenses/lgpl-2.1.html
9 :
10 : #include "Backup.h"
11 :
12 : #include "DataIO.h"
13 :
14 : void
15 3699 : dataStore(std::ostream & stream, Backup & backup, void * context)
16 : {
17 : mooseAssert(backup.header, "Not set");
18 : mooseAssert(backup.data, "Not set");
19 :
20 3699 : dataStore(stream, *backup.header, context);
21 3699 : dataStore(stream, *backup.data, context);
22 3699 : dataStore(stream, backup.mesh_files, context);
23 3699 : }
24 :
25 : void
26 1152 : dataLoad(std::istream & stream, Backup & backup, void * context)
27 : {
28 : mooseAssert(backup.header, "Not set");
29 : mooseAssert(backup.data, "Not set");
30 :
31 1152 : dataLoad(stream, *backup.header, context);
32 1152 : dataLoad(stream, *backup.data, context);
33 1152 : dataLoad(stream, backup.mesh_files, context);
34 1152 : }
35 :
36 : void
37 3699 : dataStore(std::ostream & stream, std::unique_ptr<Backup> & backup, void * context)
38 : {
39 3699 : bool has_value = backup != nullptr;
40 3699 : dataStore(stream, has_value, nullptr);
41 3699 : if (has_value)
42 3699 : dataStore(stream, *backup, context);
43 3699 : }
44 :
45 : void
46 1152 : dataLoad(std::istream & stream, std::unique_ptr<Backup> & backup, void * context)
47 : {
48 : bool has_value;
49 1152 : dataLoad(stream, has_value, nullptr);
50 1152 : if (has_value)
51 : {
52 1152 : backup = std::make_unique<Backup>();
53 1152 : dataLoad(stream, *backup, context);
54 : }
55 1152 : }
|