Gromacs  2025-dev-20241002-88a4191
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::anonymous_namespace{programcontext.cpp}::DefaultProgramContext Class Reference
+ Inheritance diagram for gmx::anonymous_namespace{programcontext.cpp}::DefaultProgramContext:
+ Collaboration diagram for gmx::anonymous_namespace{programcontext.cpp}::DefaultProgramContext:

Description

Default implementation of IProgramContext.

This implementation is used if nothing has been set with setProgramContext().

Since it is constructed using a global initializer, it should not throw.

Public Member Functions

const char * programName () const override
 Returns the name of the binary as it was invoked without any path. More...
 
const char * displayName () const override
 Returns a display name for the program. More...
 
std::filesystem::path fullBinaryPath () const override
 Returns the full path of the running binary. More...
 
InstallationPrefixInfo installationPrefix () const override
 Returns the installation prefix for GROMACS. More...
 
const char * commandLine () const override
 Returns the full command line used to invoke the binary. More...
 

Member Function Documentation

const char* gmx::anonymous_namespace{programcontext.cpp}::DefaultProgramContext::commandLine ( ) const
inlineoverridevirtual

Returns the full command line used to invoke the binary.

The implementation can provide an empty string if no command line is available.

Implements gmx::IProgramContext.

const char* gmx::anonymous_namespace{programcontext.cpp}::DefaultProgramContext::displayName ( ) const
inlineoverridevirtual

Returns a display name for the program.

For simple programs, this can equal programName(). For the GROMACS gmx wrapper binary, this includes the name of the module (e.g., gmx angle). This is used only for informational purposes, and there are no constraints on contents, except that it should not be NULL.

Implements gmx::IProgramContext.

std::filesystem::path gmx::anonymous_namespace{programcontext.cpp}::DefaultProgramContext::fullBinaryPath ( ) const
inlineoverridevirtual

Returns the full path of the running binary.

This is mainly used for informational purposes. There are no constraints on contents, except that it should not be NULL. Currently, this is also used for sanity checks in checkpointing.

The implementation can provide an empty string if the path to the binary is not available. In such a case, the information is not shown.

Implements gmx::IProgramContext.

InstallationPrefixInfo gmx::anonymous_namespace{programcontext.cpp}::DefaultProgramContext::installationPrefix ( ) const
inlineoverridevirtual

Returns the installation prefix for GROMACS.

This path is used to locate the data files that are in share/top/ in the source directory. The implementation can provide an empty string if the path is not available; in such a case, functions that require data files may fail.

The returned structure also contains a flag to indicate whether the prefix actually points to the source tree. This is used for tests and to support running binaries directly from the build tree.

Implements gmx::IProgramContext.

const char* gmx::anonymous_namespace{programcontext.cpp}::DefaultProgramContext::programName ( ) const
inlineoverridevirtual

Returns the name of the binary as it was invoked without any path.

This is typically argv[0] with any leading directory stripped. Currently, this should be a valid file name.

Implements gmx::IProgramContext.


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