Boost logo

Boost Users :

Subject: Re: [Boost-users] [MultiIndex] As if one iterator
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2010-06-06 14:06:20


Dan Bloomquist <danb <at> lakeweb.net> writes:

>
>
> I have a muti_index for a database. First I'll say, this will be so much
> better than my old way of running an SQL every time I wanted to change
> the order. Thanks. I never see a database bigger than some 1200 records,
> usually <200, so I'm not worried about memory bloat.
>
> So I've wrapped the multi_index in a class that will hide the boost
> includes from the rest of my app. I'll include the work below. I'd like
> to treat some kind of interface, like a generic iterator, depending on
> what order I have set. I would only use one iterator at a time. But the
> iterators are templated and have no base so that I can easily keep a set
> of iterators handy, say in a container, and then supply the appropriate
> iterator through an interface.

Not sure whether this is what you'r after, but have you considered
using adobe::any_iterator?

http://stlab.adobe.com/classadobe_1_1any__iterator.html

adobe::any_iterator is a polymorphic iterator wrapper so that
you can use it to handle at run-time any iterator with the specified
category (bidirectional, foward, etc.) Kind of like boost::any for
general objects, but already specialized for the iterator interface.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net