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

Base class for a configurator entry. More...

#include <Configurator.h>

Inheritance diagram for CfgBase:
CfgArray_Double CfgArray_Int CfgBool CfgFloat CfgInt CfgStr CfgFunction

Public Member Functions

 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 ()
 
virtual CfgType gettype ()
 
CfgSecureLevel getlevel (void)
 
void set_definedinconfig (bool flag)
 
bool get_definedinconfig () const
 
bool get_rangetest () const
 

Protected Attributes

std::string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 
bool m_definedinconfig {false}
 

Detailed Description

Base class for a configurator entry.

Constructor & Destructor Documentation

◆ CfgBase() [1/2]

CfgBase::CfgBase ( const std::string &  a_key,
CfgSecureLevel  a_level 
)
85 {
86  if ( nullptr == g_cfg ) {
87  g_cfg = static_cast<const std::shared_ptr<Configurator>>(new Configurator);// move to c++11
88  // std::shared_ptr <Configurator> g_cfg(new Configurator);
89  }
90 
91  m_key = a_key;
92  m_level = a_level;
93  m_rangetest = false;
94 
95 }

References g_cfg, m_key, m_level, and m_rangetest.

◆ CfgBase() [2/2]

CfgBase::CfgBase ( const std::string &  a_key,
CfgSecureLevel  a_level,
bool  a_definedinconfig 
)
97 {
98  m_key = a_key;
99  m_level = a_level;
100  m_rangetest = false;
101  m_definedinconfig = a_definedinconfig;
102 }

References m_definedinconfig, m_key, m_level, and m_rangetest.

◆ ~CfgBase()

CfgBase::~CfgBase ( void  )
virtual
107 {
108  ;
109 }

Member Function Documentation

◆ get_definedinconfig()

bool CfgBase::get_definedinconfig ( ) const
inline
95 {return m_definedinconfig;}

References m_definedinconfig.

◆ get_rangetest()

bool CfgBase::get_rangetest ( ) const
inline
96 {return m_rangetest;};

References m_rangetest.

Referenced by Configurator::CheckBounds().

◆ getkey()

std::string CfgBase::getkey ( )
inline
91 { return m_key; }

References m_key.

◆ getlevel()

CfgSecureLevel CfgBase::getlevel ( void  )
inline
93 { return m_level; }

References m_level.

◆ gettype()

virtual CfgType CfgBase::gettype ( void  )
inlinevirtual

Reimplemented in CfgStr, CfgBool, CfgFloat, CfgInt, CfgFunction, CfgArray_Double, and CfgArray_Int.

92 { return CFG_NONE; }

References CFG_NONE.

Referenced by Configurator::CheckBounds().

◆ set_definedinconfig()

void CfgBase::set_definedinconfig ( bool  flag)
inline
94 {m_definedinconfig=flag;}

References m_definedinconfig.

Referenced by Configurator::Register().

Member Data Documentation

◆ m_definedinconfig

bool CfgBase::m_definedinconfig {false}
protected

◆ m_key

std::string CfgBase::m_key
protected

◆ m_level

CfgSecureLevel CfgBase::m_level
protected

Referenced by CfgBase(), and getlevel().

◆ m_rangetest

bool CfgBase::m_rangetest
protected

The documentation for this class was generated from the following files:
CfgBase::m_level
CfgSecureLevel m_level
Definition: Configurator.h:82
g_cfg
std::shared_ptr< Configurator > g_cfg
Definition: Configurator.cpp:56
Configurator
A class to provide standard parameter entry facilities.
Definition: Configurator.h:251
CfgBase::m_definedinconfig
bool m_definedinconfig
Definition: Configurator.h:84
CfgBase::m_key
std::string m_key
Definition: Configurator.h:81
CfgBase::m_rangetest
bool m_rangetest
Definition: Configurator.h:83
CFG_NONE
Definition: Configurator.h:59