[MOAB-dev] r2997 - MOAB/trunk

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Mon Jul 13 17:35:41 CDT 2009


Author: kraftche
Date: 2009-07-13 17:35:40 -0500 (Mon, 13 Jul 2009)
New Revision: 2997

Modified:
   MOAB/trunk/MBRange.cpp
   MOAB/trunk/MBRange.hpp
Log:
add function to get number of pairs in MBRange

Modified: MOAB/trunk/MBRange.cpp
===================================================================
--- MOAB/trunk/MBRange.cpp	2009-07-13 22:35:16 UTC (rev 2996)
+++ MOAB/trunk/MBRange.cpp	2009-07-13 22:35:40 UTC (rev 2997)
@@ -68,6 +68,20 @@
   }
   return size;
 }
+/*! 
+  returns the number of pairs in the list
+ */
+MBEntityHandle MBRange::psize() const
+{
+  // go through each pair and add up the number of values
+  // we have.
+  MBEntityHandle size=0;
+  for(PairNode* iter = mHead.mNext; iter != &mHead; iter = iter->mNext)
+  {
+    ++size;
+  }
+  return size;
+}
 
 /*!
   advance iterator

Modified: MOAB/trunk/MBRange.hpp
===================================================================
--- MOAB/trunk/MBRange.hpp	2009-07-13 22:35:16 UTC (rev 2996)
+++ MOAB/trunk/MBRange.hpp	2009-07-13 22:35:40 UTC (rev 2997)
@@ -236,6 +236,9 @@
 
   //! return the number of values this Ranges represents
   MBEntityHandle size() const;
+
+  //! return the number of range pairs in the list
+  MBEntityHandle psize() const;
   
   //! return whether empty or not 
   //! always use "if(!Ranges::empty())" instead of "if(Ranges::size())"



More information about the moab-dev mailing list