55 std::string initialization_values,
56 bool allow_out_of_range =
false);
60 const char * initialization_values,
61 bool allow_out_of_range =
false);
72 MultiMooseEnum(std::string valid_names,
bool allow_out_of_range =
false);
115 bool isValueSet(
const std::string & value)
const;
138 void erase(
const std::string & names);
139 void erase(
const std::vector<std::string> & names);
140 void erase(
const std::set<std::string> & names);
161 void push_back(
const std::string & names);
162 void push_back(
const std::vector<std::string> & names);
163 void push_back(
const std::set<std::string> & names);
188 const std::string &
operator[](
unsigned int i)
const;
196 unsigned int get(
unsigned int i)
const;
199 template <
typename T>
200 std::vector<T>
getEnum()
const;
204 template <
typename T>
227 unsigned int size()
const;
254 void addValidName(
const std::initializer_list<std::string> & names);
266 template <
typename InputIterator>
274 template <
typename InputIterator>
296#ifdef LIBMESH_HAVE_CXX11_TYPE_TRAITS
297 static_assert(std::is_enum<T>::value ==
true,
298 "The type requested from MooseEnum::getEnum must be an enum type!\n\n");
300 std::vector<T> enum_vec;
302 enum_vec.push_back(
static_cast<T
>(current_value.id()));
310 mooseDeprecated(
"MultiMooseEnum::getEnum is deprecated, use MultiMooseEnum::getSetValueIDs");
311 return MultiMooseEnum::getSetValueIDs<T>();
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
std::vector< MooseEnumItem >::const_iterator MooseEnumIterator
A MultiMooseEnum object to hold "execute_on" flags.
The base class for both the MooseEnum and MultiMooseEnum classes.
Class for containing MooseEnum item information.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
bool contains(unsigned short value) const
MultiMooseEnum()
Protected constructor for use by libmesh::Parameters.
const std::string & operator[](unsigned int i) const
Indexing operator Operator to retrieve an item from the MultiMooseEnum.
bool operator!=(const MultiMooseEnum &value) const
MooseEnumBase & operator+=(const std::string &name)
bool contains(int value) const
std::vector< MooseEnumItem > _current_values
The current value(s) of the MultiMooseEnum.
void eraseSetValue(const std::string &names)
Un-assign, or unset a value.
void erase(const std::string &names)
Un-assign, or unset a value.
void setAdditionalValue(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
virtual void checkDeprecated() const override
Check whether any of the current values are deprecated when called.
friend std::ostream & operator<<(std::ostream &out, const MultiMooseEnum &obj)
Operator for printing to iostreams.
bool operator==(const MultiMooseEnum &value) const
Comparison operators for comparing with character constants, MultiMooseEnums or integer values.
std::vector< T > getSetValueIDs() const
get the current values cast to a vector of enum type T
bool isValueSet(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
unsigned int get(unsigned int i) const
Indexing operator Operator to retrieve the id of an item from the MultiMooseEnum.
bool contains(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
MooseEnumIterator end() const
void addValidName(const std::string &name)
Extends the range of possible values the variable can be set to.
bool contains(const MooseEnumItem &value) const
virtual bool isValid() const override
IsValid.
std::vector< T > getEnum() const
get the current values cast to a vector of enum type T. Deprecated, use getSetValueIDs instead.
MultiMooseEnum & assignValues(InputIterator first, InputIterator last, bool append)
Helper method for all inserts and assignment operators.
void push_back(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
void clearSetValues()
Clear the MultiMooseEnum.
MooseEnumIterator begin() const
Returns a begin/end iterator to all of the set values in the enum.
MultiMooseEnum & operator=(const MultiMooseEnum &other_enum)=default
Copy Assignment operator must be explicitly defined when a copy ctor exists and this method is used.
void removeSetValues(InputIterator first, InputIterator last)
Helper method for un-assigning enumeration values.
bool contains(const MultiMooseEnum &value) const
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...