Gromacs  2018.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::anonymous_namespace{pargs.cpp}::OptionsAdapter Class Reference

Description

Conversion helper between t_pargs/t_filenm and Options.

This class holds the necessary mapping between the old C structures and the new C++ options to allow copying values back after parsing for cases where the C++ options do not directly provide the type of value required for the C structures.

Public Member Functions

 OptionsAdapter (int argc, const char *const argv[])
 Initializes the adapter to convert from a specified command line. More...
 
void filenmToOptions (Options *options, t_filenm *fnm)
 Converts a t_filenm option into an Options option. More...
 
void pargsToOptions (Options *options, t_pargs *pa)
 Converts a t_pargs option into an Options option. More...
 
void copyValues (bool bReadNode)
 Copies values back from options to t_pargs/t_filenm.
 

Constructor & Destructor Documentation

gmx::anonymous_namespace{pargs.cpp}::OptionsAdapter::OptionsAdapter ( int  argc,
const char *const  argv[] 
)
inline

Initializes the adapter to convert from a specified command line.

The command line is required, because t_pargs wants to return strings by reference to the original command line. OptionsAdapter creates a copy of the argv array (but not the strings) to make this possible, even if the parser removes options it has recognized.

Member Function Documentation

void gmx::anonymous_namespace{pargs.cpp}::OptionsAdapter::filenmToOptions ( Options options,
t_filenm fnm 
)

Converts a t_filenm option into an Options option.

Parameters
optionsOptions object to add the new option to.
fnmt_filenm option to convert.
void gmx::anonymous_namespace{pargs.cpp}::OptionsAdapter::pargsToOptions ( Options options,
t_pargs pa 
)

Converts a t_pargs option into an Options option.

Parameters
optionsOptions object to add the new option to.
pat_pargs option to convert.

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