Hi everybody,

 is it ok if I use iterator instead of iterator_const? I'm trying to loop
over all blocks to find a wasted block of appropriate size, and then I need
to return a pointer to that element. So what I'm trying to do is:

        typedef map::iterator   XBlockFileIterator;

        for( XBlockFileIterator iterator = menuMap.begin(); iterator !=
menuMap.end(); ++iterator )
        {
                entryID = iterator->first;
                vCurrentBlock = iterator->second;

                if( ((vCurrentBlock.flags & BLOCK_WASTED) == BLOCK_WASTED)
                        // It's a wasted block.
                        && ((vCurrentBlock.flags & BLOCK_RAM_ONLY) !=
BLOCK_RAM_ONLY) )
                {
                        if( vCurrentBlock.length >= inDesiredSize )
                        {
                                vReturnBlock = &iterator->second;
                                break;
                        }
                }
        }

I'm trying to get the current implementation to use a map, and when I have
that working I'll get bolder and try the approach with one map for each
block type in their own map. That's when the file format will probably
change and become smaller.

Cheers,
-- M. Uli Kusterer

------------------------------------------------------------
             http://www.weblayout.com/witness
       'The Witnesses of TeachText are everywhere...'

--- HELP SAVE HYPERCARD: ---
Details at: http://www.hyperactivesw.com/SaveHC.html
Sign: http://www.giguere.uqam.ca/petition/hcpetition.html

Reply via email to