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>
292 template <
typename T>
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()));
306 template <
typename T>
310 mooseDeprecated(
"MultiMooseEnum::getEnum is deprecated, use MultiMooseEnum::getSetValueIDs");
311 return MultiMooseEnum::getSetValueIDs<T>();
const std::string & operator[](unsigned int i) const
Indexing operator Operator to retrieve an item from the MultiMooseEnum.
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.
MultiMooseEnum & assignValues(InputIterator first, InputIterator last, bool append)
Helper method for all inserts and assignment operators.
A MultiMooseEnum object to hold "execute_on" flags.
bool operator!=(const MultiMooseEnum &value) const
MooseEnumIterator begin() const
Returns a begin/end iterator to all of the set values in the enum.
void setAdditionalValue(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
MultiMooseEnum()
Protected constructor for use by libmesh::Parameters.
virtual bool isValid() const override
IsValid.
void addValidName(const std::string &name)
Extends the range of possible values the variable can be set to.
void removeSetValues(InputIterator first, InputIterator last)
Helper method for un-assigning enumeration values.
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
MooseEnumIterator end() const
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
The base class for both the MooseEnum and MultiMooseEnum classes.
MooseEnumBase & operator+=(const std::string &name)
bool contains(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
bool contains(unsigned short value) const
bool contains(int value) const
std::vector< MooseEnumItem >::const_iterator MooseEnumIterator
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
bool isValueSet(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
void erase(const std::string &names)
Un-assign, or unset a value.
std::vector< T > getSetValueIDs() const
get the current values cast to a vector of enum type T
std::vector< T > getEnum() const
get the current values cast to a vector of enum type T. Deprecated, use getSetValueIDs instead...
bool contains(const MooseEnumItem &value) const
MultiMooseEnum & operator=(const MultiMooseEnum &other_enum)=default
Copy Assignment operator must be explicitly defined when a copy ctor exists and this method is used...
Class for containing MooseEnum item information.
bool operator==(const MultiMooseEnum &value) const
Comparison operators for comparing with character constants, MultiMooseEnums or integer values...
void push_back(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
std::vector< MooseEnumItem > _current_values
The current value(s) of the MultiMooseEnum.
bool contains(const MultiMooseEnum &value) const
OStreamProxy out(std::cout)
void clearSetValues()
Clear the MultiMooseEnum.
void eraseSetValue(const std::string &names)
Un-assign, or unset a value.