86e31e696d64f11b9e1f636315ff338f1e3d8cb8
I have modified the SGPropertyNode interface to support node removal and address the issues you mention yesterday. I added the SGPropertyNode_ptr class that is a smart pointer that increment and decrement a counter in SGPropertyNode. The _children vector is changed to a vector<SGPropertyNode_ptr> in order for the node to hold a reference to its children. I also added a _removedChildren vector of the same type. When removeChild is called with the keep parameter set to true, the reference is removed from _children and inserted in _removedChildren, and the attribute REMOVED is set. When getChild is called with create set to true, the _children vector is searched, then the _removedChildren and then a new node is created. If a resurrected node is returned, the REMOVED bit is cleared. The static const int LAST_USED_ATTRIBUTE is also added. The footprint of this patch is light. SGPropertyNode is one int longer in size, SGPropertyNode_ptr is one pointer large without virtual functions. Some functions can be inlined if your current policy change. The FlightGear patch is to take account the change in the getChildren function that now returns a vector<SGPropertyNode_ptr>. If the removeChild functionnality is to be added in FlightGear, all those SGPropertyNode * floating around should be changed to SGPropertyNode_ptr.
[ Nothing here at this time. ]
Description
Languages
C++
85.5%
C
13.1%
CMake
1.4%