https://mooseframework.inl.gov
Backup.h
Go to the documentation of this file.
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 #pragma once
11 
12 #include <sstream>
13 #include <memory>
14 #include <string>
15 #include <utility>
16 #include <vector>
17 
25 struct Backup
26 {
28  std::unique_ptr<std::stringstream> header = std::make_unique<std::stringstream>();
30  std::unique_ptr<std::stringstream> data = std::make_unique<std::stringstream>();
32  std::vector<std::pair<std::string, std::string>> mesh_files;
33 };
34 
35 void dataStore(std::ostream & stream, Backup & backup, void * context);
36 void dataLoad(std::istream & stream, Backup & backup, void * context);
37 void dataStore(std::ostream & stream, std::unique_ptr<Backup> & backup, void * context);
38 void dataLoad(std::istream & stream, std::unique_ptr<Backup> & backup, void * context);
void dataLoad(std::istream &stream, Backup &backup, void *context)
Definition: Backup.C:26
Helper class to hold streams for Backup and Restore operations.
Definition: Backup.h:25
void dataStore(std::ostream &stream, Backup &backup, void *context)
Definition: Backup.C:15
std::unique_ptr< std::stringstream > data
Restartable data payload stream.
Definition: Backup.h:30
std::vector< std::pair< std::string, std::string > > mesh_files
Pairs of checkpoint-relative entry names and binary payloads.
Definition: Backup.h:32
std::unique_ptr< std::stringstream > header
Restartable data header stream.
Definition: Backup.h:28