LCOV - code coverage report
Current view: top level - src/utils - GuaranteeProvider.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 9 9 100.0 %
Date: 2025-07-25 05:00:39 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 "GuaranteeProvider.h"
      11             : #include "MooseObject.h"
      12             : 
      13       25960 : GuaranteeProvider::GuaranteeProvider(const MooseObject * /*moose_object*/) {}
      14             : 
      15             : bool
      16    41372490 : GuaranteeProvider::hasGuarantee(const MaterialPropertyName & prop_name, Guarantee guarantee)
      17             : {
      18             :   auto it = _guarantees.find(prop_name);
      19    41372490 :   if (it == _guarantees.end())
      20             :     return false;
      21             : 
      22             :   auto it2 = it->second.find(guarantee);
      23             :   return it2 != it->second.end();
      24             : }
      25             : 
      26             : void
      27       65454 : GuaranteeProvider::issueGuarantee(const MaterialPropertyName & prop_name, Guarantee guarantee)
      28             : {
      29             :   // intentional insertion
      30       65454 :   _guarantees[prop_name].insert(guarantee);
      31       65454 : }
      32             : 
      33             : void
      34        1560 : GuaranteeProvider::revokeGuarantee(const MaterialPropertyName & prop_name, Guarantee guarantee)
      35             : {
      36             :   auto it = _guarantees.find(prop_name);
      37        1560 :   if (it != _guarantees.end())
      38             :     it->second.erase(guarantee);
      39        1560 : }

Generated by: LCOV version 1.14