Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fawkes::Configuration::ValueIterator Class Reference

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

#include <>>

Inheritance diagram for fawkes::Configuration::ValueIterator:

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 () const =0
 Check if the current element is valid.
virtual const char * path () const =0
 Path of value.
virtual const char * type () const =0
 Type of value.
virtual bool is_float () const =0
 Check if current value is a float.
virtual bool is_uint () const =0
 Check if current value is a unsigned int.
virtual bool is_int () const =0
 Check if current value is a int.
virtual bool is_bool () const =0
 Check if current value is a bool.
virtual bool is_string () const =0
 Check if current value is a string.
virtual float get_float () const =0
 Get float value.
virtual unsigned int get_uint () const =0
 Get unsigned int value.
virtual int get_int () const =0
 Get int value.
virtual bool get_bool () const =0
 Get bool value.
virtual std::string get_string () const =0
 Get string value.
virtual std::string get_as_string () const =0
 Get value as string.
virtual std::string get_comment () const =0
 Get comment of value.
virtual bool is_default () const =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.

Definition at line 68 of file config.h.

Constructor & Destructor Documentation

fawkes::Configuration::ValueIterator::~ValueIterator ( )
inlinevirtual

Virtual emptry destructor.

Definition at line 71 of file config.h.

Member Function Documentation

std::string fawkes::Configuration::ValueIterator::get_as_string ( ) const
pure virtual
std::string fawkes::Configuration::ValueIterator::get_comment ( ) const
pure virtual
bool fawkes::Configuration::ValueIterator::is_bool ( ) const
pure virtual
bool fawkes::Configuration::ValueIterator::is_default ( ) const
pure virtual
bool fawkes::Configuration::ValueIterator::is_float ( ) const
pure virtual
bool fawkes::Configuration::ValueIterator::is_int ( ) const
pure virtual
bool fawkes::Configuration::ValueIterator::is_uint ( ) const
pure virtual
const char * fawkes::Configuration::ValueIterator::type ( ) const
pure virtual
bool fawkes::Configuration::ValueIterator::valid ( ) const
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: