Gromacs  2020.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 sections and options in a Options object.

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

class Visitor : public gmx::OptionsVisitor
{
public:
virtual void visitSection(const OptionSectionInfo &section)
{
OptionsIterator iterator(section);
iterator.acceptSections(this);
iterator.acceptOptions(this);
}
virtual void visitOption(const OptionInfo &option)
{
// Do something.
}
}
Visitor().visitSection(options.rootSection());
*

Public Member Functions

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

Constructor & Destructor Documentation

gmx::OptionsIterator::OptionsIterator ( const Options options)
explicit

Creates an object for visiting options in a Options object.

The created iterator iterates over the "root" section in the Options object.


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