An intermediate object for building a "controllable item", where an "item" can refer to multiple input parameters with different names. More...
#include <ControllableItem.h>
Public Member Functions | |
ControllableItem (const MooseObjectParameterName &name, libMesh::Parameters::Value *value, const std::set< ExecFlagType > &flags={}) | |
virtual | ~ControllableItem ()=default |
ControllableItem (const ControllableItem &)=default | |
ControllableItem (ControllableItem &&)=default | |
ControllableItem & | operator= (const ControllableItem &)=delete |
ControllableItem & | operator= (ControllableItem &&)=delete |
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. More... | |
template<typename T > | |
void | set (const T &value, bool type_check=true) |
Set the value(s) of the controlled parameters stored in this class. More... | |
template<typename T > | |
std::vector< T > | get (bool type_check=true) const |
Return a copy of all values for this "item". More... | |
template<typename T > | |
bool | check () const |
Return true if the template argument is valid for ALL items. More... | |
virtual const MooseObjectParameterName & | name () const |
Return the name of the master parameter. More... | |
std::string | type () const |
Return the type of the master parameter. More... | |
virtual std::string | dump (unsigned int indent=0) const |
Returns a string displaying the parameter name and current value. More... | |
const std::set< ExecFlagType > & | getExecuteOnFlags () const |
Return the execute flag restrictions, an empty set is un-restricted. More... | |
bool | operator== (const ControllableItem &rhs) const |
Use the master name for comparison operators to allow object to work within a set/map. More... | |
bool | operator!= (const ControllableItem &rhs) const |
bool | operator< (const ControllableItem &rhs) const |
void | resetChanged () |
Methods for ControlOutput::outputChangedControls, these don't have meaning outside of this function. More... | |
bool | isChanged () |
Protected Member Functions | |
ControllableItem () | |
Constructor for creating an empty item (see ControllableAlias) More... | |
Protected Attributes | |
std::vector< std::pair< MooseObjectParameterName, libMesh::Parameters::Value * > > | _pairs |
List of names for this item. More... | |
bool | _changed = false |
Flag for ControlOutput, allows output objects to keep track of when a parameter is altered. More... | |
std::set< ExecFlagType > | _execute_flags |
Flags to which the control is restricted (if not set it is unrestricted) More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const ControllableItem &obj) |
Allows this to be used with std:: cout. More... | |
An intermediate object for building a "controllable item", where an "item" can refer to multiple input parameters with different names.
The name supplied to the constructor is considered the "master" parameter. The parameter(s) added via the connect method are considered the secondaries.
In general, an ControllableItem will have a one-to-one relationship with an input parameter value, but in some instances it is desirable to connect parameters with different names together. For example, within MOOSE when a material is defined in an input file multiple Material objects are generated automatically. If a parameter is controlled on one of these objects it is necessary to also have the values on the other controlled as well. This example is the driver behind the creation of this intermediate class.
Definition at line 31 of file ControllableItem.h.
ControllableItem::ControllableItem | ( | const MooseObjectParameterName & | name, |
libMesh::Parameters::Value * | value, | ||
const std::set< ExecFlagType > & | flags = {} |
||
) |
Definition at line 13 of file ControllableItem.C.
|
virtualdefault |
|
default |
|
default |
|
protected |
Constructor for creating an empty item (see ControllableAlias)
Definition at line 21 of file ControllableItem.C.
bool ControllableItem::check | ( | ) | const |
Return true if the template argument is valid for ALL items.
Definition at line 175 of file ControllableItem.h.
void ControllableItem::connect | ( | ControllableItem * | item, |
bool | type_check = true |
||
) |
Connects the supplied item with this item to allow for multiple parameters to be changed by one.
Definition at line 24 of file ControllableItem.C.
Referenced by ControllableAlias::ControllableAlias().
|
virtual |
Returns a string displaying the parameter name and current value.
Reimplemented in ControllableAlias.
Definition at line 44 of file ControllableItem.C.
Referenced by operator<<().
std::vector< T > ControllableItem::get | ( | bool | type_check = true | ) | const |
Return a copy of all values for this "item".
Definition at line 153 of file ControllableItem.h.
|
inline |
Return the execute flag restrictions, an empty set is un-restricted.
Definition at line 108 of file ControllableItem.h.
|
inline |
Definition at line 102 of file ControllableItem.h.
|
virtual |
Return the name of the master parameter.
Reimplemented in ControllableAlias.
Definition at line 73 of file ControllableItem.C.
Referenced by connect(), ControllableItem(), operator!=(), operator<(), and operator==().
|
inline |
Definition at line 77 of file ControllableItem.h.
|
inline |
Definition at line 78 of file ControllableItem.h.
|
delete |
|
delete |
|
inline |
Use the master name for comparison operators to allow object to work within a set/map.
Definition at line 76 of file ControllableItem.h.
|
inline |
Methods for ControlOutput::outputChangedControls, these don't have meaning outside of this function.
Definition at line 101 of file ControllableItem.h.
void ControllableItem::set | ( | const T & | value, |
bool | type_check = true |
||
) |
Set the value(s) of the controlled parameters stored in this class.
The 'skip_type_check' flag allows this object to work with ControllableParameter that can store values of varying types.
Definition at line 131 of file ControllableItem.h.
std::string ControllableItem::type | ( | ) | const |
Return the type of the master parameter.
Definition at line 67 of file ControllableItem.C.
Referenced by connect().
|
friend |
Allows this to be used with std:: cout.
Definition at line 106 of file ControllableItem.C.
|
protected |
Flag for ControlOutput, allows output objects to keep track of when a parameter is altered.
Definition at line 123 of file ControllableItem.h.
Referenced by isChanged(), resetChanged(), and set().
|
protected |
Flags to which the control is restricted (if not set it is unrestricted)
Definition at line 126 of file ControllableItem.h.
Referenced by getExecuteOnFlags().
|
protected |
List of names for this item.
Definition at line 120 of file ControllableItem.h.
Referenced by check(), connect(), ControllableItem(), dump(), ControllableAlias::dump(), get(), name(), set(), and type().