From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-08-12 14:32:45
On Monday 12 August 2002 03:04 pm, Jeremy Siek wrote:
> ghost> If such type is defined for every PropertyGraph then I can
> ghost> associate any data with edges and know that it's as efficient as
> ghost> possible for the given graph type.
> ghost> Opinions?
> Sure, that would be nice. I just don't know how to implement it so that
> deciding which internal property to access is done at compile time. If it
> is done at run-time there will be a performance hit. Do you have an
> implementation approach in mind?
I'm not sure if it's relevant to your problem domain, but for our internal
representation we use internal property maps that are determined at load time
by building auxiliary data structures to store the internal property maps.
Here is how it is used:
To allow property maps to be injected for a given type, add the following data
member to that type:
To declare a property map with value type 'int' as an internal property map
for a type 'TheType':
ExtraStorageInNode<int, TheType> myPropertyMap;
This approach works well for us, where we have many large property maps with
long lifetimes and need fast access. I can give more implementation specifics
if it would help.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk