Flow123d
JS_before_hm-2210-gb57a0a528
|
Class provides common functionality for functors. More...
#include <functors.hh>
Public Member Functions | |
FunctorCommon () | |
Constructor. More... | |
virtual | ~FunctorCommon () |
Destructor. More... | |
void | set_param (unsigned int param_name, double param_value) |
Sets a functor's parameter. More... | |
template<class TType > | |
void | set_param_from_func (FunctorCommon< TType > *func) |
Sets a functor's parameters from another functor. More... | |
double | param (unsigned int param_name) |
Returns parameter. More... | |
Protected Attributes | |
std::vector< double > | param_ |
Friends | |
template<class U > | |
class | FunctorCommon |
Setting these friend classes to be able to access param_ vector. More... | |
Class provides common functionality for functors.
This class provides methods for reading and setting functors parameters.
User is adviced to create Enumeration to access parameters. For example usage see class FunctorBase.
One can also use set_param_from_func to copy all parameters from another functor.
Definition at line 36 of file functors.hh.
FunctorCommon< Type >::FunctorCommon |
Constructor.
Definition at line 26 of file functors_impl.hh.
|
virtual |
Destructor.
Definition at line 29 of file functors_impl.hh.
double FunctorCommon< Type >::param | ( | unsigned int | param_name | ) |
Returns parameter.
param_name | is integer value (or enum value) to access member of the parameter vector |
Definition at line 60 of file functors_impl.hh.
void FunctorCommon< Type >::set_param | ( | unsigned int | param_name, |
double | param_value | ||
) |
Sets a functor's parameter.
There is a vector for the functors parameters. The vector of parameters is addressed by integer, but one can use enum inside one's own functor to make it more convenient. e.g.
.
param_name | is integer value (or enum value) to access member of the parameter vector |
param_value | is the new value of selected parameter |
Definition at line 32 of file functors_impl.hh.
void FunctorCommon< Type >::set_param_from_func | ( | FunctorCommon< TType > * | func | ) |
Sets a functor's parameters from another functor.
Copies all the parameters defined in the given functor.
func | is pointer to a functor we want to copy from |
Definition at line 46 of file functors_impl.hh.
Setting these friend classes to be able to access param_ vector.
Definition at line 71 of file functors.hh.
|
protected |
Definition at line 68 of file functors.hh.