libvisiontransfer  7.0.0
parameterinfo.h
1 /*******************************************************************************
2  * Copyright (c) 2019 Nerian Vision GmbH
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *******************************************************************************/
14 
15 #ifndef VISIONTRANSFER_STANDARDPARAMETERS_H
16 #define VISIONTRANSFER_STANDARDPARAMETERS_H
17 
18 #include <map>
19 #include <string>
20 #include "visiontransfer/common.h"
21 
22 namespace visiontransfer {
23 
24 class VT_EXPORT ParameterInfo {
25 public:
27  int32_t intVal;
28  bool boolVal;
29  double doubleVal;
30  };
31 
32  enum ParameterType {
33  TYPE_INT = 1,
34  TYPE_DOUBLE = 2,
35  TYPE_BOOL = 3,
36  };
37 
38  ParameterInfo();
39 
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41  // For internal use only
42  static ParameterInfo fromInt(const std::string& name, bool writeable,
43  int value, int min = -1, int max = -1, int inc = -1);
44  static ParameterInfo fromDouble(const std::string& name, bool writeable,
45  double value, double min = -1, double max = -1, double inc = -1);
46  static ParameterInfo fromBool(const std::string& name, bool writeable, bool value);
47 #endif
48 
52  std::string getName() const;
56  ParameterType getType() const;
60  bool isWriteable() const;
64  template<typename T> T getValue() const;
68  template<typename T> T getMin() const;
72  template<typename T> T getMax() const;
76  template<typename T> T getInc() const;
77 
78 private:
79  class Pimpl;
80  Pimpl* pimpl;
81 };
82 
83 } // namespace
84 
85 #endif
86 
Nerian Vision Technologies