boost::MultiIndex help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Evan Carew

    #1

    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.multiinde x 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

    iD8DBQFDtDRCpxC QXwV2bJARAiBuAK CIxIcgHh0YVcSuC XkXDFaOuLYiugCg tUlu
    ZC3C2hNJgI5R8v9 kyU0Ijmg=
    =tV0D
    -----END PGP SIGNATURE-----
  • mlimber

    #2
    Re: boost::MultiInd ex 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.multiinde x 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:



    Cheers! --M

    Comment

    • Joaquín M López Muñoz

      #3
      Re: boost::MultiInd ex 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.multiinde x 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_con tainer
      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

      Comment

      • Evan Carew

        #4
        Re: boost::MultiInd ex 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.multiin dex 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

        iD8DBQFDtXTwpxC QXwV2bJARAupjAK C1+BA34JrCIUQ9S VrRWdT38qc4bgCf Ykgw
        Of08FH9zlAOzGIa anvoFXms=
        =Pf1n
        -----END PGP SIGNATURE-----

        Comment

        • Evan Carew

          #5
          Re: boost::MultiInd ex 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

          iD8DBQFDtZgGpxC QXwV2bJARAu3eAJ wPdPeGc1A0s4rDg y+DWhtGnLFjhACg kiPq
          V6rbwqzWTHv2yhO E6zTiQO0=
          =ertA
          -----END PGP SIGNATURE-----

          Comment

          • Evan Carew

            #6
            Re: boost::MultiInd ex help

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

            Well, lets try this example source code:


            typedef multi_index::mu lti_index_conta iner<
            person,
            multi_index::in dexed_by<
            multi_index::or dered_unique<
            multi_index::ta g<voterid>,
            BOOST_MULTI_IND EX_MEMBER(perso n,unsigned long,voterid)>,
            multi_index::or dered_non_uniqu e<

            multi_index::ta g<lastname>,BOO ST_MULTI_INDEX_ MEMBER(person,s tring,lastname) >,
            multi_index::or dered_non_uniqu e<
            multi_index::ta g<resstreetnum> ,
            BOOST_MULTI_IND EX_MEMBER(perso n,int,resstreet num)> >[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::ite rator> 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

            iD8DBQFDtZkEpxC QXwV2bJARAiFyAJ 0SlA2q8ls4SQ/jhep7suC8/Fd7hACcCP2E
            2lyn3/OmjYl7hKWbZcaqT fM=
            =ry4Y
            -----END PGP SIGNATURE-----

            Comment

            • Evan Carew

              #7
              Re: boost::MultiInd ex 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::ite rator> 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

              iD8DBQFDtZ4LpxC QXwV2bJARAtFMAJ 9BMmLq9uK8vO0Eg mfqgRmN4tSMCwCc DzAf
              IdDBBDb5CiMaZW6/pMsq9oE=
              =iDdA
              -----END PGP SIGNATURE-----

              Comment

              Working...