I would face this issue globally. From node linked, "add" means adding an already created node to the tree. It can be confusing, though. Problem only have one of each of these three nodes, so it is not exactly the same as adding a feature to a capture...
Taking in consideration all you've said... what if the problem has a Hardware, a Trajectory and a Map, and we can add to them whatever we need to add..?
You mean, not pointers to H T M, but real objects? Why not, but as I say above, maybe we want to consider having multiple T and multiple M (sure not multiple H, unless we want to solve a problem with multiple robots, which is out of my scope...)
My concern, however, is not as much these three HTM things, but rather to have a consistent API that gives a unique value to words such as add, set, append, create, remove, delete, register, install, etc.
I think this is very very important. Then what happens to HTM is just a consequence.
I agree, the issue with HTM is that despite being nodelinkeds, there are no lists containing them, so adding them to the wolf tree is not coherent to be said add().
I like it, but we should discuss about the scope of wolf.
I don't see a reason why more than one robot is out of it... but otherwise we could have more than one map or trajectory... Maybe, H T and M are not going to be a single item... so "set" wouldn't be needed..
I would leave them as pointers.. because I don't see a good reason for the change, I only see a reason for removing the add() and creating them in the constructor.. I think it is more coherent and less changes.
I like move, like std::move... don't it does the same?
OK then, yes it's true, the pointers are there and they can stey there as long as the 'new' is done in the constructor, the 'delete' in the destructor, and we remove the addHTM() API.
Then, I think we won't need set for wolf nodes anymore, only for parameters of derived classes.
I like the add() for adding both: elements and lists.
The move() could be implemented in nodeLinked level and for lists and elements.. nodeLinked::move(upperNodeList&) and `nodeLinked::move(uperNodePtr). What do you think?
Now, append and add are equivalents. The first adds a node and the second adds a list of nodes.. Out of nodeLinked, there is no API for partially link to the tree. add and append = pushback in the list + link upper node.
And what happens in NodeLinked? Do we keep just the push_back() API of the list<> for elementary operations, and then add() is always doing the link operation? Or how we differentiate one thing to the other within NodeLinked?
@joanvallve , I remember we coded some functions using addXxxList() that were actually moves, because the input list was emptied after the call. Do you remember? Can we rename these methods according to what we discussed and agreed in this thread?