1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.10-windows/ufe/include/trie.h" 18 #include <unordered_map> 38 template<
typename T>
class Trie;
41 class TrieNode :
public std::enable_shared_from_this< TrieNode<T> >
45 typedef std::shared_ptr<TrieNode>
Ptr;
55 void add(
const Ptr& child);
56 void remove(
const Ptr& child);
63 std::vector<PathComponent> childrenComponents()
const;
66 std::size_t size()
const;
69 std::size_t treeSize()
const;
83 void setData(
const T& data);
87 const T& data()
const;
96 int closestCommonAncestor(
int depth )
const;
100 typedef std::unordered_map<PathComponent, Ptr>
Children;
108 void setParent(
Ptr parent);
134 Trie& operator=(
const Trie&) =
delete;
151 bool contains(
const Path&
path)
const;
160 bool containsDescendant(
const Path&
path)
const;
163 bool containsDescendantInclusive(
const Path&
path)
const;
168 bool containsAncestor(
const Path&
path)
const;
171 bool containsAncestorInclusive(
const Path&
path)
const;
176 int closestCommonAncestor()
const;
180 std::size_t size()
const;
191 template<
bool INCLUDE_DESCENDANT>
192 bool containsAncestorHelper(
const Path&
path)
const;
193 template<
bool INCLUDE_ANCESTOR>
194 bool containsDescendantHelper(
const Path&
path)
const;
std::unordered_map< PathComponent, Ptr > Children
Constant string representation with fixed space and O(1) comparison.
Node for Universal Front End trie.
Identify an object or 3D path in the scene.
std::weak_ptr< TrieNode > ParentPtr
std::shared_ptr< TrieNode > Ptr
Path path(const std::string &pathString)