Fawkes API  Fawkes Development Version
fawkes::Configuration::ValueIterator Class Reference

Iterator interface to iterate over config values. More...

#include <>>

Inheritance diagram for fawkes::Configuration::ValueIterator:

List of all members.

Public Member Functions

virtual ~ValueIterator ()
 Virtual emptry destructor.
virtual bool next ()=0
 Check if there is another element and advance to this if possible.
virtual bool valid ()=0
 Check if the current element is valid.
virtual const char * path ()=0
 Path of value.
virtual const char * type ()=0
 Type of value.
virtual bool is_float ()=0
 Check if current value is a float.
virtual bool is_uint ()=0
 Check if current value is a unsigned int.
virtual bool is_int ()=0
 Check if current value is a int.
virtual bool is_bool ()=0
 Check if current value is a bool.
virtual bool is_string ()=0
 Check if current value is a string.
virtual float get_float ()=0
 Get float value.
virtual unsigned int get_uint ()=0
 Get unsigned int value.
virtual int get_int ()=0
 Get int value.
virtual bool get_bool ()=0
 Get bool value.
virtual std::string get_string ()=0
 Get string value.
virtual std::string get_comment ()=0
 Get comment of value.
virtual bool is_default ()=0
 Check if current value was read from the default config.

Detailed Description

Iterator interface to iterate over config values.

This does not implement a classic iterator interface with begin and end nodes but rather mimics a more Java-like interface where you iterate over the entries in a while loop until you covered all entries (much like a queue). If you implement this for your own configuration system you should not make the constructor publically accessible.


Constructor & Destructor Documentation

fawkes::Configuration::ValueIterator::~ValueIterator ( ) [inline, virtual]

Virtual emptry destructor.

Definition at line 70 of file config.h.


Member Function Documentation

bool fawkes::Configuration::ValueIterator::get_bool ( ) [pure virtual]
std::string fawkes::Configuration::ValueIterator::get_comment ( ) [pure virtual]
float fawkes::Configuration::ValueIterator::get_float ( ) [pure virtual]
int fawkes::Configuration::ValueIterator::get_int ( ) [pure virtual]
unsigned int fawkes::Configuration::ValueIterator::get_uint ( ) [pure virtual]
bool fawkes::Configuration::ValueIterator::is_bool ( ) [pure virtual]
bool fawkes::Configuration::ValueIterator::is_default ( ) [pure virtual]

Check if current value was read from the default config.

Returns:
true, if value was read from the default config, false otherwise

Implemented in fawkes::NetworkConfiguration::NetConfValueIterator, and fawkes::SQLiteConfiguration::SQLiteValueIterator.

Referenced by fawkes::ConfigListContent::append(), and fawkes::NetworkConfiguration::is_default().

bool fawkes::Configuration::ValueIterator::is_float ( ) [pure virtual]
bool fawkes::Configuration::ValueIterator::is_int ( ) [pure virtual]
bool fawkes::Configuration::ValueIterator::is_string ( ) [pure virtual]
bool fawkes::Configuration::ValueIterator::is_uint ( ) [pure virtual]

Check if current value is a unsigned int.

Returns:
true, if value is a unsigned int, false otherwise

Implemented in fawkes::NetworkConfiguration::NetConfValueIterator, and fawkes::SQLiteConfiguration::SQLiteValueIterator.

Referenced by fawkes::ConfigListContent::append(), fawkes::NetworkConfiguration::copy(), and fawkes::SQLiteConfiguration::copy().

const char * fawkes::Configuration::ValueIterator::type ( ) [pure virtual]
bool fawkes::Configuration::ValueIterator::valid ( ) [pure virtual]

Check if the current element is valid.

This is much like the classic end element for iterators. If the iterator is invalid there all subsequent calls to next() shall fail.

Returns:
true, if the iterator is still valid, false otherwise

Implemented in fawkes::NetworkConfiguration::NetConfValueIterator, and fawkes::SQLiteConfiguration::SQLiteValueIterator.

Referenced by fawkes::NetworkConfiguration::exists().


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