12 #include "libmesh/parameters.h" 36 const std::set<ExecFlagType> & flags = {});
58 void set(
const T &
value,
bool type_check =
true);
64 std::vector<T>
get(
bool type_check =
true)
const;
89 std::string
type()
const;
94 virtual std::string
dump(
unsigned int indent = 0)
const;
120 std::vector<std::pair<MooseObjectParameterName, libMesh::Parameters::Value *>>
_pairs;
129 template <
typename T>
133 for (
auto & pair :
_pairs)
137 if (type_check && param ==
nullptr)
140 "' parameter the supplied template argument must be of type '",
143 else if (param !=
nullptr)
151 template <
typename T>
155 std::vector<T> output;
156 output.reserve(
_pairs.size());
157 for (
const auto & pair :
_pairs)
161 if (type_check && param ==
nullptr)
164 "' parameter the supplied template argument must be of type '",
167 else if (param !=
nullptr)
168 output.push_back(param->
get());
173 template <
typename T>
177 return std::all_of(
_pairs.begin(),
179 [](std::pair<MooseObjectParameterName, libMesh::Parameters::Value *> pair)
183 return param !=
nullptr;
195 virtual std::string
dump(
unsigned int indent = 0)
const override;
virtual ~ControllableItem()=default
std::string indent(unsigned int spaces)
Create empty string for indenting.
std::set< ExecFlagType > _execute_flags
Flags to which the control is restricted (if not set it is unrestricted)
bool operator==(const ControllableItem &rhs) const
Use the master name for comparison operators to allow object to work within a set/map.
friend std::ostream & operator<<(std::ostream &stream, const ControllableItem &obj)
Allows this to be used with std:: cout.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
bool operator!=(const ControllableItem &rhs) const
const std::set< ExecFlagType > & getExecuteOnFlags() const
Return the execute flag restrictions, an empty set is un-restricted.
bool operator<(const ControllableItem &rhs) const
void connect(ControllableItem *item, bool type_check=true)
Connects the supplied item with this item to allow for multiple parameters to be changed by one...
virtual const MooseObjectParameterName & name() const
Return the name of the master parameter.
ControllableAlias(const MooseObjectParameterName &name, ControllableItem *)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
virtual std::string dump(unsigned int indent=0) const
Returns a string displaying the parameter name and current value.
void resetChanged()
Methods for ControlOutput::outputChangedControls, these don't have meaning outside of this function...
std::vector< std::pair< MooseObjectParameterName, libMesh::Parameters::Value * > > _pairs
List of names for this item.
bool check() const
Return true if the template argument is valid for ALL items.
std::string type() const
Return the type of the master parameter.
void set(const T &value, bool type_check=true)
Set the value(s) of the controlled parameters stored in this class.
An intermediate object for building a "controllable item", where an "item" can refer to multiple inpu...
ControllableItem()
Constructor for creating an empty item (see ControllableAlias)
A class for storing an input parameter name.
virtual std::string dump(unsigned int indent=0) const override
Returns a string displaying the parameter name and current value.
virtual const MooseObjectParameterName & name() const override
Return the name of the master parameter.
bool _changed
Flag for ControlOutput, allows output objects to keep track of when a parameter is altered...
MooseObjectParameterName _name
ControllableItem & operator=(const ControllableItem &)=delete
Allows for aliases to be defined via InputParameterWarehouse::addControllableParameterAlias.
std::vector< T > get(bool type_check=true) const
Return a copy of all values for this "item".