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

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

#include <>>

Inheritance diagram for fawkes::Configuration::ValueIterator:

Public Member Functions

virtual ~ValueIterator ()
 Virtual emptry destructor. More...
 
virtual bool next ()=0
 Check if there is another element and advance to this if possible. More...
 
virtual bool valid () const =0
 Check if the current element is valid. More...
 
virtual const char * path () const =0
 Path of value. More...
 
virtual const char * type () const =0
 Type of value. More...
 
virtual bool is_float () const =0
 Check if current value is a float. More...
 
virtual bool is_uint () const =0
 Check if current value is a unsigned int. More...
 
virtual bool is_int () const =0
 Check if current value is a int. More...
 
virtual bool is_bool () const =0
 Check if current value is a bool. More...
 
virtual bool is_string () const =0
 Check if current value is a string. More...
 
virtual bool is_list () const =0
 Check if a value is a list. More...
 
virtual size_t get_list_size () const =0
 Get number of elements in list value. More...
 
virtual float get_float () const =0
 Get float value. More...
 
virtual unsigned int get_uint () const =0
 Get unsigned int value. More...
 
virtual int get_int () const =0
 Get int value. More...
 
virtual bool get_bool () const =0
 Get bool value. More...
 
virtual std::string get_string () const =0
 Get string value. More...
 
virtual std::vector< float > get_floats () const =0
 Get list of values from configuration which is of type float. More...
 
virtual std::vector< unsigned int > get_uints () const =0
 Get list of values from configuration which is of type unsigned int. More...
 
virtual std::vector< int > get_ints () const =0
 Get list of values from configuration which is of type int. More...
 
virtual std::vector< bool > get_bools () const =0
 Get list of values from configuration which is of type bool. More...
 
virtual std::vector< std::string > get_strings () const =0
 Get list of values from configuration which is of type string. More...
 
virtual std::string get_as_string () const =0
 Get value as string. More...
 
virtual std::string get_comment () const =0
 Get comment of value. More...
 
virtual bool is_default () const =0
 Check if current value was read from the default config. More...
 

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 71 of file config.h.

Constructor & Destructor Documentation

◆ ~ValueIterator()

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

Virtual emptry destructor.

Definition at line 74 of file config.h.

Member Function Documentation

◆ get_as_string()

std::string fawkes::Configuration::ValueIterator::get_as_string ( ) const
pure virtual

◆ get_bool()

◆ get_bools()

std::vector< bool > fawkes::Configuration::ValueIterator::get_bools ( ) const
pure virtual

◆ get_comment()

std::string fawkes::Configuration::ValueIterator::get_comment ( ) const
pure virtual

◆ get_float()

◆ get_floats()

std::vector< float > fawkes::Configuration::ValueIterator::get_floats ( ) const
pure virtual

◆ get_int()

◆ get_ints()

std::vector< int > fawkes::Configuration::ValueIterator::get_ints ( ) const
pure virtual

◆ get_list_size()

size_t fawkes::Configuration::ValueIterator::get_list_size ( ) const
pure virtual

Get number of elements in list value.

Returns
number of elements in list value
Exceptions
Exceptionthrown if the element is not a list.

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

Referenced by fawkes::ConfigListContent::append().

◆ get_string()

◆ get_strings()

std::vector< std::string > fawkes::Configuration::ValueIterator::get_strings ( ) const
pure virtual

Get list of values from configuration which is of type string.

Returns
value

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

Referenced by fawkes::ConfigListContent::append().

◆ get_uint()

unsigned int fawkes::Configuration::ValueIterator::get_uint ( ) const
pure virtual

◆ get_uints()

std::vector< unsigned int > fawkes::Configuration::ValueIterator::get_uints ( ) const
pure virtual

Get list of values from configuration which is of type unsigned int.

Returns
value

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

Referenced by fawkes::ConfigListContent::append().

◆ is_bool()

bool fawkes::Configuration::ValueIterator::is_bool ( ) const
pure virtual

◆ is_default()

bool fawkes::Configuration::ValueIterator::is_default ( ) const
pure virtual

◆ is_float()

bool fawkes::Configuration::ValueIterator::is_float ( ) const
pure virtual

◆ is_int()

bool fawkes::Configuration::ValueIterator::is_int ( ) const
pure virtual

◆ is_list()

bool fawkes::Configuration::ValueIterator::is_list ( ) const
pure virtual

◆ is_string()

◆ is_uint()

bool fawkes::Configuration::ValueIterator::is_uint ( ) const
pure virtual

◆ next()

◆ path()

◆ type()

const char * fawkes::Configuration::ValueIterator::type ( ) const
pure virtual

◆ valid()

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::YamlConfiguration::YamlValueIterator, fawkes::SQLiteConfiguration::SQLiteValueIterator, and fawkes::NetworkConfiguration::NetConfValueIterator.

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


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