feisty meow concerns codebase  2.140
configuration::configlet Class Referenceabstract

Represents an atom of configuration info. More...

#include <configlet.h>

Inheritance diagram for configuration::configlet:
Collaboration diagram for configuration::configlet:

Public Member Functions

 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...
 
virtual bool load (configurator &config)=0
 retrieves the configlet's information from the "config". More...
 
virtual bool store (configurator &config) const =0
 writes the configlet's information out to the "config". More...
 
virtual configletduplicate () const =0
 a virtual copy constructor for configlets. More...
 

Detailed Description

Represents an atom of configuration info.

The configlet has a location in a configuration repository that is defined by its section and key name. Derived types can also have a value that is stored in that location.

Definition at line 32 of file configlet.h.

Constructor & Destructor Documentation

◆ configlet() [1/2]

configuration::configlet::configlet ( const basis::astring section,
const basis::astring entry 
)

creates a configlet that lives in the "section" at the "entry".

Definition at line 29 of file configlet.cpp.

◆ configlet() [2/2]

configuration::configlet::configlet ( const configlet to_copy)

Definition at line 34 of file configlet.cpp.

◆ ~configlet()

configuration::configlet::~configlet ( )
virtual

Definition at line 39 of file configlet.cpp.

References basis::WHACK().

Member Function Documentation

◆ DEFINE_CLASS_NAME()

configuration::configlet::DEFINE_CLASS_NAME ( "configlet"  )

◆ duplicate()

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

a virtual copy constructor for configlets.

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

Implemented in configuration::bounded_int_configlet, configuration::int_configlet, and configuration::string_configlet.

Referenced by configuration::configuration_list::add().

◆ entry() [1/2]

◆ entry() [2/2]

void configuration::configlet::entry ( const basis::astring new_entry) const

modifies the configlet entry name.

Definition at line 60 of file configlet.cpp.

◆ load()

virtual bool configuration::configlet::load ( configurator config)
pure virtual

retrieves the configlet's information from the "config".

true is returned when this is successful. note that false is returned if the entry was not originally present; if the configurator has the AUTO_STORE behavior, then we will write out the default value on failure. the next load() would be a success in that case, but would return the default.

Implemented in configuration::int_configlet, and configuration::string_configlet.

Referenced by configuration::configuration_list::load().

◆ operator=()

configlet & configuration::configlet::operator= ( const configlet to_copy)

Definition at line 45 of file configlet.cpp.

◆ section() [1/2]

◆ section() [2/2]

void configuration::configlet::section ( const basis::astring new_section) const

modifies the configlet section location.

Definition at line 57 of file configlet.cpp.

◆ store()

virtual bool configuration::configlet::store ( configurator config) const
pure virtual

writes the configlet's information out to the "config".

Implemented in configuration::int_configlet, and configuration::string_configlet.

Referenced by configuration::configuration_list::store().


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