473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

boost::MultiIndex help

-----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-----
Dec 29 '05 #1
6 3561
Evan Carew wrote:
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?


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

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

Cheers! --M

Dec 29 '05 #2

Evan Carew ha escrito:
-----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?


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

Dec 30 '05 #3
-----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:
Evan Carew wrote:
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?

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

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

Cheers! --M


-----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-----
Dec 30 '05 #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Evan Carew wrote:
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

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-----
Dec 30 '05 #5
-----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)> >
people_set;


......

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-----
Dec 30 '05 #6
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Evan Carew wrote:
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);
}

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-----
Dec 30 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: To Forum | last post by:
Hi, My problem is the following 1/ I install Python 2.4 at D:\Programs\Python24 using the binary file from www.python.org 2/ following the document from the boost.org I type the command ...
1
by: Hardy | last post by:
Hi, just come into the boost world. just the first.cpp in the program_options examples, with many link error... devc++4.9.9.2, gcc 3.4.2, can I get your opinions on this problem? thank you~ ...
0
by: ufnuceda | last post by:
Hello everyone, I was wondering if any of you have some experience with the boost library. I am having trouble compiling code with it. Since boost is being used a lot these days I thought some...
1
by: å¼ æ²ˆé¹ | last post by:
How to compile the HelloWorld of boost.asio? Maybe this is a stupid problem , but I really don't konw how to find the right way. My compile environment is WinXP, Msys , MinGw , G++ 3.4.2,...
5
by: FBergemann | last post by:
I use SunOS 5.8, gcc 3.3.2, boost 1.33.1. I have build the entire boost package and try to compile a simple example: #include <iostream> #include <string> #include <boost/regex.hpp //...
3
by: TonyHa | last post by:
Hello I try to install boost_1_33_1 on RedHat Linux. I have downloaded boost into /user/dtgtools/tmp and I try to install it into /user/dtgtools/packages/boost. I use the following commands:...
3
by: Stephen Torri | last post by:
Below is a class that is suppose to represent a segment of memory or a contents of a binary image (e.g. ELF executable). I have started to read Modern C++ Design and thought the best way to ensure...
2
by: Man4ish | last post by:
I have created Graph object without vertex and edge property.It is working fine. #include <boost/config.hpp> #include <iostream> #include <vector> #include <string> #include...
1
by: Tim H | last post by:
Compiling with g++ 4: This line: if_then_else_return(_1 == 0, 64, _1) When called with a bignum class as an argument yields: /usr/include/boost/lambda/if.hpp: In member function 'RET...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.