|
Nektar++
|
Helper structure to construct C++ command line argc and argv variables from a C++ vector.
More...
#include <CppCommandLine.hpp>
Public Member Functions | |
| CppCommandLine ()=default | |
| CppCommandLine (std::vector< std::string > argv) | |
| Constructor. | |
| ~CppCommandLine () | |
| Destructor. | |
| char ** | GetArgv () |
Returns the constructed argv. | |
| int | GetArgc () |
Returns the constructed argc. | |
Protected Member Functions | |
| void | Setup (std::vector< std::string > &argv) |
Private Attributes | |
| char ** | m_argv = nullptr |
Pointers for strings argv. | |
| int | m_argc = 0 |
Number of arguments argc. | |
| std::vector< char > | m_buf |
| Buffer for storage of the argument strings. | |
Helper structure to construct C++ command line argc and argv variables from a C++ vector.
This is a useful class when setting up a call to SessionReader::CreateInstance, since arguments must be constructed to the right memory addresses, otherwise MPI (specifically OpenMPI) often tends to segfault.
Definition at line 52 of file CppCommandLine.hpp.
|
default |
|
inline |
Constructor.
| argv | List of command line arguments. |
Definition at line 61 of file CppCommandLine.hpp.
References Setup().
|
inline |
Destructor.
Definition at line 69 of file CppCommandLine.hpp.
References m_argv.
|
inline |
Returns the constructed argc.
Definition at line 91 of file CppCommandLine.hpp.
References m_argc.
Referenced by Field_Init(), NewPartition(), and SessionReader_CreateInstance().
|
inline |
Returns the constructed argv.
Definition at line 83 of file CppCommandLine.hpp.
References m_argv.
Referenced by Field_Init(), NewPartition(), and SessionReader_CreateInstance().
|
inlineprotected |
Definition at line 97 of file CppCommandLine.hpp.
References m_argc, m_argv, and m_buf.
Referenced by CppCommandLine(), and PyCppCommandLine::PyCppCommandLine().
|
private |
Number of arguments argc.
Definition at line 131 of file CppCommandLine.hpp.
|
private |
Pointers for strings argv.
Definition at line 129 of file CppCommandLine.hpp.
Referenced by GetArgv(), Setup(), and ~CppCommandLine().
|
private |
Buffer for storage of the argument strings.
Definition at line 133 of file CppCommandLine.hpp.
Referenced by Setup().