Gromacs
2019
|
Declares functions for initializing the GROMACS library for command line use.
Functions | |
CommandLineProgramContext & | gmx::initForCommandLine (int *argc, char ***argv) |
Initializes the GROMACS library for command-line use. More... | |
void | gmx::finalizeForCommandLine () |
Deinitializes the GROMACS library after initForCommandLine(). More... | |
int | gmx::processExceptionAtExitForCommandLine (const std::exception &ex) |
Handles an exception and deinitializes after initForCommandLine. More... | |
int | gmx::runCommandLineModule (int argc, char *argv[], ICommandLineModule *module) |
Implements a main() method that runs a single module. More... | |
int | gmx::runCommandLineModule (int argc, char *argv[], const char *name, const char *description, std::function< std::unique_ptr< ICommandLineOptionsModule >()> factory) |
Implements a main() method that runs a single module. More... | |
int | gmx_run_cmain (int argc, char *argv[], int(*mainFunction)(int, char *[])) |
Implements a main() method that runs a given C main function. More... | |
int gmx_run_cmain | ( | int | argc, |
char * | argv[], | ||
int(*)(int, char *[]) | mainFunction | ||
) |
Implements a main() method that runs a given C main function.
argc | argc passed to main(). |
argv | argv passed to main(). |
mainFunction | The main()-like method to wrap. |
This method creates a dummy command line module that does its processing by calling mainFunction
. It then runs this module as with gmx::runCommandLineModule(). This allows the resulting executable to handle common options and do other common actions (e.g., startup headers) without duplicate code in the main methods.
mainFunction
should call parse_common_args() to process its command-line arguments.
Usage:
Does not throw. All exceptions are caught and handled internally.