Connecting Tech Pros Worldwide Forums | Help | Site Map

boost::MultiIndex help

Evan Carew
Guest
 
Posts: n/a
#1: Dec 29 '05
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm using boost multi index for the first time. I've managed to populate
the container with my data & now I am trying to get the non-unique
ordered index to work. Does anyone have a source example (not from the
boost.multiindex tutorial please) used to get a list, set, whatever, of
tuples from such a search on such an index?

Thanks,
Evan Carew
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtDRCpxCQXwV2bJARAiBuAKCIxIcgHh0YVcSuCXkXDF aOuLYiugCgtUlu
ZC3C2hNJgI5R8v9kyU0Ijmg=
=tV0D
-----END PGP SIGNATURE-----

mlimber
Guest
 
Posts: n/a
#2: Dec 29 '05

re: boost::MultiIndex help


Evan Carew wrote:[color=blue]
> I'm using boost multi index for the first time. I've managed to populate
> the container with my data & now I am trying to get the non-unique
> ordered index to work. Does anyone have a source example (not from the
> boost.multiindex tutorial please) used to get a list, set, whatever, of
> tuples from such a search on such an index?[/color]

You'll likely get a faster response from the Boost user list. See:

http://boost.org/more/mailing_lists.htm#users

Cheers! --M

Joaquín M López Muñoz
Guest
 
Posts: n/a
#3: Dec 30 '05

re: boost::MultiIndex help



Evan Carew ha escrito:
[color=blue]
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm using boost multi index for the first time. I've managed to populate
> the container with my data & now I am trying to get the non-unique
> ordered index to work. Does anyone have a source example (not from the
> boost.multiindex tutorial please) used to get a list, set, whatever, of
> tuples from such a search on such an index?
>[/color]

Hello Evan,

I'd like to help you, but for that I'd need a little more
info. Could you post some of your source code, like
for instance the instantiation of multi_index_container
you've defined? And what are the specific problems you're
having with ordered indices?

Also, this is probably best moved to the Boost users list,
as comp.lang.c++ is in principle not devoted to particular
libs but the C++ language in general.

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

Evan Carew
Guest
 
Posts: n/a
#4: Dec 30 '05

re: boost::MultiIndex help


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks, I didn't realize there was a general boost mailing list. I'll
give it a try. I do note tho that there is relatively low traffic on it,
i.e. < 500 / Mo.

Evan

mlimber wrote:[color=blue]
> Evan Carew wrote:
>[color=green]
>>I'm using boost multi index for the first time. I've managed to populate
>>the container with my data & now I am trying to get the non-unique
>>ordered index to work. Does anyone have a source example (not from the
>>boost.multiindex tutorial please) used to get a list, set, whatever, of
>>tuples from such a search on such an index?[/color]
>
>
> You'll likely get a faster response from the Boost user list. See:
>
> http://boost.org/more/mailing_lists.htm#users
>
> Cheers! --M
>[/color]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtXTwpxCQXwV2bJARAupjAKC1+BA34JrCIUQ9SVrRWd T38qc4bgCfYkgw
Of08FH9zlAOzGIaanvoFXms=
=Pf1n
-----END PGP SIGNATURE-----
Evan Carew
Guest
 
Posts: n/a
#5: Dec 30 '05

re: boost::MultiIndex help


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Evan Carew wrote:[color=blue]
> Thanks, I didn't realize there was a general boost mailing list. I'll
> give it a try. I do note tho that there is relatively low traffic on it,
> i.e. < 500 / Mo.
>
> Evan
>[/color]
Hmm... Looks like their list server is down. I am unable to register. <sigh>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtZgGpxCQXwV2bJARAu3eAJwPdPeGc1A0s4rDgy+DWh tGnLFjhACgkiPq
V6rbwqzWTHv2yhOE6zTiQO0=
=ertA
-----END PGP SIGNATURE-----
Evan Carew
Guest
 
Posts: n/a
#6: Dec 30 '05

re: boost::MultiIndex help


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well, lets try this example source code:


typedef multi_index::multi_index_container<
person,
multi_index::indexed_by<
multi_index::ordered_unique<
multi_index::tag<voterid>,
BOOST_MULTI_INDEX_MEMBER(person,unsigned long,voterid)>,
multi_index::ordered_non_unique<

multi_index::tag<lastname>,BOOST_MULTI_INDEX_MEMBE R(person,string,lastname)>,
multi_index::ordered_non_unique<
multi_index::tag<resstreetnum>,
BOOST_MULTI_INDEX_MEMBER(person,int,resstreetnum)> >[color=blue]
> people_set;[/color]

......

int main(){
const people_set::nth_index<2>::type& resstreet_index=ps.get<2>();
pair<people_set::iterator, people_set::iterator> range;
range = resstreet_index.equal_range((*domoItor).first);
}

The above code doesn't compile. If you happen to know why, I'd
appreciate some help in getting it going.

Thanks
Evan Carew
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtZkEpxCQXwV2bJARAiFyAJ0SlA2q8ls4SQ/jhep7suC8/Fd7hACcCP2E
2lyn3/OmjYl7hKWbZcaqTfM=
=ry4Y
-----END PGP SIGNATURE-----
Evan Carew
Guest
 
Posts: n/a
#7: Dec 30 '05

re: boost::MultiIndex help


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Evan Carew wrote:[color=blue]
> Well, lets try this example source code:
>
>
> [snip]
> int main(){
> const people_set::nth_index<2>::type& resstreet_index=ps.get<2>();
> pair<people_set::iterator, people_set::iterator> range;
> range = resstreet_index.equal_range((*domoItor).first);
> }
>[/color]
By changing the pair instance to:

pair<people_set::nth_index<2>::type::iterator,
people_set::nth_index<2>::type::iterator> range;

I finally got it to compile. I managed this not by reading the tutorial
for the library (the information isn't there) but from reading the
rather prodigious code in multi_index. Yuck!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDtZ4LpxCQXwV2bJARAtFMAJ9BMmLq9uK8vO0EgmfqgR mN4tSMCwCcDzAf
IdDBBDb5CiMaZW6/pMsq9oE=
=iDdA
-----END PGP SIGNATURE-----
Closed Thread


Similar C / C++ bytes