feisty meow concerns codebase  2.140
configuration::bounded_int_configlet Class Reference

Stores an integer in a configuration repository with range checking. More...

#include <configlet.h>

Inheritance diagram for configuration::bounded_int_configlet:
Collaboration diagram for configuration::bounded_int_configlet:

Public Member Functions

 bounded_int_configlet (const basis::astring &section, const basis::astring &entry, int current_value, int default_value, int minimum, int maximum)
 
virtual ~bounded_int_configlet ()
 
virtual void current_value (int new_current)
 the modifier function is virtual so derived classes can extend. More...
 
int minimum () const
 
int maximum () const
 
void minimum (int new_min)
 
void maximum (int new_max)
 
configletduplicate () const
 a virtual copy constructor for configlets. More...
 
- Public Member Functions inherited from configuration::int_configlet
 int_configlet (const basis::astring &section, const basis::astring &entry, int current_value=0, int default_value=0)
 
virtual ~int_configlet ()
 
int current_value () const
 
int default_value () const
 
void default_value (int new_default)
 
virtual bool load (configurator &config)
 retrieves the configlet's information from the "config". More...
 
virtual bool store (configurator &config) const
 writes the configlet's information out to the "config". More...
 
- Public Member Functions inherited from configuration::configlet
 configlet (const basis::astring &section, const basis::astring &entry)
 creates a configlet that lives in the "section" at the "entry". More...
 
 configlet (const configlet &to_copy)
 
virtual ~configlet ()
 
 DEFINE_CLASS_NAME ("configlet")
 
configletoperator= (const configlet &to_copy)
 
const basis::astringsection () const
 observes the section of this configlet. More...
 
const basis::astringentry () const
 observes the entry name of this configlet. More...
 
void section (const basis::astring &new_section) const
 modifies the configlet section location. More...
 
void entry (const basis::astring &new_entry) const
 modifies the configlet entry name. More...
 

Detailed Description

Stores an integer in a configuration repository with range checking.

a bounded_int_configlet has current and default values but also specifies a valid range for the current value. if the current value falls outside of that range (even via a "set" operation), then the default value is used for the current.

Definition at line 150 of file configlet.h.

Constructor & Destructor Documentation

◆ bounded_int_configlet()

configuration::bounded_int_configlet::bounded_int_configlet ( const basis::astring section,
const basis::astring entry,
int  current_value,
int  default_value,
int  minimum,
int  maximum 
)

Definition at line 153 of file configlet.cpp.

Referenced by duplicate().

◆ ~bounded_int_configlet()

configuration::bounded_int_configlet::~bounded_int_configlet ( )
virtual

Definition at line 162 of file configlet.cpp.

Member Function Documentation

◆ current_value()

void configuration::bounded_int_configlet::current_value ( int  new_current)
virtual

the modifier function is virtual so derived classes can extend.

Reimplemented from configuration::int_configlet.

Definition at line 164 of file configlet.cpp.

References configuration::int_configlet::current_value(), and configuration::int_configlet::default_value().

◆ duplicate()

configlet * configuration::bounded_int_configlet::duplicate ( ) const
virtual

a virtual copy constructor for configlets.

the returned object will be a new copy of this configlet.

Reimplemented from configuration::int_configlet.

Definition at line 173 of file configlet.cpp.

References bounded_int_configlet().

◆ maximum() [1/2]

int configuration::bounded_int_configlet::maximum ( ) const
inline

Definition at line 160 of file configlet.h.

◆ maximum() [2/2]

void configuration::bounded_int_configlet::maximum ( int  new_max)
inline

Definition at line 163 of file configlet.h.

◆ minimum() [1/2]

int configuration::bounded_int_configlet::minimum ( ) const
inline

Definition at line 159 of file configlet.h.

◆ minimum() [2/2]

void configuration::bounded_int_configlet::minimum ( int  new_min)
inline

Definition at line 162 of file configlet.h.


The documentation for this class was generated from the following files: