CVB++ 14.0
selector_node.hpp
1#pragma once
2
3#include "../global.hpp"
4
5#include "value_node.hpp"
6
8#include "_detail/iconfigurable_selector_node.hpp"
10
11namespace Cvb
12{
13CVB_BEGIN_INLINE_NS
14namespace GevServer
15{
17
25 :
27 virtual public Private::IConfigurableSelectorNode
28 ,
30 public ValueNode
31{
32public:
33 SelectorNode(HandleGuard<Node> &&guard) noexcept : ValueNode(std::move(guard)) {}
34
36
40 bool IsSelector() const
41 {
42 if (selector_ == Selector::Undefined)
43 {
44 selector_ = (GetDependentNodeCount(NodeList::Selected)) ? Selector::Yes : Selector::No;
45 }
46 return (selector_ == Selector::Yes) ? true : false;
47 }
48
50
54 std::vector<ValueNodePtr> SelectedNodes() const { return GetDependentNodes<ValueNode>(NodeList::Selected); }
55
56private:
57 enum class Selector
58 {
59 Yes,
60 No,
61 Undefined
62 };
63
64 mutable Selector selector_ = Selector::Undefined;
65};
66}
67CVB_END_INLINE_NS
68}
Groups other nodes that are dependent on this one.
Definition: selector_node.hpp:31
bool IsSelector() const
Gets whether this node selects at least one other.
Definition: selector_node.hpp:40
std::vector< ValueNodePtr > SelectedNodes() const
Gets all nodes selected by this one.
Definition: selector_node.hpp:54
Base class for all nodes that have a value.
Definition: value_node.hpp:32
@ Selected
Node accesses the selected nodes.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24