CVB++ 15.0
enumeration_node.hpp
1#pragma once
2
3#include "../global.hpp"
4#include "selector_node.hpp"
5
6namespace Cvb
7{
8
9 CVB_BEGIN_INLINE_NS
10
11 namespace GenApi
12 {
13
15
17 class EnumerationNode : public SelectorNode
18 {
19 public:
20 explicit EnumerationNode(HandleGuard<Node> &&guard) noexcept
21 : SelectorNode(std::move(guard))
22 {
23 }
24
26
30 String Value() const
31 {
32 return ToString();
33 }
34
36
41 {
42 return static_cast<std::int64_t>(NativeCall<CExports::cvbint64_t>(
43 [&](CExports::cvbint64_t &value) { return CExports::NGetAsInteger(Handle(), value); }));
44 }
45
47
51 void SetValue(const String &value)
52 {
53 FromString(value);
54 }
55
57
61 void SetNumericValue(const uint64_t &value)
62 {
63 NativeCall([&]() { return CExports::NSetAsInteger(Handle(), static_cast<CExports::cvbint64_t>(value)); });
64 }
65
67
72 {
73 return GetDependentNodes<EnumEntryNode>(NodeList::EnumEntry);
74 }
75 };
76
77 } // namespace GenApi
78
79 using GenApi::EnumerationNode;
80
81 CVB_END_INLINE_NS
82
83} // namespace Cvb
void SetNumericValue(const uint64_t &value)
Sets the numeric value of this enumeration.
Definition enumeration_node.hpp:61
void SetValue(const String &value)
Sets the symbolic value of this enumeration.
Definition enumeration_node.hpp:51
String Value() const
Gets the symbolic value of this enumeration.
Definition enumeration_node.hpp:30
std::vector< EnumEntryNodePtr > Entries() const
Gets all enum entries of this enumeration.
Definition enumeration_node.hpp:71
std::int64_t NumericValue() const
Gets the numeric value of this enumeration.
Definition enumeration_node.hpp:40
void * Handle() const noexcept
Classic API node handle.
Definition decl_node.hpp:71
virtual String ToString() const
Returns this node's value as a string representation.
Definition value_node.hpp:52
virtual void FromString(const String &value)
Sets the value of this node from the string value.
Definition value_node.hpp:67
T move(T... args)
Namespace for GenApi based device configuration.
Definition decl_fw_updater.hpp:29
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
std::string String
String for wide characters or unicode characters.
Definition string.hpp:49