The Node class provides move and swap methods that allow you to efficiently combine or exchange data between Node trees. These provide similar semantics to C++ std::move and std::swap.
- Node.move(Node): Allows you to move the entire contents and description of a passed Node into the calling Node. There are no copies. The calling Node assumes management of all pointers and relevant metadata.
- Node.swap(Node): Allows you to swap the entire contents and description of two Nodes. There are no copies. The Node's swap management of all pointers and relevant metadata. The schema parent pointers are updated to reflect the new hierarchy.
- Python Move Example:
../../tests/docs/t_conduit_docs_tutorial_python_move_and_swap.py
- Output
t_conduit_docs_tutorial_python_move_and_swap_out.txt
- Python Swap Example:
../../tests/docs/t_conduit_docs_tutorial_python_move_and_swap.py
- Output
t_conduit_docs_tutorial_python_move_and_swap_out.txt