Stellarator-Tools
Loading...
Searching...
No Matches
netcdf_test::commandline_parser Class Reference

A radial quantity. More...

#include <netcdf_test_commandline_parser.hpp>

Public Member Functions

 commandline_parser (const size_t argc, const char *argv[], const std::function< void(void)> help)
 Construct a commandline_parser object by pasring command line arguments.
bool is_set (const std::string &key) const
 Check if command arg was set.
template<typename TYPE>
TYPE get (const std::string &key) const
 Get the value of the agument.

Static Public Member Functions

static arg_map parse_commands (const size_t argc, const char *argv[], const std::function< void(void)> help)
 Factory method to parse the commandline and produce the arguments.

Public Attributes

const arg_map commands
 Parsed commands.
const std::function< void(void)> help
 Help callback function.

Detailed Description

A radial quantity.

Constructor & Destructor Documentation

◆ commandline_parser()

netcdf_test::commandline_parser::commandline_parser ( const size_t argc,
const char * argv[],
const std::function< void(void)> help )
inline

Construct a commandline_parser object by pasring command line arguments.

Parameters
[in]argcNumber of commandline arguments.
[in]argvCommandline strings.
[in]helpCall back function to display the help message.

Member Function Documentation

◆ get()

template<typename TYPE>
TYPE netcdf_test::commandline_parser::get ( const std::string & key) const
inline

Get the value of the agument.

Template Parameters
TYPEType to read the value as.
Parameters
[in]keyCommandline key to check.
Returns
Value of the argument.

◆ is_set()

bool netcdf_test::commandline_parser::is_set ( const std::string & key) const
inline

Check if command arg was set.

Parameters
[in]keyCommandline key to check.
Returns
True if the key was set.

◆ parse_commands()

arg_map netcdf_test::commandline_parser::parse_commands ( const size_t argc,
const char * argv[],
const std::function< void(void)> help )
inlinestatic

Factory method to parse the commandline and produce the arguments.

Parameters
[in]argcNumber of commandline arguments.
[in]argvCommandline strings.
[in]helpCall back function to display the help message.
Returns
A constructed map of commandline argument key value pairs.

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