Gromacs
2019.3
|
#include <gromacs/options/options-impl.h>
Internal implementation class for storing an option section.
All options are stored within a section: the top-level contents of an Options object are handled within an unnamed, "root" section. This class handles the common functionality for all sections, related to storing the options and subsections. Functionality specific to a section type is provided by IOptionSectionStorage.
Classes | |
class | Group |
Describes a group of options (see Options::addGroup()). More... | |
Public Types | |
typedef std::unique_ptr < AbstractOptionStorage > | AbstractOptionStoragePointer |
Smart pointer for managing an AbstractOptionStorage object. | |
typedef std::map< std::string, AbstractOptionStoragePointer > | OptionMap |
Convenience typedef for a map that contains all the options. | |
typedef std::unique_ptr < OptionSectionImpl > | SectionPointer |
Smart pointer for managing subsections. | |
typedef std::vector < SectionPointer > | SectionList |
Convenience typedef for a container for subsections. | |
Public Member Functions | |
OptionSectionImpl (const OptionManagerContainer &managers, std::unique_ptr< IOptionSectionStorage > storage, const char *name) | |
Creates storage for a new section. | |
OptionSectionImpl * | addSectionImpl (const AbstractOptionSection §ion) override |
Adds a section to this container. More... | |
IOptionsContainer & | addGroup () override |
Creates a subgroup of options within the current options. More... | |
OptionInfo * | addOptionImpl (const AbstractOption &settings) override |
Adds a recognized option. More... | |
OptionSectionInfo & | info () |
Returns section info object for this section. | |
const OptionSectionInfo & | info () const |
Returns section info object for this section. | |
OptionSectionImpl * | findSection (const char *name) const |
Finds a subsection by name. More... | |
AbstractOptionStorage * | findOption (const char *name) const |
Finds an option by name. More... | |
void | start () |
Called when entering the section. More... | |
void | finish () |
Calls AbstractOptionStorage::finish() for all options. | |
Public Member Functions inherited from gmx::IOptionsContainerWithSections | |
template<class SectionType > | |
SectionType::HandleType | addSection (const SectionType §ion) |
Adds a section to this collection. More... | |
Public Member Functions inherited from gmx::IOptionsContainer | |
template<class OptionType > | |
OptionType::InfoType * | addOption (const OptionType &settings) |
Adds a recognized option. More... | |
Public Attributes | |
const OptionManagerContainer & | managers_ |
Reference to the option managers in the parent Options object. | |
std::unique_ptr < IOptionSectionStorage > | storage_ |
Type-specific storage object for this section. | |
OptionSectionInfo | info_ |
Info object for this section. | |
std::string | name_ |
Name of this section (empty and unused for the root section). | |
Group | rootGroup_ |
Group that contains all options (and subgroups). More... | |
OptionMap | optionMap_ |
Map from option names to options; owns the option storage objects. | |
SectionList | subsections_ |
List of subsections, in insertion order. | |
bool | storageInitialized_ |
Whether initStorage() has been called for storage_ . | |
Additional Inherited Members |
|
overridevirtual |
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.
Implements gmx::IOptionsContainer.
|
overridevirtual |
Adds a recognized option.
[in] | settings | Option description. |
APIError | if invalid option settings are provided. |
This method provides the internal implementation, but the templated method is called from user code. See the templated method for more details.
Implements gmx::IOptionsContainer.
|
overridevirtual |
Adds a section to this container.
[in] | section | Section description. |
Implements gmx::IOptionsContainerWithSections.
AbstractOptionStorage * gmx::internal::OptionSectionImpl::findOption | ( | const char * | name | ) | const |
Finds an option by name.
[in] | name | Name to search for. |
Does not throw.
OptionSectionImpl * gmx::internal::OptionSectionImpl::findSection | ( | const char * | name | ) | const |
Finds a subsection by name.
[in] | name | Name to search for. |
Does not throw.
void gmx::internal::OptionSectionImpl::start | ( | ) |
Called when entering the section.
Calls AbstractOptionStorage::startSource() for all options.
Group gmx::internal::OptionSectionImpl::rootGroup_ |
Group that contains all options (and subgroups).
This is used to store the insertion order of options.