Writing fully custom containers for the bgl

I have written a custom container for the bgl's adjacency_list which was based on a subclass of a stl container (namely, std:list). Everything seemed to work just fine (if not by itself) as I followed the bgl book indications. Now, I'm working on a non stl-based container (a wrapper around the bdb API), and facing a lot of compile-time problems. I know my bdb wrapper is not fully stl-compliant. So my question is : if I make this wrapper fully standard-compliant (for instance by using boost::iterator and by implementing everything the stl tells me to implement in a AssociativeContainer or a MultipleAssociativeContainer), will the bgl play nicely with it (i.e. as if it was a std::map, for instance) ? If not, what should I do to be able to use my containers with the bgl. I haven't found any examples out there, and wondered if anyone tried (and succeded) in this task. My second question is : how and when does the adjacency_list instantiates its containers, and is there any way to mess with it, by passing special arguments to the containers when instatiating my graph ? Reading the code and following the process in a debugger doesn't really make my ideas clearer. Thanks in advance for any help and/or ideas Pierre -- Written slowly for people who can't read fast.

On Thursday 06 May 2004 06:47 pm, Pierre DOUCY wrote:
So my question is : if I make this wrapper fully standard-compliant (for instance by using boost::iterator and by implementing everything the stl tells me to implement in a AssociativeContainer or a MultipleAssociativeContainer), will the bgl play nicely with it (i.e. as if it was a std::map, for instance) ?
I would think so, yes.
My second question is : how and when does the adjacency_list instantiates its containers, and is there any way to mess with it, by passing special arguments to the containers when instatiating my graph ? Reading the code and following the process in a debugger doesn't really make my ideas clearer.
Have you considered whether it is really worth using adjacency_list as the basis for your graphs? If they are sufficiently different, it may be better just to write your own graph class (templates) and provide all of the operations needed to fulfill the appropriate graph concepts. Doug

On Fri, 7 May 2004 00:47:21 +0200, Pierre DOUCY wrote
I have written a custom container for the bgl's adjacency_list which was based on a subclass of a stl container (namely, std:list). Everything seemed to work just fine (if not by itself) as I followed the bgl book indications.
Now, I'm working on a non stl-based container (a wrapper around the bdb API), and facing a lot of compile-time problems. I know my bdb wrapper is not fully stl-compliant.
I'm wondering if modifying something like DTL would give you standard container interfaces for your db access without rolling your own. Unfortunately, I don't think you can use Berkeley DB with DTL... http://dtemplatelib.sourceforge.net/index.htm Jeff
participants (3)
-
Douglas Gregor
-
Jeff Garland
-
Pierre DOUCY