Hi, sorry, the first sentence in the description was wrong. It should look like this: What the patch does: Every time a path is stored in a path-cache of a property node, the referenced node adds a link to this path-cache. Therefore a node knows all other nodes, which references him in their path-cache.
Maik Justus schrieb am 28.01.2007 21:37: > Hi, > > here is a patch, which adds remove functionality to the patch cache > (hash-table) of the property tree. > What the patch does: > Every time a path is stored in a path-cache of a property node, the > referenced hash table adds a link to this path-cache. Therefore a node > knows all other nodes, which references him in their path-cache. > If a node is removed, it and all children tell all patch-caches, which > link to them, to delete this entries. > Therefore it is save now, to address a node by its name, even if a > node with the same name was deleted before (e.g. the AI/ tree is very > dynamic). > > The property tree is a very central part of flightgear. Therefore I > decided to comment out my debug outputs instead of deleting them > (maybe it's easier to check the functionality of the patch). Even the > _value member of SGPropertyNode::hash_table is only for the debug output. > > If noone complains, I will post a patch without the debug stuff to be > committed to cvs soon. > > (With this patch and the multiplayer patch (in cvs) aerotow should > work stable over the net). > > Maik > > Maik Justus schrieb am 22.01.2007 01:21: >> Hi just to clarify: >> >> if I wrote delete, I meant not delete as cpp defines delete. I >> thought of removing a node. >> >> Maik >> >> Maik Justus schrieb am 22.01.2007 01:11: >> >>> Hi, >>> >>> the patch-cache of the property tree is not designed for >>> node-deleting. But the multiplayer code deletes nodes deletes nodes >>> very often. If you access such nodes by name, which is necessary to >>> acces multiplayer-nodes (you can not store a pointer, tho node could >>> be deleted meanwhile), you often get a pointer to a already deleted >>> node. As a result, aerotowing often fails, if one player was removed >>> from the multiplayer list for a short time. As an ugly fix, you can >>> switch off the path cache and aerotow works as expected. As a >>> solution I think of a vector of path caches at every node, which >>> stores all path caches, if they are pointing to this node. If a node >>> is removed, all linked path caches get this information and the link >>> can be deleted. This must be done for all child-nodes, too. (one >>> question: which member of SGPropertyNode is called if a node is >>> removed from the tree?) >>> >>> Maik >>> > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel