WOLF API change: REMOVING add...() and add...By() functions
The wolf API requires too much functions to be called in order to properly create and link a node in the wolf tree. Now, the procedure has 2 or 3 steps:
- Calling the constructor via
make_shared
- Adding it to its parent node
- (only constraints) adding it to its "other" linked nodes.
This information is known at the time of constructing the node. However, calling shared_from_this
is not allowed until the constructor ends, so the points 2 and 3 can't be performed inside the constructor.
Yesterdary with @jsola we found out that it is possible using a trick: https://stackoverflow.com/questions/33069674/is-this-trick-to-make-calling-shared-from-this-in-the-constructor-just-work
I've created gtest_shared_from_this
to test and show how it works.
Using it, we could implement a new wolf API to do all the steps inside the constructor of the corresponding base classe and there would be no add
functions (nor addConstrainedBy()
).
What do you thing? @jsola @asantamaria, @artivis, @AtDinesh