Boost logo

Boost :

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>
> 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?
> Cheers,
> Jeremy

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:

  ExtraStorageHolder<TheType> extraStorage;

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, gregod at, cpdaniel at, john at