File: optionsfunction.h

package info (click to toggle)
aoflagger 3.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,960 kB
  • sloc: cpp: 83,076; python: 10,187; sh: 260; makefile: 178
file content (38 lines) | stat: -rw-r--r-- 1,381 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef LUA_OPTIONS_FUNCTION_H
#define LUA_OPTIONS_FUNCTION_H

#include <map>
#include <string>
#include <vector>

#include "../aoluarunner/options.h"

extern "C" {
#include <lua.h>
}

class OptionsFunction {
 public:
  // Returns a map of options. The map keys are the name of the runs.
  static std::map<std::string, Options> GetOptions(
      lua_State* state, const Options& cmdLineOptions);

 private:
  static Options fillOptions(lua_State* state, const Options& cmdLineOptions,
                             const std::string& runName);

  static bool boolOption(lua_State* state, const std::string& keyName,
                         const std::string& runName);
  static size_t uintOption(lua_State* state, const std::string& keyName,
                           const std::string& runName);
  static std::vector<size_t> uintListOption(lua_State* state,
                                            const std::string& keyName,
                                            const std::string& runName);
  static std::vector<std::string> stringListOption(lua_State* state,
                                                   const std::string& keyName,
                                                   const std::string& runName);
  static std::string strOption(lua_State* state, const std::string& keyName,
                               const std::string& runName);
};

#endif