Boost logo

Geometry :

Subject: [ggl] spacial index construction interface
From: Adam Wulkiewicz (adam.wulkiewicz)
Date: 2011-03-10 05:06:54


Barend Gehrels wrote:
>> 2.
>> - replace shared_ptr(s) with simple pointers,
>
> IMO it should be a std::vector<node>, so no pointer at all. Replacing
> them with simple pointer does not help the problem. The shared_ptr is
> not the problem, but the pointer.
>
>> - replace memory allocation done by operator new with some allocator
>> (std::allocator by default).
>
> Using a std::vector keeps all memory allocation from the library itself.
> So this is not necessary (again, if I'm right).
>
> Is this OK?

I just realised one thing. In this desing we canot rely on parents or
any other node reference/pointer because std::vector can move it
somewhere. It is posible that the whole index should be redesigned. We
can't copy nodes because we'd copy whole subtree. Storing node's path
(indexes from root and reference to root) is a poor option. All methods
should just move top-down but I don't know if it's possible in all
cases. What do you think?

Regards,
Adam


Geometry list run by mateusz at loskot.net