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

Constructor & Destructor Documentation

◆ ~ValueIterator()

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

Virtual emptry destructor.

Definition at line 75 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::NetworkConfiguration::NetConfValueIterator, and fawkes::SQLiteConfiguration::SQLiteValueIterator.

Referenced by fawkes::ConfigListContent::append(), and fawkes::ConfigNetworkHandler::~ConfigNetworkHandler().

◆ get_string()

◆ get_strings()

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

◆ get_uint()

◆ get_uints()

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

◆ is_bool()

◆ is_default()

◆ is_float()

◆ is_int()

◆ is_list()

◆ is_string()

◆ is_uint()

◆ next()

bool fawkes::Configuration::ValueIterator::next ( )
pure 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

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

Referenced by BlackBoardLoggerPlugin::BlackBoardLoggerPlugin(), BlackBoardLogReplayPlugin::BlackBoardLogReplayPlugin(), BlackBoardSynchronizationPlugin::BlackBoardSynchronizationPlugin(), MongoDBThread::ClientConf::ClientConf(), ConfigCLIPSFeature::clips_context_destroyed(), fawkes::SQLiteConfiguration::copy(), fawkes::NetworkConfiguration::copy(), MongoDBThread::delete_client(), DynamixelPlugin::DynamixelPlugin(), StaticTransformsThread::finalize(), FvRetrieverPlugin::FvRetrieverPlugin(), IMUPlugin::IMUPlugin(), ProcRRDThread::init(), MongoRRDThread::init(), WebviewPtzCamThread::init(), MongoDBThread::init(), LaserFilterThread::init(), PlayerClientThread::init(), fawkes::PluginManager::init_pinfo_cache(), LaserClusterPlugin::LaserClusterPlugin(), LaserDeadSpotsDataFilter::LaserDeadSpotsDataFilter(), LaserFilterPlugin::LaserFilterPlugin(), LaserPlugin::LaserPlugin(), BlackBoardSynchronizationThread::loop(), fawkes::ConfigNetworkHandler::loop(), fawkes::Configuration::notify_handlers(), LaserDeadSpotCalibrator::num_detected_spots(), PanTiltPlugin::PanTiltPlugin(), ConfigChangeWatcherTool::run(), LaserFilterThread::wait_done(), and fawkes::LuaInterfaceImporter::~LuaInterfaceImporter().

◆ path()

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

Path of value.

Returns
path of value

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

Referenced by fawkes::ConfigListContent::append(), BlackBoardLoggerPlugin::BlackBoardLoggerPlugin(), BlackBoardLogReplayPlugin::BlackBoardLogReplayPlugin(), BlackBoardSynchronizationPlugin::BlackBoardSynchronizationPlugin(), ConfigCLIPSFeature::clips_context_destroyed(), ConfigChangeWatcherTool::config_comment_changed(), fawkes::ConfigNetworkHandler::config_value_changed(), ConfigChangeWatcherTool::config_value_changed(), fawkes::PluginManager::config_value_changed(), fawkes::SQLiteConfiguration::copy(), fawkes::NetworkConfiguration::copy(), MongoDBThread::delete_client(), DynamixelPlugin::DynamixelPlugin(), StaticTransformsThread::finalize(), FvRetrieverPlugin::FvRetrieverPlugin(), IMUPlugin::IMUPlugin(), ProcRRDThread::init(), MongoRRDThread::init(), WebviewPtzCamThread::init(), MongoDBThread::init(), LaserFilterThread::init(), PlayerClientThread::init(), fawkes::PluginManager::init_pinfo_cache(), LaserClusterPlugin::LaserClusterPlugin(), LaserDeadSpotsDataFilter::LaserDeadSpotsDataFilter(), LaserFilterPlugin::LaserFilterPlugin(), LaserPlugin::LaserPlugin(), ProcRRDThread::loop(), MongoRRDThread::loop(), BlackBoardSynchronizationThread::loop(), LaserDeadSpotCalibrator::num_detected_spots(), PanTiltPlugin::PanTiltPlugin(), ConfigChangeWatcherTool::run(), LaserFilterThread::wait_done(), fawkes::ConfigNetworkHandler::~ConfigNetworkHandler(), and fawkes::LuaInterfaceImporter::~LuaInterfaceImporter().

◆ type()

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

Referenced by fawkes::NetworkConfiguration::exists(), and ConfigChangeWatcherTool::run().


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