CVB++ 14.1
selector_node.hpp
1#pragma once
2
3#include "../global.hpp"
4
5#include "value_node.hpp"
6
7
8
9namespace Cvb
10{
11CVB_BEGIN_INLINE_NS
12namespace GevServer
13{
15
23 : public ValueNode
24{
25public:
26 explicit SelectorNode(HandleGuard<Node> &&guard) : ValueNode(std::move(guard)) {}
27
29
33 bool IsSelector() const
34 {
35 if (selector_ == Selector::Undefined)
36 {
37 selector_ = (GetDependentNodeCount(NodeList::Selected)) ? Selector::Yes : Selector::No;
38 }
39 return (selector_ == Selector::Yes) ? true : false;
40 }
41
43
47 std::vector<ValueNodePtr> SelectedNodes() const { return GetDependentNodes<ValueNode>(NodeList::Selected); }
48
49private:
50 enum class Selector
51 {
52 Yes,
53 No,
54 Undefined
55 };
56
57 mutable Selector selector_ = Selector::Undefined;
58};
59}
60CVB_END_INLINE_NS
61}
Groups other nodes that are dependent on this one.
Definition: selector_node.hpp:24
bool IsSelector() const
Gets whether this node selects at least one other.
Definition: selector_node.hpp:33
std::vector< ValueNodePtr > SelectedNodes() const
Gets all nodes selected by this one.
Definition: selector_node.hpp:47
Base class for all nodes that have a value.
Definition: value_node.hpp:24
@ Selected
Node accesses the selected nodes.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24