www.mooseframework.org
MooseObjectName.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 {
42 public:
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 
66  MooseObjectName(const MooseObjectName & rhs);
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 
94 protected:
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 };
const std::string & name() const
Return the name.
std::string _combined
std::string _tag
virtual ~MooseObjectName()=default
This class requires a virtual (but default) desctructor since it has virtual functions.
std::string _name
virtual void check()
Check that the name and tag are supplied correctly.
bool operator<(const MooseObjectName &rhs) const
bool operator!=(const MooseObjectName &rhs) const
bool operator==(const MooseObjectName &rhs) const
Comparison operators.
MooseObjectName()
A constructor for use by MooseObjectParameterName.
std::string _separator
friend std::ostream & operator<<(std::ostream &stream, const MooseObjectName &obj)
Allows this to be used with std:: cout.
A class for storing the names of MooseObject by tag and object name.
const std::string & tag() const
Return the tag.