libvisiontransfer  10.6.0
parameterinfo.h
1 /*******************************************************************************
2  * Copyright (c) 2023 Allied Vision Technologies 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 #if VISIONTRANSFER_CPLUSPLUS_VERSION >= 201103L
19 #include <cstdint>
20 #else
21 #include <stdint.h>
22 #endif
23 
24 #include <map>
25 #include <string>
26 #include "visiontransfer/common.h"
27 
28 namespace visiontransfer {
29 
30 class VT_EXPORT ParameterInfo {
31 public:
32  union ParameterValue {
33  int32_t intVal;
34  bool boolVal;
35  double doubleVal;
36  };
37 
38  enum ParameterType {
39  TYPE_INT = 1,
40  TYPE_DOUBLE = 2,
41  TYPE_BOOL = 3,
42  };
43 
44  ParameterInfo();
45 
46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
47  // For internal use only
48  static ParameterInfo fromInt(const std::string& name, bool writeable,
49  int value, int min = -1, int max = -1, int inc = -1);
50  static ParameterInfo fromDouble(const std::string& name, bool writeable,
51  double value, double min = -1, double max = -1, double inc = -1);
52  static ParameterInfo fromBool(const std::string& name, bool writeable, bool value);
53 #endif
54 
58  std::string getName() const;
62  ParameterType getType() const;
66  bool isWriteable() const;
70  template<typename T> T getValue() const;
74  template<typename T> T getMin() const;
78  template<typename T> T getMax() const;
82  template<typename T> T getInc() const;
83 
84 private:
85  class Pimpl;
86  Pimpl* pimpl;
87 };
88 
89 } // namespace
90 
91 #endif
92 
visiontransfer::ParameterInfo
Definition: parameterinfo.h:42
Allied Vision