Rumba C++ SDK
NodeDelegateSimpleList.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2025
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include "NodeDelegateWrapper.h"
18 
19 namespace maquina
20 {
21 
23 {
24  friend class ChildIteratorDelegateSimpleList;
25 public:
26  NodeDelegateSimpleList(std::shared_ptr<NodeDelegate> node, std::shared_ptr<NodeDelegateWrapper> parent);
27  using GetChildren = std::vector<std::shared_ptr<NodeDelegate>>(*)(const NodeDelegate& node);
28 
29  // From NodeDelegateWrapper
30  std::shared_ptr<NodeDelegate> parent() const override;
31  int child_count() const override;
32  std::shared_ptr<NodeDelegate> child(const StringView& name) override;
33 
34  static void register_type(std::string node_type, GetChildren);
35 
36 protected:
37  std::shared_ptr<ChildIteratorDelegate> _children_begin() override;
38  std::shared_ptr<ChildIteratorDelegate> _children_end() override;
39 
40  std::optional<std::vector<std::shared_ptr<NodeDelegate>>> _children() const;
41  bool _has_children() const;
42 
43  static std::shared_ptr<NodeDelegate> _simple_wrapper(const std::shared_ptr<NodeDelegate>&, const std::shared_ptr<NodeDelegateWrapper>& parent_wrapper);
44  static std::unordered_map<std::string, GetChildren> _type_get_children;
45 };
46 
47 }
Definition: NodeDelegateSimpleList.h:22
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
#define MAQUINA_EXPORT
Definition: Export.h:31
static std::unordered_map< std::string, GetChildren > _type_get_children
Definition: NodeDelegateSimpleList.h:44
std::vector< std::shared_ptr< NodeDelegate > >(*)(const NodeDelegate &node) GetChildren
Definition: NodeDelegateSimpleList.h:27
This interface gives a high level access to the document structure.
Definition: NodeDelegate.h:72
That class wraps existing node delegate and their children to override some of their behaviors...
Definition: NodeDelegateWrapper.h:23