Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
gmx::CommandLineModuleManager::Impl Class Reference
+ Collaboration diagram for gmx::CommandLineModuleManager::Impl:

Description

Private implementation class for CommandLineModuleManager.

Public Member Functions

 Impl (const char *binaryName, CommandLineProgramContext *programContext)
 Initializes the implementation class. More...
 
void addModule (CommandLineModulePointer module)
 Helper method that adds a given module to the module manager. More...
 
void ensureHelpModuleExists ()
 Creates the help module if it does not yet exist. More...
 
CommandLineModuleMap::const_iterator findModuleByName (const std::string &name) const
 Finds a module that matches a name. More...
 
ICommandLineModuleprocessCommonOptions (CommandLineCommonOptionsHolder *optionsHolder, int *argc, char ***argv)
 Processes command-line options for the wrapper binary. More...
 

Static Public Member Functions

static void printThanks (FILE *fp)
 Prints the footer at the end of execution.
 

Public Attributes

CommandLineModuleMap modules_
 Maps module names to module objects. More...
 
CommandLineModuleGroupList moduleGroups_
 List of groupings for modules for help output. More...
 
CommandLineProgramContextprogramContext_
 Information about the currently running program.
 
std::string binaryName_
 Name of the binary.
 
CommandLineHelpModulehelpModule_
 Module that implements help for the binary. More...
 
ICommandLineModulesingleModule_
 If non-NULL, run this module in single-module mode.
 
bool bQuiet_
 Stores the value set with setQuiet().
 

Constructor & Destructor Documentation

gmx::CommandLineModuleManager::Impl::Impl ( const char *  binaryName,
CommandLineProgramContext programContext 
)

Initializes the implementation class.

Parameters
[in]binaryNameName of the running binary (without Gromacs binary suffix or .exe on Windows).
programContextProgram information for the running binary.

Member Function Documentation

void gmx::CommandLineModuleManager::Impl::addModule ( CommandLineModulePointer  module)

Helper method that adds a given module to the module manager.

Exceptions
std::bad_allocif out of memory.
void gmx::CommandLineModuleManager::Impl::ensureHelpModuleExists ( )

Creates the help module if it does not yet exist.

Exceptions
std::bad_allocif out of memory.

This method should be called before accessing helpModule_.

CommandLineModuleMap::const_iterator gmx::CommandLineModuleManager::Impl::findModuleByName ( const std::string &  name) const

Finds a module that matches a name.

Parameters
[in]nameModule name to find.
Returns
Iterator to the found module, or modules_.end() if not found.

Does not throw.

ICommandLineModule * gmx::CommandLineModuleManager::Impl::processCommonOptions ( CommandLineCommonOptionsHolder optionsHolder,
int *  argc,
char ***  argv 
)

Processes command-line options for the wrapper binary.

Parameters
[in,out]optionsHolderCommon options.
[in,out]argcOn input, argc passed to run(). On output, argc to be passed to the module.
[in,out]argvOn input, argv passed to run(). On output, argv to be passed to the module.
Exceptions
InvalidInputErrorif there are invalid options.
Returns
The module that should be run.

Handles command-line options that affect the wrapper binary (potentially changing the members of this in response to the options). Also finds the module that should be run and the arguments that should be passed to it.

Member Data Documentation

CommandLineHelpModule* gmx::CommandLineModuleManager::Impl::helpModule_

Module that implements help for the binary.

The pointed module is owned by the modules_ container.

CommandLineModuleGroupList gmx::CommandLineModuleManager::Impl::moduleGroups_

List of groupings for modules for help output.

Owns the contained module group data objects. CommandLineModuleGroup objects point to the data objects contained here.

CommandLineModuleMap gmx::CommandLineModuleManager::Impl::modules_

Maps module names to module objects.

Owns the contained modules.


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