Flow123d  JB-rel-int-test-ea53151
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 36 of file functors.hh.

Constructor & Destructor Documentation

◆ FunctorCommon()

template<class Type >
FunctorCommon< Type >::FunctorCommon

Constructor.

Definition at line 26 of file functors_impl.hh.

◆ ~FunctorCommon()

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

Destructor.

Definition at line 29 of file functors_impl.hh.

Member Function Documentation

◆ param()

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 60 of file functors_impl.hh.

Here is the caller graph for this function:

◆ set_param()

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)`
void set_param(unsigned int param_name, double param_value)
Sets a functor's parameter.
static constexpr bool value
Definition: json.hpp:87

.

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 32 of file functors_impl.hh.

◆ set_param_from_func()

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 46 of file functors_impl.hh.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ FunctorCommon

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

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

Definition at line 71 of file functors.hh.

Member Data Documentation

◆ param_

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

Definition at line 68 of file functors.hh.


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