Flow123d  jenkins-Flow123d-windows-release-multijob-285
Public Member Functions | Protected Attributes | Friends | List of all members
FunctorCommon< Type > Class Template Reference

Class provides common functionality for functors. More...

#include <functors.hh>

Inheritance diagram for FunctorCommon< Type >:
Inheritance graph
[legend]
Collaboration diagram for FunctorCommon< Type >:
Collaboration graph
[legend]

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...
 

Detailed Description

template<class Type>
class FunctorCommon< Type >

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 22 of file functors.hh.

Constructor & Destructor Documentation

template<class Type >
FunctorCommon< Type >::FunctorCommon ( )

Constructor.

Definition at line 9 of file functors_impl.hh.

template<class Type >
FunctorCommon< Type >::~FunctorCommon ( )
virtual

Destructor.

Definition at line 12 of file functors_impl.hh.

Member Function Documentation

template<class Type >
double FunctorCommon< Type >::param ( unsigned int  param_name)

Returns parameter.

Parameters
param_nameis integer value (or enum value) to access member of the parameter vector

Definition at line 43 of file functors_impl.hh.

Here is the caller graph for this function:

template<class Type >
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.

`set_param(MyFunctor::my_parameter, value)`

.

Parameters
param_nameis integer value (or enum value) to access member of the parameter vector
param_valueis the new value of selected parameter

Definition at line 15 of file functors_impl.hh.

template<class Type >
template<class TType >
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.

Parameters
funcis pointer to a functor we want to copy from

Definition at line 29 of file functors_impl.hh.

Here is the caller graph for this function:

Friends And Related Function Documentation

template<class Type>
template<class U >
friend class FunctorCommon
friend

Setting these friend classes to be able to access param_ vector.

Definition at line 57 of file functors.hh.

Member Data Documentation

template<class Type>
std::vector<double> FunctorCommon< Type >::param_
protected

Definition at line 54 of file functors.hh.


The documentation for this class was generated from the following files: