Class for containing MooseEnum item information. More...
#include <MooseEnumItem.h>
Public Member Functions | |
MooseEnumItem () | |
MooseEnumItem (const std::string &name, const int &id=INVALID_ID) | |
~MooseEnumItem ()=default | |
MooseEnumItem (const MooseEnumItem &other) | |
MooseEnumItem (MooseEnumItem &&)=default | |
MooseEnumItem & | operator= (const MooseEnumItem &other) |
MooseEnumItem & | operator= (MooseEnumItem &&)=default |
bool | operator< (const MooseEnumItem &other) const |
Less than operator. More... | |
void | setID (const int &id) |
Method to change the ID of the item, but only if it is an INVALID_ID. More... | |
const int & | id () const |
Return the numeric, name, or raw name. More... | |
const std::string & | name () const |
const std::string & | rawName () const |
operator int () const | |
Operator to allow this class to be used directly as a string for int. More... | |
operator std::string () const | |
bool | operator== (const char *value) const |
Comparison operators. More... | |
bool | operator!= (const char *value) const |
bool | operator== (const std::string &value) const |
bool | operator!= (const std::string &value) const |
bool | operator== (int value) const |
bool | operator!= (int value) const |
bool | operator== (unsigned short value) const |
bool | operator!= (unsigned short value) const |
bool | operator== (const MooseEnumItem &) const |
bool | operator!= (const MooseEnumItem &) const |
Static Public Attributes | |
static const int | INVALID_ID = std::numeric_limits<int>::min() |
Private Attributes | |
std::string | _raw_name |
The name as provided in constructor. More... | |
std::string | _name |
Upper case name. More... | |
int | _id |
The numeric value for item. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const MooseEnumItem &item) |
ostream operator for string printing. More... | |
Class for containing MooseEnum item information.
Definition at line 18 of file MooseEnumItem.h.
MooseEnumItem::MooseEnumItem | ( | ) |
Definition at line 14 of file MooseEnumItem.C.
MooseEnumItem::MooseEnumItem | ( | const std::string & | name, |
const int & | id = INVALID_ID |
||
) |
Definition at line 16 of file MooseEnumItem.C.
|
default |
MooseEnumItem::MooseEnumItem | ( | const MooseEnumItem & | other | ) |
Definition at line 21 of file MooseEnumItem.C.
|
default |
|
inline |
Return the numeric, name, or raw name.
Definition at line 34 of file MooseEnumItem.h.
Referenced by MooseEnumBase::addEnumerationItem(), AttribExecOns::AttribExecOns(), MooseEnum::compareCurrent(), MooseEnumBase::find(), MooseEnum::getEnum(), MooseEnum::isValid(), MooseEnum::operator int(), operator!=(), operator==(), and setID().
|
inline |
Definition at line 35 of file MooseEnumItem.h.
Referenced by MooseEnumBase::addEnumerationItem(), MooseEnumBase::checkDeprecated(), MooseEnum::compareCurrent(), Transient::constrainDTFromMultiApp(), MooseEnumBase::find(), FEProblemBase::joinAndFinalize(), operator!=(), MooseEnum::operator!=(), operator==(), MooseEnum::operator==(), and ComputeDiracThread::printGeneralExecutionInformation().
|
inline |
Operator to allow this class to be used directly as a string for int.
Definition at line 43 of file MooseEnumItem.h.
|
inline |
Definition at line 44 of file MooseEnumItem.h.
bool MooseEnumItem::operator!= | ( | const char * | value | ) | const |
Definition at line 43 of file MooseEnumItem.C.
bool MooseEnumItem::operator!= | ( | const std::string & | value | ) | const |
Definition at line 57 of file MooseEnumItem.C.
|
inline |
Definition at line 60 of file MooseEnumItem.h.
|
inline |
Definition at line 63 of file MooseEnumItem.h.
bool MooseEnumItem::operator!= | ( | const MooseEnumItem & | item | ) | const |
Definition at line 70 of file MooseEnumItem.C.
|
inline |
Less than operator.
This is required for this class to work in maps and sets.
Definition at line 72 of file MooseEnumItem.h.
MooseEnumItem & MooseEnumItem::operator= | ( | const MooseEnumItem & | other | ) |
Definition at line 27 of file MooseEnumItem.C.
|
default |
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.
bool MooseEnumItem::operator== | ( | const std::string & | value | ) | const |
Definition at line 50 of file MooseEnumItem.C.
|
inline |
Definition at line 59 of file MooseEnumItem.h.
|
inline |
Definition at line 62 of file MooseEnumItem.h.
bool MooseEnumItem::operator== | ( | const MooseEnumItem & | item | ) | const |
Definition at line 64 of file MooseEnumItem.C.
|
inline |
Definition at line 36 of file MooseEnumItem.h.
Referenced by MooseEnum::operator std::string(), and operator<<().
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.
|
friend |
ostream operator for string printing.
Definition at line 76 of file MooseEnumItem.C.
|
private |
The numeric value for item.
Definition at line 99 of file MooseEnumItem.h.
Referenced by id(), operator int(), operator!=(), operator<(), operator=(), operator==(), and setID().
|
private |
Upper case name.
Definition at line 96 of file MooseEnumItem.h.
Referenced by name(), operator std::string(), operator!=(), operator<(), operator=(), operator==(), and setID().
|
private |
The name as provided in constructor.
Definition at line 93 of file MooseEnumItem.h.
Referenced by operator=(), and rawName().
Definition at line 21 of file MooseEnumItem.h.
Referenced by MooseEnum::assign(), MooseEnum::isValid(), and setID().