https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MooseObjectName.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// STL includes
13#include <string>
14
41{
42public:
48 MooseObjectName(const std::string & tag,
49 const std::string & name,
50 const std::string & separator = std::string("/"));
51
56 virtual ~MooseObjectName() = default;
57
61 MooseObjectName(std::string name);
62
67
71 const std::string & name() const { return _name; }
72
76 const std::string & tag() const { return _tag; }
77
79
86 bool operator==(const MooseObjectName & rhs) const;
87 bool operator!=(const MooseObjectName & rhs) const;
88 bool operator<(const MooseObjectName & rhs) const;
90
92 friend std::ostream & operator<<(std::ostream & stream, const MooseObjectName & obj);
93
94protected:
99
102 std::string _tag;
103 std::string _name;
104 std::string _combined;
105 std::string _separator; // used for better error messages only
107
111 virtual void check();
112};
A class for storing the names of MooseObject by tag and object name.
std::string _separator
MooseObjectName()
A constructor for use by MooseObjectParameterName.
bool operator==(const MooseObjectName &rhs) const
Comparison operators.
const std::string & name() const
Return the name.
bool operator<(const MooseObjectName &rhs) const
friend std::ostream & operator<<(std::ostream &stream, const MooseObjectName &obj)
Allows this to be used with std:: cout.
virtual ~MooseObjectName()=default
This class requires a virtual (but default) desctructor since it has virtual functions.
std::string _combined
bool operator!=(const MooseObjectName &rhs) const
const std::string & tag() const
Return the tag.
virtual void check()
Check that the name and tag are supplied correctly.