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

#include <gromacs/selection/selectionoptionbehavior.h>

+ Inheritance diagram for gmx::SelectionOptionBehavior:
+ Collaboration diagram for gmx::SelectionOptionBehavior:

Description

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:

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...
 

Constructor & Destructor Documentation

gmx::SelectionOptionBehavior::SelectionOptionBehavior ( SelectionCollection selections,
ITopologyProvider topologyProvider 
)

Creates a behavior to use selections.

Parameters
[in,out]selectionsSelection collection to use.
[in]topologyProviderCallback 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.

Member Function Documentation

void gmx::SelectionOptionBehavior::initBehavior ( Options options)
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.

void gmx::SelectionOptionBehavior::optionsFinished ( )
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.

void gmx::SelectionOptionBehavior::optionsFinishing ( Options options)
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.


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