47 std::string
dump()
const;
54 void set(
const T &
value,
bool type_check =
true);
60 std::vector<T>
get(
bool type_check =
true,
bool warn_when_values_difffer =
false)
const;
83 std::vector<ControllableItem *>
_items;
91 item->set<T>(
value, type_check);
98 std::vector<T> output;
101 std::vector<T> local = item->get<T>(type_check);
102 output.insert(output.end(), local.begin(), local.end());
106 if (warn_when_values_differ &&
_items.size() > 1)
109 const T value0 = output[0];
112 for (T
value : output)
116 std::ostringstream oss;
117 oss <<
"The following controlled parameters are being retrieved, but the values differ:\n";
127 template <
typename T>
131 bool type = std::all_of(
133 return type && !
empty();
bool empty()
Return true if the container is empty.
void set(const T &value, bool type_check=true)
Set the value(s) of the controlled parameters stored in this class.
virtual ~ControllableParameter()=default
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
The ControllableParameter class is simply a set of ControllableItem objects.
ControllableParameter & operator=(const ControllableParameter &)=delete
bool check()
Check size() and the type of the stored items, i.e., there must be items with the given type...
void checkExecuteOnType(const ExecFlagType ¤t) const
Check the execute flags.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void add(ControllableItem *item)
Adds the supplied item with the other items within this object.
std::vector< ControllableItem * > _items
Storage for the ControllableItems, these are stored as pointers to avoid copies.
friend std::ostream & operator<<(std::ostream &stream, const ControllableParameter &obj)
Allows this to be used with std:: cout.
std::vector< T > get(bool type_check=true, bool warn_when_values_difffer=false) const
Return a copy of the values of the given type.
Class for containing MooseEnum item information.
An intermediate object for building a "controllable item", where an "item" can refer to multiple inpu...
ControllableParameter()=default
std::string dump() const
Return a string that lists the parameters stored by this object.