Fawkes API Fawkes Development Version
fawkes::YamlConfiguration::YamlValueIterator Class Reference

Iterator for YAML config trees. More...

#include <>>

Inheritance diagram for fawkes::YamlConfiguration::YamlValueIterator:

Public Member Functions

 YamlValueIterator ()
 Constructor. More...
 
 YamlValueIterator (std::map< std::string, std::shared_ptr< YamlConfigurationNode > > &nodes)
 Initializing constructor. More...
 
virtual bool next ()
 Check if there is another element and advance to this if possible. More...
 
virtual bool valid () const
 Check if the current element is valid. More...
 
virtual const char * path () const
 Path of value. More...
 
virtual const char * type () const
 Type of value. More...
 
virtual bool is_float () const
 Check if current value is a float. More...
 
virtual bool is_uint () const
 Check if current value is a unsigned int. More...
 
virtual bool is_int () const
 Check if current value is a int. More...
 
virtual bool is_bool () const
 Check if current value is a bool. More...
 
virtual bool is_string () const
 Check if current value is a string. More...
 
virtual bool is_list () const
 Check if a value is a list. More...
 
virtual size_t get_list_size () const
 Get number of elements in list value. More...
 
virtual float get_float () const
 Get float value. More...
 
virtual unsigned int get_uint () const
 Get unsigned int value. More...
 
virtual int get_int () const
 Get int value. More...
 
virtual bool get_bool () const
 Get bool value. More...
 
virtual std::string get_string () const
 Get string value. More...
 
virtual std::vector< float > get_floats () const
 Get list of values from configuration which is of type float. More...
 
virtual std::vector< unsigned int > get_uints () const
 Get list of values from configuration which is of type unsigned int. More...
 
virtual std::vector< int > get_ints () const
 Get list of values from configuration which is of type int. More...
 
virtual std::vector< bool > get_bools () const
 Get list of values from configuration which is of type bool. More...
 
virtual std::vector< std::string > get_strings () const
 Get list of values from configuration which is of type string. More...
 
virtual std::string get_as_string () const
 Get value as string. More...
 
virtual std::string get_comment () const
 Get comment of value. More...
 
virtual bool is_default () const
 Check if current value was read from the default config. More...
 
- Public Member Functions inherited from fawkes::Configuration::ValueIterator
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 for YAML config trees.

This iterator is used by YamlConfiguration as a result value for queries. Its use is opaque and knowledge of Configuration::ValueIterator will suffice for interaction.

Author
Tim Niemueller

Definition at line 118 of file yaml.h.

Constructor & Destructor Documentation

◆ YamlValueIterator() [1/2]

fawkes::YamlConfiguration::YamlValueIterator::YamlValueIterator ( )

Constructor.

Creates an iterator representing the invalid iterator.

Definition at line 63 of file yaml.cpp.

◆ YamlValueIterator() [2/2]

fawkes::YamlConfiguration::YamlValueIterator::YamlValueIterator ( std::map< std::string, std::shared_ptr< YamlConfigurationNode > > &  nodes)

Initializing constructor.

Parameters
nodesnodes to iterate over

Definition at line 71 of file yaml.cpp.

◆ ~YamlValueIterator()

virtual fawkes::YamlConfiguration::YamlValueIterator::~YamlValueIterator ( )
inlinevirtual

Definition at line 124 of file yaml.h.

Member Function Documentation

◆ get_as_string()

std::string fawkes::YamlConfiguration::YamlValueIterator::get_as_string ( ) const
virtual

Get value as string.

Returns
value as string

Implements fawkes::Configuration::ValueIterator.

Definition at line 225 of file yaml.cpp.

◆ get_bool()

bool fawkes::YamlConfiguration::YamlValueIterator::get_bool ( ) const
virtual

Get bool value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 207 of file yaml.cpp.

◆ get_bools()

std::vector< bool > fawkes::YamlConfiguration::YamlValueIterator::get_bools ( ) const
virtual

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

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 265 of file yaml.cpp.

◆ get_comment()

std::string fawkes::YamlConfiguration::YamlValueIterator::get_comment ( ) const
virtual

Get comment of value.

Returns
comment

Implements fawkes::Configuration::ValueIterator.

Definition at line 283 of file yaml.cpp.

◆ get_float()

float fawkes::YamlConfiguration::YamlValueIterator::get_float ( ) const
virtual

Get float value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 180 of file yaml.cpp.

◆ get_floats()

std::vector< float > fawkes::YamlConfiguration::YamlValueIterator::get_floats ( ) const
virtual

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

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 238 of file yaml.cpp.

◆ get_int()

int fawkes::YamlConfiguration::YamlValueIterator::get_int ( ) const
virtual

Get int value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 198 of file yaml.cpp.

◆ get_ints()

std::vector< int > fawkes::YamlConfiguration::YamlValueIterator::get_ints ( ) const
virtual

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

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 256 of file yaml.cpp.

◆ get_list_size()

size_t fawkes::YamlConfiguration::YamlValueIterator::get_list_size ( ) const
virtual

Get number of elements in list value.

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

Implements fawkes::Configuration::ValueIterator.

Definition at line 168 of file yaml.cpp.

◆ get_string()

std::string fawkes::YamlConfiguration::YamlValueIterator::get_string ( ) const
virtual

Get string value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 216 of file yaml.cpp.

◆ get_strings()

std::vector< std::string > fawkes::YamlConfiguration::YamlValueIterator::get_strings ( ) const
virtual

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

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 274 of file yaml.cpp.

◆ get_uint()

unsigned int fawkes::YamlConfiguration::YamlValueIterator::get_uint ( ) const
virtual

Get unsigned int value.

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 189 of file yaml.cpp.

◆ get_uints()

std::vector< unsigned int > fawkes::YamlConfiguration::YamlValueIterator::get_uints ( ) const
virtual

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

Returns
value

Implements fawkes::Configuration::ValueIterator.

Definition at line 247 of file yaml.cpp.

◆ is_bool()

bool fawkes::YamlConfiguration::YamlValueIterator::is_bool ( ) const
virtual

Check if current value is a bool.

Returns
true, if value is a bool, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 141 of file yaml.cpp.

◆ is_default()

bool fawkes::YamlConfiguration::YamlValueIterator::is_default ( ) const
virtual

Check if current value was read from the default config.

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

Implements fawkes::Configuration::ValueIterator.

Definition at line 289 of file yaml.cpp.

◆ is_float()

bool fawkes::YamlConfiguration::YamlValueIterator::is_float ( ) const
virtual

Check if current value is a float.

Returns
true, if value is a float, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 114 of file yaml.cpp.

◆ is_int()

bool fawkes::YamlConfiguration::YamlValueIterator::is_int ( ) const
virtual

Check if current value is a int.

Returns
true, if value is a int, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 132 of file yaml.cpp.

◆ is_list()

bool fawkes::YamlConfiguration::YamlValueIterator::is_list ( ) const
virtual

Check if a value is a list.

Returns
true if the value exists and is a list

Implements fawkes::Configuration::ValueIterator.

Definition at line 159 of file yaml.cpp.

◆ is_string()

bool fawkes::YamlConfiguration::YamlValueIterator::is_string ( ) const
virtual

Check if current value is a string.

Returns
true, if value is a string, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 150 of file yaml.cpp.

◆ is_uint()

bool fawkes::YamlConfiguration::YamlValueIterator::is_uint ( ) const
virtual

Check if current value is a unsigned int.

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

Implements fawkes::Configuration::ValueIterator.

Definition at line 123 of file yaml.cpp.

◆ next()

bool fawkes::YamlConfiguration::YamlValueIterator::next ( )
virtual

Check if there is another element and advance to this if possible.

This advances to the next element, if there is one.

Returns
true, if another element has been reached, false otherwise

Implements fawkes::Configuration::ValueIterator.

Definition at line 79 of file yaml.cpp.

◆ path()

const char * fawkes::YamlConfiguration::YamlValueIterator::path ( ) const
virtual

Path of value.

Returns
path of value

Implements fawkes::Configuration::ValueIterator.

Definition at line 96 of file yaml.cpp.

◆ type()

const char * fawkes::YamlConfiguration::YamlValueIterator::type ( ) const
virtual

Type of value.

Returns
string representation of value type.

Implements fawkes::Configuration::ValueIterator.

Definition at line 105 of file yaml.cpp.

◆ valid()

bool fawkes::YamlConfiguration::YamlValueIterator::valid ( ) const
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

Implements fawkes::Configuration::ValueIterator.

Definition at line 90 of file yaml.cpp.


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