Gromacs
2024.3
|
#include <gromacs/selection/selectionoptionbehavior.h>
Options behavior to allow using SelectionOptions.
This behavior wraps SelectionOptionManager, as well as all calls to SelectionCollection up to and including selection compilation.
To use selections through SelectionOption options in a ICommandLineOptionsModule, you need to
The SelectionOptionBehavior provides the following functionalities to the module:
ndx
file, and loads it when necessary.The behavior needs to be added before any options are created.
Public Member Functions | |
SelectionOptionBehavior (SelectionCollection *selections, ITopologyProvider *topologyProvider) | |
Creates a behavior to use selections. More... | |
void | initOptions (IOptionsContainer *options) |
Add common options for controlling selections. More... | |
void | initBehavior (Options *options) override |
Called when the behavior is associated with an options object. More... | |
void | optionsFinishing (Options *) override |
Called when all option values have been assigned. More... | |
void | optionsFinished () override |
Called when all option values have been processed. More... | |
gmx::SelectionOptionBehavior::SelectionOptionBehavior | ( | SelectionCollection * | selections, |
ITopologyProvider * | topologyProvider | ||
) |
Creates a behavior to use selections.
[in,out] | selections | Selection collection to use. |
[in] | topologyProvider | Callback to load/provide topology information to selections when required. |
The methods in topologyProvider
are called after all options have been parsed and finished, so the caller can, e.g., load the topology from a file specified by a file option.
|
overridevirtual |
Called when the behavior is associated with an options object.
This method can, e.g., use Options::addManager() to associate managers with the options object.
Implements gmx::IOptionsBehavior.
void gmx::SelectionOptionBehavior::initOptions | ( | IOptionsContainer * | options | ) |
Add common options for controlling selections.
This method is separate from the constructor so that the caller can control the order of options better.
|
overridevirtual |
Called when all option values have been processed.
This is called after Options::finish() (and typically after higher-level optionsFinished() methods, such as that in ICommandLineOptionsModule). This can add behavior that performs tasks based on the option values provided.
Implements gmx::IOptionsBehavior.
|
inlineoverridevirtual |
Called when all option values have been assigned.
This is called just before Options::finish(), and can, e.g., do operations that still influence the option values.
Implements gmx::IOptionsBehavior.