A tree object that can be packed into an array of bytes and unpacked again. More...
#include <packable_tree.h>


Public Member Functions | |
| packable_tree () | |
| constructs a new tree with a root and zero branches. | |
| int | recursive_packed_size () const |
| spiders the tree starting at this node to calculate the packed size. | |
| void | recursive_pack (basis::byte_array &packed_form) const |
| packs the whole tree starting at this node into the packed form. | |
Static Public Member Functions | |
| static packable_tree * | recursive_unpack (basis::byte_array &packed_form, packable_tree_factory &creator) |
| unpacks a tree stored in "packed_form" and returns it. | |
A tree object that can be packed into an array of bytes and unpacked again.
Definition at line 29 of file packable_tree.h.
| nodes::packable_tree::packable_tree | ( | ) |
constructs a new tree with a root and zero branches.
Definition at line 81 of file packable_tree.cpp.
| void nodes::packable_tree::recursive_pack | ( | basis::byte_array & | packed_form | ) | const |
packs the whole tree starting at this node into the packed form.
Definition at line 138 of file packable_tree.cpp.
References nodes::FINISH, NIL, nodes::tree::postfix, and nodes::tree::start().
Referenced by filesystem::directory_tree::pack().
| int nodes::packable_tree::recursive_packed_size | ( | ) | const |
spiders the tree starting at this node to calculate the packed size.
Definition at line 127 of file packable_tree.cpp.
References NIL, nodes::tree::postfix, and nodes::tree::start().
Referenced by filesystem::directory_tree::packed_size().
| packable_tree * nodes::packable_tree::recursive_unpack | ( | basis::byte_array & | packed_form, | |
| packable_tree_factory & | creator | |||
| ) | [static] |
unpacks a tree stored in "packed_form" and returns it.
if NIL is returned, then the unpack failed. the "creator" is needed for making new derived packable_tree objects of the type stored.
Definition at line 152 of file packable_tree.cpp.
References structures::stack< contents >::acquire_pop(), nodes::tree::attach(), nodes::ATTACH_BRANCHES, nodes::BRANCHES_FOLLOW, nodes::packable_tree_factory::create(), nodes::FINISH, NIL, structures::stack< contents >::push(), structures::stack< contents >::size(), basis::packable::unpack(), and basis::WHACK().
1.6.3