ddt  0.1
commandLineParser.hpp
Go to the documentation of this file.
1 // @copyright
2 // (c) Copyright ESO 2020
3 // All Rights Reserved
4 // ESO (eso.org) is an Intergovernmental Organization, and therefore special
5 // legal conditions apply.
6 //
7 // @file commandLineParser.hpp
8 // @brief Class for parsing command line arguments.
9 //
10 //
11 // @author Monika Pfeil, CGI
12 // @since 2020/08/13
13 
14 #ifndef DDT_UTILS_COMMANDLINELIB_COMMANDLINEPARSER
15 #define DDT_UTILS_COMMANDLINELIB_COMMANDLINEPARSER
16 
17 #include <boost/program_options.hpp>
18 #include <iostream>
19 #include <memory>
20 #include <string>
21 #include "ddt/ddtConstants.hpp"
22 
23 namespace po = boost::program_options;
24 
25 namespace ddt {
26 
31  public:
35  CommandLineParser() = default;
39  virtual ~CommandLineParser();
47  void setOptions(std::string &uri, std::string &config_file);
61  void setOptions(std::string &filename, std::string &data_stream,
62  std::string &server_uri, std::string &default_image_scale,
63  bool &timestamp);
74  void setOptions(std::string &broker, std::string &data_stream,
75  int &frequency);
92  void setOptions(std::string &broker, std::string &data_stream, int &frequency,
93  std::string &remote_broker, int &mode, bool &statistics,
94  bool &dump_data, std::string &dump_folder);
110  void setOptions(std::string &broker, std::string &data_stream, int &frequency,
111  int &buffer_size, std::string &image_folder, int &mode,
112  bool &checksum);
129  void setOptions(std::string &server_uri, std::string &image_widget,
130  std::string &command, std::vector<std::string> &arguments,
131  int32_t &timeout, bool &infinite);
141  int parse(int argc, char *argv[]);
142 
143  protected:
150  void setOptions();
151 
155  po::options_description options;
159  po::positional_options_description positional_options;
160 };
161 } // namespace ddt
162 
163 #endif // DDT_UTILS_COMMANDLINELIB_COMMANDLINEPARSER
ddt::CommandLineParser::~CommandLineParser
virtual ~CommandLineParser()
ddt::CommandLineParser::setOptions
void setOptions()
Set standard command line options.
Definition: commandLineParser.cpp:28
ddtConstants.hpp
ddt
Definition: ddtClient.hpp:36
pyDdtBroker.broker
broker
Definition: pyDdtBroker.py:21
ddt::CommandLineParser::options
po::options_description options
Definition: commandLineParser.hpp:155
ddt::CommandLineParser
Definition: commandLineParser.hpp:30
ddt::CommandLineParser::parse
int parse(int argc, char *argv[])
Parse the given commandline input.
Definition: commandLineParser.cpp:224
ddt::CommandLineParser::CommandLineParser
CommandLineParser()=default
ddt::CommandLineParser::setOptions
void setOptions(std::string &broker, std::string &data_stream, int &frequency)
Set the options for a data transfer application.
ddt::CommandLineParser::positional_options
po::positional_options_description positional_options
Definition: commandLineParser.hpp:159