ddt 1.2.1
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
 
virtual ~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
 
void SetBrokerOptions (std::string &uri, std::string &config_file, bool &datastreams_list)
 Set the options for a data broker application.
 
void SetViewerOptions (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 SetSubscriberOptions (std::string &broker, std::string &data_stream, int &interval, std::string &remote_broker, int &mode, bool &statistics, bool &dump_data, std::string &dump_folder)
 Set the options for a subscriber application.
 
void SetPublisherOptions (std::string &broker, std::string &data_stream, int &interval, int &buffer_size, std::string &image_folder, int &mode, bool &checksum)
 Set the options for a publisher application with image folder.
 
void SetRemoteClientOptions (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.
 
CommandLineParserResult Parse (int argc, char *argv[])
 Parse the given commandline input.
 
void SetGeneralOptions ()
 Set general 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()

virtual ddt::CommandLineParser::~CommandLineParser ( )
virtualdefault

Destructor

Member Function Documentation

◆ Parse()

CommandLineParserResult 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
CommandLineParserResult enum type

◆ SetBrokerOptions()

void CommandLineParser::SetBrokerOptions ( 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).
datastreams_listDatastreams list.

◆ SetGeneralOptions()

void CommandLineParser::SetGeneralOptions ( )
protected

Set general command line options.

◆ SetOptions()

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.

◆ SetPublisherOptions()

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

Set the options for a publisher application with image folder.

Parameters
brokerTakes the URI of the broker.
data_streamTakes the name of the data stream.
intervalPublishing interval (ms).
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.

◆ SetRemoteClientOptions()

void CommandLineParser::SetRemoteClientOptions ( 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.

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!).

◆ SetSubscriberOptions()

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

Set the options for a subscriber application.

Parameters
brokerTakes the URI of the broker.
data_streamTakes the name of the data stream.
intervalReading interval (ms).
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.

◆ SetViewerOptions()

void CommandLineParser::SetViewerOptions ( 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

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: