CppUtils::Container::MeshNodePtr::Branch<bool IsConst>
CLASSProxy view over a named branch of a MeshNodePtr, holding an RAII lock.
Description
Section titled “Description”| Template parameter | Description |
|---|---|
IsConst | true for read-only shared access (ConstBranch), false for mutable unique access (MutableBranch). |
Public types
Section titled “Public types”VectorAccessor
Section titled “VectorAccessor”using CppUtils::Container::MeshNodePtr<Key, Value, Policy>::Branch<IsConst>::VectorAccessor = std::conditional_t<IsConst, Thread::ReadOnlyAccessor<std::vector<Link>>, Thread::Accessor<std::vector<Link>, Thread::SharedMutex>>;Public methods
Section titled “Public methods”constexpr Branch::Branch(MeshNodePtr parent, Key key, SafeShared<std::vector<Link>> branchLinks, VectorAccessor vectorAccessor);Constructs a branch proxy bound to a parent node, key, and link vector accessor.
Returns the number of links currently stored on this branch.
Checks whether this branch has no links.
Checks whether node is linked on this branch.
| Parameter | Description |
|---|---|
node | Target node to search for. |
Returns: true if node is present on this branch.
[[nodiscard]] constexpr auto Branch::operator[](std::size_t index) const -> std::expected<MeshNodePtr, std::string_view>;Retrieves the target node at index, resolving via Policy if unloaded.
| Parameter | Description |
|---|---|
index | Position in the branch. |
Returns: The target MeshNodePtr on success, or an error message if invalid/out of bounds/expired.
Creates a link from this branch to other.
| Parameter | Description |
|---|---|
other | Target child node to attach. |
Returns: Reference to other, for chained linking.
| Parameter | Description |
|---|---|
std::logic_error | if the parent node is not connected to any root. |
Creates a link from this branch to the parent node of other.
| Parameter | Description |
|---|---|
other | Target branch whose parent node is attached. |
Returns: Rvalue reference to other for chained branch linking.
Detaches a specific target node other from this branch.
| Parameter | Description |
|---|---|
other | Target node to disconnect. |
Creates reciprocal bidirectional links between this branch and other.
| Parameter | Description |
|---|---|
other | Target branch to link with. |
Detaches reciprocal bidirectional links between this branch and other.
| Parameter | Description |
|---|---|
other | Target branch to detach from. |
Returns the first node on this branch, or an error if empty/expired.
Returns the last node on this branch, or an error if empty/expired.
Returns an iterator to the first link on this branch.