Gromacs  2016.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::OptionsIterator Class Reference

#include <gromacs/options/optionsvisitor.h>

Description

Decorator class for visiting options in a Options object.

This class provides an interface for looping through subsections and options in a Options object.

Typical use (loop over all options, iteratively descending into subsections):

class Visitor : public gmx::OptionsVisitor
{
public:
void visitSubSection(const Options &section)
{
OptionsIterator iterator(section);
iterator.acceptSubSections(this);
iterator.acceptOptions(this);
}
void visitOption(const OptionInfo &option)
{
// Do something.
}
}
Visitor().visitSubSection(options);
*

Public Member Functions

 OptionsIterator (const Options &options)
 Creates an object for visiting options in a Options object.
 
void acceptSubSections (OptionsVisitor *visitor) const
 Visits each subsection in the wrapped Options object.
 
void acceptOptions (OptionsVisitor *visitor) const
 Visits each option in the wrapped Options object.
 

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