[PATCH 12/17] layouts: refactor the entity_node and tree layout logic
The previous logic directly associated xtree_node_t elements with entities. The list of nodes associated to an entity was thus directly made of xtree_node_t elements each one pointing directly to the entity. An entity being layout agnostic, that is to say not bound to a particular layout it was not possible to look for the xtree_node_t element associated with a particular layout in an entity. This was due to the fact that the entity_node element was not used as an intermediate level to link the entities and their different xtree_node_t elements. Indeed, this is the role of the entity_node to associate a position in a particular layout with an entity. The new logic ensures that when building a layout relational structure : - (1) an entity node associated with the targeted layout is created for the entity and references both the layout and the entity it is associated too. - (2) the entity node is the element that is added to the (tree) relational structure of the layout resulting in the creation of a relational node (xtree_node_t) that will reference it directly. - (3) the created relational node (xtree_node_t) is referenced in the associated entity node in order to provide a way to go back to the position in the relational structure from the entity node, thus enabling to search the neighborhood of an entity for a particular layout only knowing the entity and the layout to look at. The packing logic was modified to take into account the new level of indirection (the entity_node element) when walking the relational structure of a particular layout. The debug dump logic was modified too to reflect the changes.
Please register or sign in to comment