Test task to Inno Oil and Gas Technology Center.
- git clone [email protected]:ummagumm-a/inno_ogtc.git
- mkdir build && cd build
- cmake ..
- cmake --build .
- ./inno_ogtc
First part of the task is to create a simple hierarchy of container classes. It is done in classes *Holder.
Second part is to create a tree data structure holding pointers to the base class for holders BaseHolder. I've created a class Tree containing a node element and a vector of its children (which are Tree*).
Third part is to save and to recover the tree. I've implemented an algorithm of saving tree contents and structure to a text file outtree.txt. Each line of this file describes a node in the tree in the format:
<node_id> <parent_id> <type_of_element_in_the_node> <value_of_the_element_in_the_node>
Function load()
then recovers the tree from this file.