Fawkes API  Fawkes Development Version
camargp.h
1 
2 /***************************************************************************
3  * camargp.h - Camera argument parser
4  *
5  * Created: Wed Apr 11 15:44:51 2007
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _FIREVISION_FVUTILS_SYSTEM_CAMARGP_H_
25 #define _FIREVISION_FVUTILS_SYSTEM_CAMARGP_H_
26 
27 #include <fvcams/camera.h>
28 
29 #include <map>
30 #include <string>
31 #include <vector>
32 
33 namespace firevision {
34 
35 class CameraArgumentParser
36 {
37 public:
38  CameraArgumentParser(const char *as);
40 
41  bool has(std::string s) const;
42  std::string get(std::string s) const;
43  long int get_int(std::string s) const;
44  double get_float(std::string s) const;
45  std::map<std::string, std::string> parameters() const;
46  std::vector<std::string> arguments() const;
47  std::string cam_id() const;
48  std::string cam_type() const;
49 
50 private:
51  std::string _cam_type;
52  std::string _cam_id;
53  std::map<std::string, std::string> values;
54  std::vector<std::string> args;
55 };
56 
57 } // end namespace firevision
58 
59 #endif
firevision::CameraArgumentParser::cam_id
std::string cam_id() const
Get camera ID.
Definition: camargp.cpp:133
firevision::CameraArgumentParser::~CameraArgumentParser
~CameraArgumentParser()
Destructor.
Definition: camargp.cpp:110
firevision::CameraArgumentParser::CameraArgumentParser
CameraArgumentParser(const char *as)
Constructor.
Definition: camargp.cpp:68
firevision::CameraArgumentParser::arguments
std::vector< std::string > arguments() const
Get the arguments.
Definition: camargp.cpp:217
firevision::CameraArgumentParser::cam_type
std::string cam_type() const
Get camera type.
Definition: camargp.cpp:122
firevision::CameraArgumentParser::has
bool has(std::string s) const
Check if an parameter was given.
Definition: camargp.cpp:145
firevision::CameraArgumentParser::get_int
long int get_int(std::string s) const
Get the value of the given parameter as integer.
Definition: camargp.cpp:175
firevision::CameraArgumentParser::get_float
double get_float(std::string s) const
Get the value of the given parameter as integer.
Definition: camargp.cpp:198
firevision::CameraArgumentParser::parameters
std::map< std::string, std::string > parameters() const
Get a map of parameters.
Definition: camargp.cpp:226
firevision::CameraArgumentParser::get
std::string get(std::string s) const
Get the value of the given parameter.
Definition: camargp.cpp:156