ddt 1.1.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
ddt::CommandLineParser Class Reference

#include <commandLineParser.hpp>

Inheritance diagram for ddt::CommandLineParser:
CommandLineParserSpy

Public Member Functions

 CommandLineParser ()=default
 
void SetOptions (std::string &broker, std::string &data_stream, int &frequency)
 Set the options for a data transfer application.
 

Protected Attributes

po::options_description options
 
po::positional_options_description positional_options
 
virtual ~CommandLineParser ()
 
void SetOptions (std::string &uri, std::string &config_file, bool &datastreams_list)
 Set the options for a data broker application.
 
void SetOptions (std::string &filename, std::string &local_broker_uri, std::string &remote_broker_uri, std::string &data_stream, std::string &server_uri, std::string &default_image_scale, bool &timestamp, std::string &overlay_file)
 Set the command line options for viewer applications.
 
void SetOptions (std::string &broker, std::string &data_stream, int &frequency, std::string &remote_broker, int &mode, bool &statistics, bool &dump_data, std::string &dump_folder)
 Set the options for a subscriber application.
 
void SetOptions (std::string &broker, std::string &data_stream, int &frequency, int &buffer_size, std::string &image_folder, int &mode, bool &checksum)
 Set the options for a publisher application with image folder.
 
void SetOptions (std::string &server_uri, std::string &image_widget, std::string &command, std::vector< std::string > &arguments, int32_t &timeout, bool &infinite)
 Set the options for a remote client application.
 
int Parse (int argc, char *argv[])
 Parse the given commandline input.
 
void SetOptions ()
 Set standard command line options.
 

Detailed Description

Commandline parser class using for parsing arguments on the commandline

Constructor & Destructor Documentation

◆ CommandLineParser()

ddt::CommandLineParser::CommandLineParser ( )
default

Constructor

◆ ~CommandLineParser()

CommandLineParser::~CommandLineParser ( )
virtualdefault

Destructor

Member Function Documentation

◆ Parse()

int CommandLineParser::Parse ( int  argc,
char *  argv[] 
)

Parse the given commandline input.

Parses the input and stores it in the options object.

Parameters
argcNumber of arguments.
argvArray containing the arguments.
Returns
int Additional flag for debug (1) etc.

◆ SetOptions() [1/7]

void CommandLineParser::SetOptions ( )
protected

Set standard command line options.

This method adds the help and debug argument to the options.

◆ SetOptions() [2/7]

void ddt::CommandLineParser::SetOptions ( std::string &  broker,
std::string &  data_stream,
int &  frequency 
)

Set the options for a data transfer application.

Initializes the options object if not already done, and adds the argument options broker, data_stream and frequency.

Parameters
brokerTakes the URI of the broker.
data_streamTakes the name of the data stream.
frequencyTakes the reading/writing frequency.

◆ SetOptions() [3/7]

void CommandLineParser::SetOptions ( std::string &  broker,
std::string &  data_stream,
int &  frequency,
int &  buffer_size,
std::string &  image_folder,
int &  mode,
bool &  checksum 
)

Set the options for a publisher application with image folder.

Initializes the options object if not already done. Calls setOptions(std::string&, std::string&, int&, std::string&) with broker, data_stream, frequency and buffer_size. Adds then image_folder as argument.

Parameters
brokerTakes the URI of the broker.
data_streamTakes the name of the data stream.
frequencyTakes the reading/writing frequency.
buffer_sizeTakes number of elements in the buffer.
image_folderTakes the path to the image folder.
modeSimulator mode.
checksumTurns the computation of the checksum on.

◆ SetOptions() [4/7]

void CommandLineParser::SetOptions ( std::string &  broker,
std::string &  data_stream,
int &  frequency,
std::string &  remote_broker,
int &  mode,
bool &  statistics,
bool &  dump_data,
std::string &  dump_folder 
)

Set the options for a subscriber application.

Initializes the options object if not already done. Calls setOptions(std::string&, std::string&, int&) with broker, data_stream and frequency. Adds then remote_broker as argument.

Parameters
brokerTakes the URI of the broker.
data_streamTakes the name of the data stream.
frequencyTakes the reading/writing frequency.
remote_brokerTakes the URI to a remote Broker.
modeUse case of the subscriber simulator.
statisticsQuery the statistics.
dump_dataActivate dumping of received data as FITS files.
dump_folderFolder where to store the dumped FITS files.

◆ SetOptions() [5/7]

void CommandLineParser::SetOptions ( std::string &  filename,
std::string &  local_broker_uri,
std::string &  remote_broker_uri,
std::string &  data_stream,
std::string &  server_uri,
std::string &  default_image_scale,
bool &  timestamp,
std::string &  overlay_file 
)

Set the command line options for viewer applications.

Initializes the options object and adds the argument options filename and data_stream.

Parameters
filenameThe file to load.
local_broker_uriLocal Broker URI for data streaming.
remote_broker_uriRemote Broker URI to connect with.
data_streamThe data stream.
server_uriServer URI for remote control interface
default_image_scaleDefault scale for the image (specify as whole integers or in the form 1/2, 1/4 etc.)
timestamptimestamp of last data sample is displayed
overlay_fileThe overlay file to load

◆ SetOptions() [6/7]

void CommandLineParser::SetOptions ( std::string &  server_uri,
std::string &  image_widget,
std::string &  command,
std::vector< std::string > &  arguments,
int32_t &  timeout,
bool &  infinite 
)

Set the options for a remote client application.

Initializes the options object if not already done. Calls setOptions(std::string&, std::string&, std::string&, std::string&, int&) with server_uri, image_widget_name, command_name, arguments and timeout.

Parameters
server_uriTakes the URI to the Remote Control Server.
image_widgetTakes the name of the image widget.
commandTakes the command which is sent to the Remote Control Server.
argumentsTakes the command arguments.
timeoutTakes the imeout for the MAL client (reply time).
infiniteTakes the infinite timeout for the MAL client (reply time is set to 24 h!).

◆ SetOptions() [7/7]

void CommandLineParser::SetOptions ( std::string &  uri,
std::string &  config_file,
bool &  datastreams_list 
)

Set the options for a data broker application.

Parameters
uriTakes the uri of the broker.
config_fileTakes the path and name of the configuration file (optional).

Member Data Documentation

◆ options

po::options_description ddt::CommandLineParser::options
protected

Options

◆ positional_options

po::positional_options_description ddt::CommandLineParser::positional_options
protected

Positional Options


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