Goose Management Model ODdox  1.02
CfgInt Class Reference

Integer configurator entry class. More...

#include <configurator.h>

Public Member Functions

 CfgInt (const char *a_key, CfgSecureLevel a_level, int a_defval)
 
 CfgInt (const char *a_key, CfgSecureLevel a_level, int a_defval, int a_min, int a_max)
 
virtual CfgType gettype (void)
 
virtual void set (int a_newval)
 
int value (void)
 
- Public Member Functions inherited from CfgBase
 CfgBase (const char *a_key, CfgSecureLevel a_level)
 
const string getkey (void)
 
CfgSecureLevel getlevel (void)
 
virtual ~CfgBase (void)
 

Protected Attributes

int m_int
 
int m_max
 
int m_min
 
- Protected Attributes inherited from CfgBase
string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 

Detailed Description

Integer configurator entry class.

Definition at line 87 of file configurator.h.

Constructor & Destructor Documentation

◆ CfgInt() [1/2]

CfgInt::CfgInt ( const char *  a_key,
CfgSecureLevel  a_level,
int  a_defval 
)

Definition at line 94 of file configurator.cpp.

94  :CfgBase(a_key, a_level)
95 {
96  m_int = a_defval;
97 }

References m_int.

◆ CfgInt() [2/2]

CfgInt::CfgInt ( const char *  a_key,
CfgSecureLevel  a_level,
int  a_defval,
int  a_min,
int  a_max 
)

Constructor with max min checking enabled

Definition at line 99 of file configurator.cpp.

99  :CfgBase(a_key, a_level)
100 {
102  m_min = a_min;
103  m_max = a_max;
104  m_rangetest = true;
105  set(a_defval);
106 }

References m_max, m_min, CfgBase::m_rangetest, and set().

Member Function Documentation

◆ gettype()

virtual CfgType CfgInt::gettype ( void  )
inlinevirtual

Reimplemented from CfgBase.

Definition at line 100 of file configurator.h.

100 { return CFG_INT; }

References CFG_INT.

◆ set()

void CfgInt::set ( int  a_newval)
virtual

Definition at line 108 of file configurator.cpp.

108  {
109  if (m_rangetest) {
110  if ((a_newval<m_min) || (a_newval>m_max))
111  {
112  g_msg->Warn(WARN_FILE, "CfgInt::set Value out of range: ", a_newval);
113  g_msg->Warn(WARN_FILE, "CfgInt::set Max allowed: ", m_max);
114  g_msg->Warn(WARN_FILE, "CfgInt::set Min allowed: ", m_min);
115  }
116  }
117  m_int = a_newval;
118 }

References g_msg, m_int, m_max, m_min, CfgBase::m_rangetest, MapErrorMsg::Warn(), and WARN_FILE.

Referenced by CfgInt().

◆ value()

int CfgInt::value ( void  )
inline

Definition at line 98 of file configurator.h.

98 { return m_int; }

Referenced by Landscape::AddBeetleBanks(), Goose_Population_Manager::BangAtPoly(), Landscape::BeetleBankAdd(), Landscape::BeetleBankPossible(), Landscape::BorderAdd(), Landscape::BuildingDesignationCalc(), FarmManager::CreateFarms(), Pesticide::DiffusionMaskInit(), Pesticide::DiffusionMaskInitTest(), Hunter_Population_Manager::DistributeHunters(), Hunter_Population_Manager::DistributeHuntersByRules(), Orchard::DoDevelopment(), OrchardBand::DoDevelopment(), MownGrass::DoDevelopment(), Goose_Population_Manager::DoEmigration(), Goose_Population_Manager::DoFirst(), Goose_Population_Manager::DoImmigration(), Goose_Population_Manager::DoLast(), Configurator::DumpSymbols(), FarmManager::FarmManagement(), LE::GetGooseNos(), Goose_Population_Manager::GetImmigrationNumbers(), LE::GetQuarryNos(), FarmManager::GetSpilledGrain(), Landscape::GISASCII_Output(), Goose_Population_Manager::Goose_Population_Manager(), GooseHunter::GooseHunter(), GooseMemoryMap::GooseMemoryMap(), Farm::HandleEvents(), OptimisingFarm::HandleEvents(), Landscape::hb_GenerateHBPolys(), Landscape::hb_StripingDist(), Goose_Population_Manager::InHuntingSeason(), Hunter::Init(), Goose_Base::Init(), Farm::InitiateManagement(), Hunter::IsTodayAPreferredHuntDay(), Landscape::Landscape(), RasterMap::Manipulation1(), Pesticide::Pesticide(), Farm::ProductApplication_DateLimited(), Landscape::ReadPolys2(), Hunter_Population_Manager::RuleSet10Based(), Hunter_Population_Manager::SetHuntingSeason(), Goose_Base::st_ChooseForageLocation(), Goose_Base::st_Forage(), GooseHunter::st_OutHunting(), Goose_Population_Manager::TheAOROutputProbe(), Landscape::Tick(), UnsprayedFieldMargin::UnsprayedFieldMargin(), Landscape::UnsprayedMarginAdd(), Weather::Weather(), and Goose_Population_Manager::WriteConfig().

Member Data Documentation

◆ m_int

int CfgInt::m_int
protected

Definition at line 90 of file configurator.h.

Referenced by CfgInt(), and set().

◆ m_max

int CfgInt::m_max
protected

Definition at line 91 of file configurator.h.

Referenced by CfgInt(), and set().

◆ m_min

int CfgInt::m_min
protected

Definition at line 92 of file configurator.h.

Referenced by CfgInt(), and set().


The documentation for this class was generated from the following files:
CFG_INT
Definition: configurator.h:53
CfgInt::m_max
int m_max
Definition: configurator.h:91
CfgBase::CfgBase
CfgBase(const char *a_key, CfgSecureLevel a_level)
Definition: configurator.cpp:73
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
CfgInt::m_min
int m_min
Definition: configurator.h:92
CfgBase::m_rangetest
bool m_rangetest
Definition: configurator.h:73
WARN_FILE
Definition: maperrormsg.h:37
g_msg
MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
CfgInt::m_int
int m_int
Definition: configurator.h:90
CfgInt::set
virtual void set(int a_newval)
Definition: configurator.cpp:108