Emplace API inconsistent with ProcessorTrackerFeature/Landmark functions
The milestone %Emplace API (WIP in !256 (merged)) changes the way of creating and linking nodes in wolf.
Before, parent nodes were responsible of linking the (already created) child nodes to the tree by capture->addFeature()
(for example).
In the new implementation, each node is responsible to link itself to the tree using feature->link(capture)
. And a new function emplace()
performs both the creation and linking of a new node.
Now, the functions y_ptr->addXXX(x_ptr)
just adds the child node x_ptr
in the list of children of y_ptr
and it should only be called in XXX::link()
. This work has already been done by @jcasals.
However, this new emplace paradigm collides with the design of some functions in ProcessorTrackerFeature
and ProcessorTrackerLandmark
. They were implemented based on "create + addChild" paradigm. The derived classes are expected to just create nodes without linking.
Also, ProcessorTrackerFeature
and ProcessorTrackerLandmark
respectively use two functions that should be removed: CaptureBase::addFeatureList()
and MapBase::addLandmarkList()
(and Problem::addLandmarkList()
which is a bypass). They are linking the elements in the provided list to the tree (so, old paradigm) and they are also moving the elements from the list, so empty it (which is not explained by the names).
We should discuss how we should adapt the implementation of the processors trackers, @jsola.