1 #ifndef PACKABLE_TREE_CLASS
2 #define PACKABLE_TREE_CLASS
25 class packable_tree_factory;
55 static void calcit(
int &size_accumulator,
const packable_tree *current_node);
A very common template for a dynamic array of bytes.
A base class for objects that can pack into an array of bytes.
virtual ~packable_tree_factory()
virtual packable_tree * create()=0
a tree factory is needed when we are recreating the packed tree.
A tree object that can be packed into an array of bytes and unpacked again.
void recursive_pack(basis::byte_array &packed_form) const
packs the whole tree starting at this node into the packed form.
int recursive_packed_size() const
spiders the tree starting at this node to calculate the packed size.
packable_tree()
constructs a new tree with a root and zero branches.
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 dynamically linked tree with an arbitrary number of branches.