[MOAB-dev] r4063 - MOAB/trunk/src/moab

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Jul 21 17:29:24 CDT 2010


Author: kraftche
Date: 2010-07-21 17:29:24 -0500 (Wed, 21 Jul 2010)
New Revision: 4063

Modified:
   MOAB/trunk/src/moab/Range.hpp
Log:
add Range::iterator::start_of_block() analogous to existing end_of_block()

Modified: MOAB/trunk/src/moab/Range.hpp
===================================================================
--- MOAB/trunk/src/moab/Range.hpp	2010-07-21 22:28:37 UTC (rev 4062)
+++ MOAB/trunk/src/moab/Range.hpp	2010-07-21 22:29:24 UTC (rev 4063)
@@ -543,6 +543,21 @@
      * this iterator.
      */
     inline const_iterator end_of_block() const;
+    
+    /**\brief get an iterator at the start of the block
+     *
+     * Get an iterator at the start of the block of consecutive
+     * handles that this iterator is currently contained in.
+     * That is, if the range contains blocks of consecutive 
+     * handles of the form { [1,5], [7,100], ... } and this
+     * iterator is at any handle in the range [7,100], return
+     * an iterator at the '7' handle.
+     *
+     * Never returns end() unless this iterator is
+     * at end().  May return the same location as
+     * this iterator.
+     */
+    inline const_iterator start_of_block() const;
 
   protected:
 
@@ -795,6 +810,9 @@
 inline Range::const_iterator Range::const_iterator::end_of_block() const
   { return Range::const_iterator( mNode, mNode->second ); }
 
+inline Range::const_iterator Range::const_iterator::start_of_block() const
+  { return Range::const_iterator( mNode, mNode->first ); }
+
   //! get first entity in range
 inline const EntityHandle& Range::front() const
   { return mHead.mNext->first; }

















More information about the moab-dev mailing list