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