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
CfgArray_Int Class Reference

Array_Int configurator entry class. More...

#include <Configurator.h>

Inheritance diagram for CfgArray_Int:
CfgBase

Public Member Functions

 CfgArray_Int (const std::string &a_name, CfgSecureLevel a_level, int a_numofvals, const std::vector< int > &a_defval)
 
 CfgArray_Int (const std::string &a_name, CfgSecureLevel a_level, int a_numofvals, const std::vector< int > &a_defval, bool a_definconf)
 
 CfgArray_Int (const std::string &a_key, CfgSecureLevel a_level, int a_numvals)
 
std::vector< int > value () const
 
void set (std::vector< int > a_newval)
 
virtual CfgType gettype ()
 
int get_array_size ()
 
int 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

int array_size {0}
 
std::vector< int > m_intarray {}
 
- Protected Attributes inherited from CfgBase
std::string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 
bool m_definedinconfig {false}
 

Detailed Description

Array_Int configurator entry class.

Constructor & Destructor Documentation

◆ CfgArray_Int() [1/3]

CfgArray_Int::CfgArray_Int ( const std::string &  a_name,
CfgSecureLevel  a_level,
int  a_numofvals,
const std::vector< int > &  a_defval 
)
235  :CfgBase( a_key, a_level )
236 {
237  array_size = a_numvals;
238  m_intarray = a_defval;
239  g_cfg->Register( this, a_key );
240 }

References array_size, g_cfg, and m_intarray.

◆ CfgArray_Int() [2/3]

CfgArray_Int::CfgArray_Int ( const std::string &  a_name,
CfgSecureLevel  a_level,
int  a_numofvals,
const std::vector< int > &  a_defval,
bool  a_definconf 
)
252  :CfgBase{ a_key, a_level, a_definconf }
253 {
254  array_size = a_numvals;
255  m_intarray = a_defval;
256 }

◆ CfgArray_Int() [3/3]

CfgArray_Int::CfgArray_Int ( const std::string &  a_key,
CfgSecureLevel  a_level,
int  a_numvals 
)
243  :CfgBase( a_key, a_level )
244 {
245  array_size = a_numvals;
246 
247  g_cfg->Register( this, a_key );
248 }

References array_size, and g_cfg.

Member Function Documentation

◆ get_array_size()

int CfgArray_Int::get_array_size ( )
inline
204 {return array_size;}

References array_size.

◆ gettype()

virtual CfgType CfgArray_Int::gettype ( void  )
inlinevirtual

Reimplemented from CfgBase.

203 { return CFG_ARRAY_INT; }

References CFG_ARRAY_INT.

◆ set()

void CfgArray_Int::set ( std::vector< int >  a_newval)
inline
202 { m_intarray = std::move(a_newval); }

References m_intarray.

◆ value() [1/2]

◆ value() [2/2]

int CfgArray_Int::value ( unsigned  a_index)
inline
205 { return m_intarray[a_index]; }

References m_intarray.

Member Data Documentation

◆ array_size

int CfgArray_Int::array_size {0}
protected

Referenced by CfgArray_Int(), and get_array_size().

◆ m_intarray

std::vector<int> CfgArray_Int::m_intarray {}
protected

Referenced by CfgArray_Int(), set(), and value().


The documentation for this class was generated from the following files:
CFG_ARRAY_INT
Definition: Configurator.h:64
CfgArray_Int::m_intarray
std::vector< int > m_intarray
Definition: Configurator.h:195
g_cfg
std::shared_ptr< Configurator > g_cfg
Definition: Configurator.cpp:56
CfgBase::CfgBase
CfgBase(const std::string &a_key, CfgSecureLevel a_level)
Definition: Configurator.cpp:84
CfgArray_Int::array_size
int array_size
Definition: Configurator.h:194
CfgBase
Base class for a configurator entry.
Definition: Configurator.h:79