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 3697 : dataStore(std::ostream & stream, Backup & backup, void * context)
16 : {
17 : mooseAssert(backup.header, "Not set");
18 : mooseAssert(backup.data, "Not set");
19 :
20 3697 : dataStore(stream, *backup.header, context);
21 3697 : dataStore(stream, *backup.data, context);
22 3697 : dataStore(stream, backup.mesh_files, context);
23 3697 : }
24 :
25 : void
26 1151 : dataLoad(std::istream & stream, Backup & backup, void * context)
27 : {
28 : mooseAssert(backup.header, "Not set");
29 : mooseAssert(backup.data, "Not set");
30 :
31 1151 : dataLoad(stream, *backup.header, context);
32 1151 : dataLoad(stream, *backup.data, context);
33 1151 : dataLoad(stream, backup.mesh_files, context);
34 1151 : }
35 :
36 : void
37 3697 : dataStore(std::ostream & stream, std::unique_ptr<Backup> & backup, void * context)
38 : {
39 3697 : bool has_value = backup != nullptr;
40 3697 : dataStore(stream, has_value, nullptr);
41 3697 : if (has_value)
42 3697 : dataStore(stream, *backup, context);
43 3697 : }
44 :
45 : void
46 1151 : dataLoad(std::istream & stream, std::unique_ptr<Backup> & backup, void * context)
47 : {
48 : bool has_value;
49 1151 : dataLoad(stream, has_value, nullptr);
50 1151 : if (has_value)
51 : {
52 1151 : backup = std::make_unique<Backup>();
53 1151 : dataLoad(stream, *backup, context);
54 : }
55 1151 : }
|