configuration::configlet Class Reference

Represents an atom of configuration info. More...

#include <configlet.h>

Inheritance diagram for configuration::configlet:
Inheritance graph
[legend]
Collaboration diagram for configuration::configlet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 configlet (const basis::astring &section, const basis::astring &entry)
 creates a configlet that lives in the "section" at the "entry".
 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.
const basis::astringentry () const
 observes the entry name of this configlet.
void section (const basis::astring &new_section) const
 modifies the configlet section location.
void entry (const basis::astring &new_entry) const
 modifies the configlet entry name.
virtual bool load (configurator &config)=0
 retrieves the configlet's information from the "config".
virtual bool store (configurator &config) const =0
 writes the configlet's information out to the "config".
virtual configletduplicate () const =0
 a virtual copy constructor for configlets.

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

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.

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

Definition at line 34 of file configlet.cpp.

configuration::configlet::~configlet (  )  [virtual]

Definition at line 39 of file configlet.cpp.

References basis::WHACK().


Member Function Documentation

configuration::configlet::DEFINE_CLASS_NAME ( "configlet"   ) 
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::string_configlet, configuration::int_configlet, and configuration::bounded_int_configlet.

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

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

modifies the configlet entry name.

Definition at line 60 of file configlet.cpp.

const astring & configuration::configlet::entry (  )  const
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::string_configlet, and configuration::int_configlet.

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

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

Definition at line 45 of file configlet.cpp.

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

modifies the configlet section location.

Definition at line 57 of file configlet.cpp.

const astring & configuration::configlet::section (  )  const
virtual bool configuration::configlet::store ( configurator config  )  const [pure virtual]

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

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

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


The documentation for this class was generated from the following files:
Generated on Sat Jan 28 04:25:26 2012 for hoople2 project by  doxygen 1.6.3