[Intrusive] Call custom function after tree rotations
Hi, I'm trying to implement an interval tree based on boost::intrusive::rbtree. For such an interval tree, certain fixup operations must be run after a node rotation. Now, as far as I can see from the code (looking at rotate_* in bstree_algorithms), there is no way of "hooking into"[0] these methods, right? Am I missing something? What I need: After every operation that changes the parent-child-relationship of nodes I need to touch all involved nodes. At this point, I'm considering monkey-patching bstree_algorithms using some preprocessor directives, but that is bound to fail spectacularly. Any better ideas? Kind regards, and thanks for any help, Lukas [0] I know the term "hook" is overloaded differently with intrusive, but I can't think of a better term.
On 31/05/2017 16:54, Lukas Barth via Boost-users wrote:
Hi,
I'm trying to implement an interval tree based on boost::intrusive::rbtree. For such an interval tree, certain fixup operations must be run after a node rotation. Now, as far as I can see from the code (looking at rotate_* in bstree_algorithms), there is no way of "hooking into"[0] these methods, right? Am I missing something?
What I need: After every operation that changes the parent-child-relationship of nodes I need to touch all involved nodes.
At this point, I'm considering monkey-patching bstree_algorithms using some preprocessor directives, but that is bound to fail spectacularly. Any better ideas?
There was an attempt to add augmented trees: https://github.com/boostorg/intrusive/pull/3 since my knowledge of augmented data structures is rather basic, I could not see myself testing and maintaining such a change. Ion
participants (2)
-
Ion GaztaƱaga
-
Lukas Barth