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 
11 namespace Cvb
12 {
13 CVB_BEGIN_INLINE_NS
14 namespace GevServer
15 {
17 
25  :
27  virtual public Private::IConfigurableSelectorNode
28  ,
30  public ValueNode
31 {
32 public:
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 
56 private:
57  enum class Selector
58  {
59  Yes,
60  No,
61  Undefined
62  };
63 
64  mutable Selector selector_ = Selector::Undefined;
65 };
66 }
67 CVB_END_INLINE_NS
68 }
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:27
Node accesses the selected nodes.
Root namespace for the Image Manager interface.
Definition: version.hpp:11
bool IsSelector() const
Gets whether this node selects at least one other.
Definition: selector_node.hpp:40
Groups other nodes that are dependent on this one.
Definition: selector_node.hpp:24
STL class.