1#line 1 "D:/Jenkins/workspace/EMS/ECG/ufe/full/ufe-full-python3.13-windows/ufe/include/trie.h"
17#include <unordered_map>
37template<
typename T>
class Trie;
40class TrieNode :
public std::enable_shared_from_this< TrieNode<T> >
44 typedef std::shared_ptr<TrieNode>
Ptr;
54 void add(
const Ptr& child);
62 std::vector<PathComponent> childrenComponents()
const;
65 std::size_t size()
const;
68 std::size_t treeSize()
const;
82 void setData(
const T& data);
86 const T& data()
const;
95 int closestCommonAncestor(
int depth )
const;
99 typedef std::unordered_map<PathComponent, Ptr>
Children;
107 void setParent(
Ptr parent);
150 bool contains(
const Path&
path)
const;
159 bool containsDescendant(
const Path&
path)
const;
162 bool containsDescendantInclusive(
const Path&
path)
const;
167 bool containsAncestor(
const Path&
path)
const;
170 bool containsAncestorInclusive(
const Path&
path)
const;
175 int closestCommonAncestor()
const;
179 std::size_t size()
const;
190 template<
bool INCLUDE_DESCENDANT>
191 bool containsAncestorHelper(
const Path&
path)
const;
192 template<
bool INCLUDE_ANCESTOR>
193 bool containsDescendantHelper(
const Path&
path)
const;
Constant string representation with fixed space and O(1) comparison.
Identify an object or 3D path in the scene.
Node for Universal Front End trie.
Trie & operator=(const Trie &)=delete
Trie(const Trie &)=delete
std::shared_ptr< TrieNode > Ptr
std::unordered_map< PathComponent, Ptr > Children
std::weak_ptr< TrieNode > ParentPtr
void remove(const std::string &name)
Path path(const std::string &pathString)