|
Boost Users : |
Subject: Re: [Boost-users] [Intrusive] Call custom function after tree rotations
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2017-05-31 20:40:10
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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net