Boost logo

Geometry :

Subject: [ggl] space partitioning
From: Simonson, Lucanus J (lucanus.j.simonson)
Date: 2010-09-10 20:22:56


Adam Wulkiewicz wrote:
>> We should steer the discussion of design away from focusing on what
>> is wrong and make constructive suggestions about what good
>> alternatives might be. Then we can discuss how various design
>> options meet the design goals Adam may have, which is a much more
>> interesting conversation.
>
> Maby I'll describe the original idea. There may be a lot of different
> tree structures so I'd like to design a generic tree template which
> might be used as an internal structure of various containers. This
> tree should probably be the intrusive container. Base node structure
> I've used has 4 pointers:
>
> struct node
> {
> node *next;
> node *parent;
> node *previous_sibling;
> node *last_descendant;
> };

Sorry, the design doesn't make sense to me. I don't see the point of any of these four pointers. Why wouldn't the node just have an array of N child nodes? Why a base class not and not a template parameter and traits? If you are inheriting without a virtual destructor people will ask why. I can't see any answer. Inheritance requires a strong rationale in boost and Liskov substitution principle gets thrown around a lot. You never explained how your is_leaf and is_node traits work, but I see no obvious mechanism.

Regards,
Luke


Geometry list run by mateusz at loskot.net