Loading [MathJax]/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CfgFunction Class Reference

Function configurator entry class The function pointers are all of type <void ()>. The user is responsible for casting them for usage to proper type. The constructor is responsible for casting them for storage to void() using reinterpret_cast. More...

#include <Configurator.h>

Inheritance diagram for CfgFunction:
CfgArray_Double CfgBase

Public Member Functions

 CfgFunction (std::string a_name, CfgSecureLevel a_level, int a_numofvals, const double a_defval, std::string a_function_name, std::function< void()> funtocall)
 
 CfgFunction (std::string a_name, CfgSecureLevel a_level, int a_numofvals, const double a_defval, std::string a_function_name)
 
 CfgFunction (std::string a_name, CfgSecureLevel a_level, int a_numofvals, const double a_defval)
 
std::function< void()> value () const
 
std::string fun_name () const
 
void set (std::vector< double > a_newval, std::string fun_name)
 
virtual CfgType gettype ()
 
- Public Member Functions inherited from CfgArray_Double
 CfgArray_Double (const std::string &a_name, CfgSecureLevel a_level, int a_numofvals, const std::vector< double > &a_defval)
 
 CfgArray_Double (const std::string &a_name, CfgSecureLevel a_level, int a_numofvals, const std::vector< double > &a_defval, bool a_definconf)
 
 CfgArray_Double (const std::string &a_key, CfgSecureLevel a_level, int a_numvals)
 
std::vector< double > value () const
 
void set (std::vector< double > a_newval)
 
int get_array_size ()
 
double value (unsigned a_index)
 
- Public Member Functions inherited from CfgBase
 CfgBase (const std::string &a_key, CfgSecureLevel a_level)
 
 CfgBase (const std::string &a_key, CfgSecureLevel a_level, bool a_definedinconfig)
 
virtual ~CfgBase ()
 
std::string getkey ()
 
CfgSecureLevel getlevel (void)
 
void set_definedinconfig (bool flag)
 
bool get_definedinconfig () const
 
bool get_rangetest () const
 

Protected Attributes

std::function< void()> funtocall
 
std::string function_name
 
- Protected Attributes inherited from CfgArray_Double
int array_size {0}
 
std::vector< double > m_doublearray {}
 
- Protected Attributes inherited from CfgBase
std::string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 
bool m_definedinconfig {false}
 

Detailed Description

Function configurator entry class The function pointers are all of type <void ()>. The user is responsible for casting them for usage to proper type. The constructor is responsible for casting them for storage to void() using reinterpret_cast.

Constructor & Destructor Documentation

◆ CfgFunction() [1/3]

CfgFunction::CfgFunction ( std::string  a_name,
CfgSecureLevel  a_level,
int  a_numofvals,
const double  a_defval,
std::string  a_function_name,
std::function< void()>  funtocall 
)

◆ CfgFunction() [2/3]

CfgFunction::CfgFunction ( std::string  a_name,
CfgSecureLevel  a_level,
int  a_numofvals,
const double  a_defval,
std::string  a_function_name 
)

◆ CfgFunction() [3/3]

CfgFunction::CfgFunction ( std::string  a_name,
CfgSecureLevel  a_level,
int  a_numofvals,
const double  a_defval 
)

Member Function Documentation

◆ fun_name()

std::string CfgFunction::fun_name ( ) const
inline
243 { return function_name; }

References function_name.

◆ gettype()

virtual CfgType CfgFunction::gettype ( void  )
inlinevirtual

Reimplemented from CfgArray_Double.

245 { return CFG_FUNCTION; }

References CFG_FUNCTION.

◆ set()

void CfgFunction::set ( std::vector< double >  a_newval,
std::string  fun_name 
)

◆ value()

std::function<void ()> CfgFunction::value ( ) const
inline
242 { return funtocall; }

References funtocall.

Member Data Documentation

◆ function_name

std::string CfgFunction::function_name
protected

Referenced by fun_name().

◆ funtocall

std::function<void ()> CfgFunction::funtocall
protected

Referenced by value().


The documentation for this class was generated from the following file:
CfgFunction::function_name
std::string function_name
Definition: Configurator.h:234
CfgFunction::funtocall
std::function< void()> funtocall
Definition: Configurator.h:233
CFG_FUNCTION
Definition: Configurator.h:66