LCOV - code coverage report
Current view: top level - src/restart - Backup.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 20 20 100.0 %
Date: 2026-05-29 20:35:17 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        3515 : dataStore(std::ostream & stream, Backup & backup, void * context)
      16             : {
      17             :   mooseAssert(backup.header, "Not set");
      18             :   mooseAssert(backup.data, "Not set");
      19             : 
      20        3515 :   dataStore(stream, *backup.header, context);
      21        3515 :   dataStore(stream, *backup.data, context);
      22        3515 : }
      23             : 
      24             : void
      25        1143 : dataLoad(std::istream & stream, Backup & backup, void * context)
      26             : {
      27             :   mooseAssert(backup.header, "Not set");
      28             :   mooseAssert(backup.data, "Not set");
      29             : 
      30        1143 :   dataLoad(stream, *backup.header, context);
      31        1143 :   dataLoad(stream, *backup.data, context);
      32        1143 : }
      33             : 
      34             : void
      35        3515 : dataStore(std::ostream & stream, std::unique_ptr<Backup> & backup, void * context)
      36             : {
      37        3515 :   bool has_value = backup != nullptr;
      38        3515 :   dataStore(stream, has_value, nullptr);
      39        3515 :   if (has_value)
      40        3515 :     dataStore(stream, *backup, context);
      41        3515 : }
      42             : 
      43             : void
      44        1143 : dataLoad(std::istream & stream, std::unique_ptr<Backup> & backup, void * context)
      45             : {
      46             :   bool has_value;
      47        1143 :   dataLoad(stream, has_value, nullptr);
      48        1143 :   if (has_value)
      49             :   {
      50        1143 :     backup = std::make_unique<Backup>();
      51        1143 :     dataLoad(stream, *backup, context);
      52             :   }
      53        1143 : }

Generated by: LCOV version 1.14