LCOV - code coverage report
Current view: top level - include/utils - MooseObjectParameterName.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 1 1 100.0 %
Date: 2025-07-17 01:28:37 Functions: 1 1 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             : #pragma once
      11             : 
      12             : // MOOSE includes
      13             : #include "MooseObjectName.h"
      14             : 
      15             : // STL includes
      16             : #include <string>
      17             : 
      18             : /**
      19             :  * A class for storing an input parameter name.
      20             :  *
      21             :  * This class is used by the Control logic system, allowing for multiple tags
      22             :  * to be applied to many different MooseObject parameters.
      23             :  *
      24             :  * This class simply adds a third field (parameter name) to the MooseObjectName class.
      25             :  */
      26             : class MooseObjectParameterName : public MooseObjectName
      27             : {
      28             : public:
      29             :   /**
      30             :    * Build an object given a raw parameter name (e.g., from an input file parameter)
      31             :    */
      32             :   MooseObjectParameterName(std::string name);
      33             : 
      34             :   /**
      35             :    * Build an object given a MooseObjectName and parameter name
      36             :    */
      37             :   MooseObjectParameterName(const MooseObjectName & obj_name, const std::string & param);
      38             : 
      39             :   /**
      40             :    * Build an object given a tag, object name, and parameter name
      41             :    */
      42             :   MooseObjectParameterName(const std::string & tag,
      43             :                            const std::string & name,
      44             :                            const std::string & param,
      45             :                            const std::string & separator = std::string("/"));
      46             : 
      47             :   MooseObjectParameterName(const MooseObjectParameterName & rhs);
      48             : 
      49             :   /**
      50             :    * Return the parameter name.
      51             :    */
      52       46331 :   const std::string & parameter() const { return _parameter; }
      53             : 
      54             :   /**
      55             :    * Adds the parameter name to error checking.
      56             :    */
      57             :   virtual void check() final;
      58             : 
      59             :   ///@{
      60             :   /**
      61             :    * Comparison operators.
      62             :    *
      63             :    * Not that this class may be compared with MooseObjectName, this
      64             :    * feature is used by ControlInterface.
      65             :    *
      66             :    * The less than operator is required so this container can work in std::map.
      67             :    *
      68             :    * @see InputParameterWarehouse
      69             :    */
      70             :   bool operator==(const MooseObjectParameterName & rhs) const;
      71             :   bool operator==(const MooseObjectName & rhs) const;
      72             : 
      73             :   bool operator!=(const MooseObjectParameterName & rhs) const;
      74             :   bool operator!=(const MooseObjectName & rhs) const;
      75             : 
      76             :   bool operator<(const MooseObjectParameterName & rhs) const;
      77             :   ///@}
      78             : 
      79             :   // Allow printing with std:: cout
      80             :   friend std::ostream & operator<<(std::ostream & stream, const MooseObjectParameterName & obj);
      81             : 
      82             : protected:
      83             :   /// The name of the input parameter
      84             :   std::string _parameter;
      85             : };

Generated by: LCOV version 1.14