camcom 1.0.3
 
Loading...
Searching...
No Matches
node_types.hpp
Go to the documentation of this file.
1
8
9#ifndef CAMCOM_GENICAM_NODE_TYPES_HPP
10#define CAMCOM_GENICAM_NODE_TYPES_HPP
11
12#include <cstdint>
13#include <map>
14#include <string>
15#include <variant>
16#include <vector>
17
18namespace camcom::genicam {
19
30
32enum class AccessMode { RO, WO, RW, NA };
33
35std::string nodeTypeToString(NodeType type);
36
38std::string accessModeToString(AccessMode mode);
39
40// ---------------------------------------------------------------------------
41// Node types
42// ---------------------------------------------------------------------------
43
45struct NodeBase {
46 std::string name;
47 std::string display_name;
48 std::string description;
49 std::string category;
52 std::string tooltip;
53};
54
56 int64_t value{0};
57 int64_t min{0};
58 int64_t max{INT64_MAX};
59 int64_t increment{1};
60 std::string unit;
61};
62
64 double value{0.0};
65 double min{0.0};
66 double max{1e12};
67 std::string unit;
68 std::string representation;
69};
70
72 bool value{false};
73};
74
76 std::string value;
77 int64_t max_length{256};
78};
79
81 std::string value;
82 std::vector<std::string> entries;
83 std::map<std::string, int64_t> entry_values;
84};
85
87 bool is_done{true};
88};
89
91 std::vector<std::string> features;
92};
93
94// ---------------------------------------------------------------------------
95// Variant + container
96// ---------------------------------------------------------------------------
97
99using GenICamNode = std::variant<
103>;
104
106using NodeMap = std::map<std::string, GenICamNode>;
107
108// ---------------------------------------------------------------------------
109// Visitor helpers
110// ---------------------------------------------------------------------------
111
113NodeType getNodeType(const GenICamNode& node);
114
116std::string getNodeName(const GenICamNode& node);
117
120
122std::string getDisplayName(const GenICamNode& node);
123
125std::string getDescription(const GenICamNode& node);
126
127} // namespace camcom::genicam
128
129#endif // CAMCOM_GENICAM_NODE_TYPES_HPP
Definition adapter.cpp:28
NodeType
GenICam node types.
Definition node_types.hpp:21
@ Float
Definition node_types.hpp:23
@ String
Definition node_types.hpp:25
@ Boolean
Definition node_types.hpp:24
@ Enumeration
Definition node_types.hpp:26
@ Category
Definition node_types.hpp:28
@ Integer
Definition node_types.hpp:22
@ Command
Definition node_types.hpp:27
NodeType getNodeType(const GenICamNode &node)
Get the NodeType of a variant node.
Definition node_types.cpp:44
std::string nodeTypeToString(NodeType type)
Convert NodeType to string.
Definition node_types.cpp:17
std::variant< IntegerNode, FloatNode, BooleanNode, StringNode, EnumerationNode, CommandNode, CategoryNode > GenICamNode
Variant holding any concrete node type.
Definition node_types.hpp:99
std::string accessModeToString(AccessMode mode)
Convert AccessMode to string.
Definition node_types.cpp:30
AccessMode getAccessMode(const GenICamNode &node)
Get the access mode of a variant node.
Definition node_types.cpp:56
std::map< std::string, GenICamNode > NodeMap
Container: feature name -> node.
Definition node_types.hpp:106
AccessMode
Access mode for a GenICam node.
Definition node_types.hpp:32
@ RW
Definition node_types.hpp:32
@ WO
Definition node_types.hpp:32
@ NA
Definition node_types.hpp:32
@ RO
Definition node_types.hpp:32
std::string getDescription(const GenICamNode &node)
Get the description of a variant node.
Definition node_types.cpp:68
std::string getNodeName(const GenICamNode &node)
Get the name of a variant node.
Definition node_types.cpp:50
std::string getDisplayName(const GenICamNode &node)
Get the display name of a variant node.
Definition node_types.cpp:62
Definition node_types.hpp:71
bool value
Definition node_types.hpp:72
Definition node_types.hpp:90
std::vector< std::string > features
Child feature names.
Definition node_types.hpp:91
Definition node_types.hpp:86
bool is_done
Definition node_types.hpp:87
Definition node_types.hpp:80
std::string value
Current entry name.
Definition node_types.hpp:81
std::map< std::string, int64_t > entry_values
Entry name -> integer value.
Definition node_types.hpp:83
std::vector< std::string > entries
Allowed entry names.
Definition node_types.hpp:82
Definition node_types.hpp:63
std::string unit
Definition node_types.hpp:67
std::string representation
"Linear", "Logarithmic", "PureNumber"
Definition node_types.hpp:68
double max
Definition node_types.hpp:66
double min
Definition node_types.hpp:65
double value
Definition node_types.hpp:64
Definition node_types.hpp:55
int64_t value
Definition node_types.hpp:56
int64_t increment
Definition node_types.hpp:59
int64_t min
Definition node_types.hpp:57
std::string unit
Definition node_types.hpp:60
int64_t max
Definition node_types.hpp:58
Base attributes shared by all GenICam nodes.
Definition node_types.hpp:45
NodeType type
Definition node_types.hpp:50
std::string tooltip
Definition node_types.hpp:52
std::string display_name
Human-readable label.
Definition node_types.hpp:47
std::string name
SFNC name (e.g., "ExposureTime")
Definition node_types.hpp:46
std::string description
Definition node_types.hpp:48
AccessMode access
Definition node_types.hpp:51
std::string category
Parent category path.
Definition node_types.hpp:49
Definition node_types.hpp:75
int64_t max_length
Definition node_types.hpp:77
std::string value
Definition node_types.hpp:76