Public Member Functions | Private Member Functions | Private Attributes | Friends
rviz::Config::MapIterator Class Reference

Iterator class for looping over all entries in a Map type Config Node. More...

#include <config.h>

List of all members.

Public Member Functions

void advance ()
 Advance iterator to next entry.
Config currentChild ()
 Return a Config reference to the current map entry.
QString currentKey ()
 Return the name of the current map entry.
bool isValid ()
 Return true if the iterator currently points to a valid entry, false if not.
void start ()
 Resets the iterator to the start of the map.

Private Member Functions

 MapIterator ()
 Private constructor enforces that MapIterators are only made by their friend the Config class.

Private Attributes

QMap< QString, Config::NodePtr >
::const_iterator 
iterator_
bool iterator_valid_
Config::NodePtr node_

Friends

class Config

Detailed Description

Iterator class for looping over all entries in a Map type Config Node.

Typical usage:

Config config; display->save( config ); // Write display's data into config. for( Config::MapIterator iter = config.mapIterator(); iter.isValid(); iter.advance() ) { QString key = iter.currentKey(); Config child = iter.currentChild(); printf( "key %s has value %s.\n", qPrintable( key ), qPrintable( child.getValue().toString() )); }

Maps are stored in alphabetical order of their keys, and MapIterator uses this same order.

Definition at line 280 of file config.h.


Constructor & Destructor Documentation

Private constructor enforces that MapIterators are only made by their friend the Config class.

Definition at line 363 of file config.cpp.


Member Function Documentation

Advance iterator to next entry.

Definition at line 367 of file config.cpp.

Return a Config reference to the current map entry.

Definition at line 423 of file config.cpp.

Return the name of the current map entry.

Definition at line 413 of file config.cpp.

Return true if the iterator currently points to a valid entry, false if not.

This is how you tell if your loop over entries is at the end.

Definition at line 385 of file config.cpp.

Resets the iterator to the start of the map.

Definition at line 402 of file config.cpp.


Friends And Related Function Documentation

friend class Config [friend]

Definition at line 308 of file config.h.


Member Data Documentation

QMap<QString, Config::NodePtr>::const_iterator rviz::Config::MapIterator::iterator_ [private]

Definition at line 306 of file config.h.

Definition at line 307 of file config.h.

Definition at line 305 of file config.h.


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


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Thu Jun 6 2019 18:02:16