On Thursday 30 October 2003 11:26 am, Alfredo Braunstein wrote: > Angus Leeming wrote: > > Note that multiple BufferViews implies multiple Cursors. I'm sure > > that I would be pissed off if I replaced "brown" with "red" in one > > window and found that the cursor in my other BufferView had also > > changed position. > > That's a very good point.
I think that the only real solution is that the tree must know of its iterators and adjust them if tree structure changes. I presume that it should call into existence a proper tree base classes for leafs and nodes. I wonder if they exist in the current design. [No time to look at the code, sorry :( ] Essentially, it should be tree's leaves and nodes which should be able to know which cursors point at them. Since there will be probably very few cursors in existence at any given time (say 10 or something of that order), it's conceiveable that: a) a tree element, upon each change, will look through the "global" list of cursors to see which cursors point to it b) it will adjust them per the pending change That also makes cursors invariants between changes to either tree elements or cursor position, and makes all cursors automatically always valid no matter what. Does it make any sense? Is that the direction you are going? Am I talking rubbish? I'm just a bystander and overseer, but I would like to know what pattern are you converging to in the long term. Cheers, Kuba
