1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.9-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::size_t size()
const;
66 std::size_t treeSize()
const;
80 void setData(
const T& data);
84 const T& data()
const;
93 int closestCommonAncestor(
int depth )
const;
97 typedef std::unordered_map<PathComponent, Ptr>
Children;
105 void setParent(
Ptr parent);
131 Trie& operator=(
const Trie&) =
delete;
148 bool contains(
const Path&
path)
const;
157 bool containsDescendant(
const Path&
path)
const;
160 bool containsDescendantInclusive(
const Path&
path)
const;
165 bool containsAncestor(
const Path&
path)
const;
168 bool containsAncestorInclusive(
const Path&
path)
const;
173 int closestCommonAncestor()
const;
177 std::size_t size()
const;
186 template<
bool INCLUDE_DESCENDANT>
187 bool containsAncestorHelper(
const Path&
path)
const;
188 template<
bool INCLUDE_ANCESTOR>
189 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)