LCOV - code coverage report
Current view: top level - src/restart - Backup.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 20 20 100.0 %
Date: 2025-07-17 01:28:37 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14