Add basic grouping to Options
[alexxy/gromacs.git] / src / gromacs / options / options.h
index b312218a56bbb12a611cf03a8e6e7adc9676a737..67fcf257375cc7c86d986f408999047d0b32de6b 100644 (file)
@@ -58,6 +58,11 @@ class AbstractOption;
 class OptionsAssigner;
 class OptionsIterator;
 
+namespace internal
+{
+class OptionsImpl;
+}
+
 /*! \brief
  * Base class for option managers.
  *
@@ -153,6 +158,19 @@ class Options : public IOptionsContainer
          */
         void addSubSection(Options *section);
 
+        /*! \brief
+         * Creates a subgroup of options within the current options.
+         *
+         * To add options to the group, use the returned interface.
+         *
+         * Currently, this is only used to influence the order of options:
+         * all options in a group appear before options in a group added after
+         * it, no matter in which order the options are added to the groups.
+         * In the future, the groups could also be used to influence the help
+         * output.
+         */
+        IOptionsContainer &addGroup();
+
         // From IOptionsContainer
         virtual OptionInfo *addOption(const AbstractOption &settings);
         using IOptionsContainer::addOption;
@@ -176,10 +194,10 @@ class Options : public IOptionsContainer
         void finish();
 
     private:
-        class Impl;
-
-        PrivateImplPointer<Impl> impl_;
+        PrivateImplPointer<internal::OptionsImpl> impl_;
 
+        //! Needed for the implementation to access subsections.
+        friend class internal::OptionsImpl;
         //! Needed to be able to extend the interface of this object.
         friend class OptionsAssigner;
         //! Needed to be able to extend the interface of this object.