Class for containing MooseEnum item information.
More...
#include <MooseEnumItem.h>
|
| std::string | _raw_name |
| | The name as provided in constructor.
|
| |
| std::string | _name |
| | Upper case name.
|
| |
| int | _id |
| | The numeric value for item.
|
| |
Class for containing MooseEnum item information.
Definition at line 18 of file MooseEnumItem.h.
◆ MooseEnumItem() [1/4]
| MooseEnumItem::MooseEnumItem |
( |
| ) |
|
Definition at line 14 of file MooseEnumItem.C.
std::string _name
Upper case name.
int _id
The numeric value for item.
std::string _raw_name
The name as provided in constructor.
static const int INVALID_ID
◆ MooseEnumItem() [2/4]
| MooseEnumItem::MooseEnumItem |
( |
const std::string & |
name, |
|
|
const int & |
id = INVALID_ID |
|
) |
| |
Definition at line 16 of file MooseEnumItem.C.
18{
19}
const std::string & name() const
std::string toUpper(std::string name)
Convert supplied string to upper case.
std::string trim(const std::string &str, const std::string &white_space=" \t\n\v\f\r")
Standard scripting language trim function.
◆ ~MooseEnumItem()
| MooseEnumItem::~MooseEnumItem |
( |
| ) |
|
|
default |
◆ MooseEnumItem() [3/4]
◆ MooseEnumItem() [4/4]
◆ id()
| const int & MooseEnumItem::id |
( |
| ) |
const |
|
inline |
Return the numeric, name, or raw name.
Definition at line 34 of file MooseEnumItem.h.
Referenced by MooseEnumBase::addEnumerationItem(), AttribExecOns::AttribExecOns(), MooseEnum::compareCurrent(), MooseEnum::getEnum(), MooseEnum::isValid(), MooseEnum::operator int(), operator!=(), operator==(), and setID().
◆ name()
| const std::string & MooseEnumItem::name |
( |
| ) |
const |
|
inline |
Definition at line 35 of file MooseEnumItem.h.
Referenced by MooseEnumBase::addEnumerationItem(), MooseEnumBase::checkDeprecated(), MooseEnum::compareCurrent(), TransientBase::constrainDTFromMultiApp(), MFEMProblem::executeMFEMObjects(), MooseEnumBase::find(), FEProblemBase::joinAndFinalize(), operator!=(), MooseEnum::operator!=(), operator!=(), operator!=(), operator==(), MooseEnum::operator==(), operator==(), operator==(), and ComputeDiracThread::printGeneralExecutionInformation().
◆ operator int()
| MooseEnumItem::operator int |
( |
| ) |
const |
|
inline |
Operator to allow this class to be used directly as a string for int.
Definition at line 43 of file MooseEnumItem.h.
◆ operator std::string()
| MooseEnumItem::operator std::string |
( |
| ) |
const |
|
inline |
◆ operator!=() [1/5]
| bool MooseEnumItem::operator!= |
( |
const char * |
value | ) |
const |
◆ operator!=() [2/5]
| bool MooseEnumItem::operator!= |
( |
const MooseEnumItem & |
item | ) |
const |
Definition at line 70 of file MooseEnumItem.C.
71{
73}
const int & id() const
Return the numeric, name, or raw name.
◆ operator!=() [3/5]
| bool MooseEnumItem::operator!= |
( |
const std::string & |
value | ) |
const |
◆ operator!=() [4/5]
| bool MooseEnumItem::operator!= |
( |
int |
value | ) |
const |
|
inline |
Definition at line 60 of file MooseEnumItem.h.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
◆ operator!=() [5/5]
| bool MooseEnumItem::operator!= |
( |
unsigned short |
value | ) |
const |
|
inline |
◆ operator<()
| bool MooseEnumItem::operator< |
( |
const MooseEnumItem & |
other | ) |
const |
|
inline |
Less than operator.
This is required for this class to work in maps and sets.
Definition at line 72 of file MooseEnumItem.h.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==() [1/5]
| bool MooseEnumItem::operator== |
( |
const char * |
value | ) |
const |
Comparison operators.
The comparison operators using the char * and string are case sensitive.
Definition at line 36 of file MooseEnumItem.C.
◆ operator==() [2/5]
| bool MooseEnumItem::operator== |
( |
const MooseEnumItem & |
item | ) |
const |
◆ operator==() [3/5]
| bool MooseEnumItem::operator== |
( |
const std::string & |
value | ) |
const |
◆ operator==() [4/5]
| bool MooseEnumItem::operator== |
( |
int |
value | ) |
const |
|
inline |
◆ operator==() [5/5]
| bool MooseEnumItem::operator== |
( |
unsigned short |
value | ) |
const |
|
inline |
◆ rawName()
| const std::string & MooseEnumItem::rawName |
( |
| ) |
const |
|
inline |
◆ setID()
| void MooseEnumItem::setID |
( |
const int & |
id | ) |
|
Method to change the ID of the item, but only if it is an INVALID_ID.
An error is produced if the ID is valid and this method is called.
This is needed to allow ExecFlagType objects to be created without an ID being provided, the ID is assigned when ExecFlagEnum::addAvailableFlags is called.
Definition at line 83 of file MooseEnumItem.C.
84{
86 mooseError(
"The ID of a MooseEnumItem can not be changed if it is valid, the item ",
88 " has a valid id of ",
90 ".");
92}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & |
out, |
|
|
const MooseEnumItem & |
item |
|
) |
| |
|
friend |
ostream operator for string printing.
Definition at line 75 of file MooseEnumItem.C.
77{
80}
const std::string & rawName() const
OStreamProxy out(std::cout)
◆ _id
The numeric value for item.
Definition at line 99 of file MooseEnumItem.h.
Referenced by id(), operator int(), operator!=(), operator!=(), operator!=(), operator<(), operator=(), operator==(), operator==(), operator==(), and setID().
◆ _name
| std::string MooseEnumItem::_name |
|
private |
Upper case name.
Definition at line 96 of file MooseEnumItem.h.
Referenced by name(), operator std::string(), operator!=(), operator!=(), operator!=(), operator<(), operator=(), operator==(), operator==(), operator==(), and setID().
◆ _raw_name
| std::string MooseEnumItem::_raw_name |
|
private |
◆ INVALID_ID
| const int MooseEnumItem::INVALID_ID = std::numeric_limits<int>::min() |
|
static |
The documentation for this class was generated from the following files: