ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
CfgStr Class Reference

String configurator entry class. More...

#include <Configurator.h>

Inheritance diagram for CfgStr:
CfgBase

Public Member Functions

 CfgStr (const std::string &a_key, CfgSecureLevel a_level, const std::string &a_defval)
 
 CfgStr (const std::string &a_key, CfgSecureLevel a_level, const std::string &a_defval, bool a_definconf)
 
char * value () const
 
void set (std::string a_newval)
 
virtual CfgType gettype (void)
 
- 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::string m_string
 
- Protected Attributes inherited from CfgBase
std::string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 
bool m_definedinconfig {false}
 

Detailed Description

String configurator entry class.

Constructor & Destructor Documentation

◆ CfgStr() [1/2]

CfgStr::CfgStr ( const std::string &  a_key,
CfgSecureLevel  a_level,
const std::string &  a_defval 
)
219  :CfgBase( a_key, a_level )
220 {
221  m_string = a_defval;
222  g_cfg->Register( this, a_key );
223 }

References g_cfg, and m_string.

◆ CfgStr() [2/2]

CfgStr::CfgStr ( const std::string &  a_key,
CfgSecureLevel  a_level,
const std::string &  a_defval,
bool  a_definconf 
)
227  :CfgBase{ a_key, a_level, a_definconf }
228 {
229  m_string = a_defval;
230 }

Member Function Documentation

◆ gettype()

virtual CfgType CfgStr::gettype ( void  )
inlinevirtual

Reimplemented from CfgBase.

184 { return CFG_STRING; }

References CFG_STRING.

◆ set()

void CfgStr::set ( std::string  a_newval)
inline
183 { m_string = std::move(a_newval); }

References m_string.

Referenced by CreatePopulationManager().

◆ value()

Member Data Documentation

◆ m_string

std::string CfgStr::m_string
protected

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


The documentation for this class was generated from the following files:
CfgStr::m_string
std::string m_string
Definition: Configurator.h:176
g_cfg
std::shared_ptr< Configurator > g_cfg
Definition: Configurator.cpp:56
CFG_STRING
Definition: Configurator.h:63
CfgBase::CfgBase
CfgBase(const std::string &a_key, CfgSecureLevel a_level)
Definition: Configurator.cpp:84
CfgBase
Base class for a configurator entry.
Definition: Configurator.h:79