Instrument Control Lib
Framework to control Oscilloscopes, SMUs, Function Generators and DC Powersupplies via Ethernet.
ExecArgs.h
Go to the documentation of this file.
1 
5 #ifndef INSTRUMENT_CONTROL_LIB_EXEC_ARGS_H
6 #define INSTRUMENT_CONTROL_LIB_EXEC_ARGS_H
7 
8 #include "SubArg.h"
9 
14 class ExecArgs
15 {
20  enum ARGUMENT_TYPE
21  {
22  ARG_TYPE_INTEGER,
23  ARG_TYPE_FLOAT,
24  ARG_TYPE_STRING
25  };
26 
28  typedef std::tuple<ARGUMENT_TYPE, std::string, std::tuple<std::string,std::string>> ArgTuple;
29 
30 public:
31  explicit ExecArgs() = default;
32 
33  ExecArgs & AddArgument(std::string argument, int value, std::string seperator= "");
34  ExecArgs & AddArgument(std::string argument, double value, std::string seperator= "");
35  ExecArgs & AddArgument(const std::string& argument, const std::string& value, const std::string& seperator= "");
36 
37  ExecArgs & AddArgument(SubArg argument, int value, std::string seperator= "");
38  ExecArgs & AddArgument(SubArg argument, double value, std::string seperator= "");
39  ExecArgs & AddArgument(SubArg argument, const std::string& value, const std::string& seperator= "");
40 
41  ExecArgs & AddArgument(SubArg argument, SubArg& value, const std::string& seperator= "");
42 
43  std::string GetArgumentsAsString();
44 
45 private:
46 
47  static ARGUMENT_TYPE GetArgumentTypeFromArgTuple(ArgTuple& argTuple);
48  static std::string GetSeperatorFromArgTuple(ArgTuple& argTuple);
49  static std::string GetArgumentFromArgTuple(ArgTuple& argTuple);
50  static std::string GetValueFromArgTuple(ArgTuple& argTuple);
51 
52  std::vector<std::tuple<ARGUMENT_TYPE, std::string, std::tuple<std::string,std::string>>> m_ArgList;
53 };
54 #endif //INSTRUMENT_CONTROL_LIB_EXEC_ARGS_H
ExecArgs class is used to create execution arguments based on a parameter seperator value scheme....
Definition: ExecArgs.h:15
std::string GetArgumentsAsString()
Transforms the list of arguments to a string which can be passed to the Exec function.
Definition: ExecArgs.cpp:111
ExecArgs & AddArgument(std::string argument, int value, std::string seperator="")
This file contains the implementation of the execution arguments, which should can be passed to the E...
Definition: ExecArgs.cpp:18
ExecArgs()=default
This class implements sub-arguments which can be added to a ExecArgs object. This is required,...
Definition: SubArg.h:14