[MOAB-dev] r1448 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Fri Dec 7 15:10:23 CST 2007


Author: kraftche
Date: 2007-12-07 15:10:23 -0600 (Fri, 07 Dec 2007)
New Revision: 1448

Modified:
   MOAB/trunk/MBCore.cpp
   MOAB/trunk/MBReadUtil.hpp
   MOAB/trunk/MBReaderIface.hpp
   MOAB/trunk/ReadGmsh.hpp
   MOAB/trunk/ReadSTL.hpp
   MOAB/trunk/ReadVtk.hpp
   MOAB/trunk/TypeSequenceManager.cpp
   MOAB/trunk/TypeSequenceManager.hpp
   MOAB/trunk/WriteHDF5.hpp
Log:
const fixed from Byron

Modified: MOAB/trunk/MBCore.cpp
===================================================================
--- MOAB/trunk/MBCore.cpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/MBCore.cpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -2983,7 +2983,7 @@
 void MBCore::print_database() const
 {
   MBErrorCode rval;
-  TypeSequenceManager::iterator i;
+  TypeSequenceManager::const_iterator i;
   const TypeSequenceManager& verts = sequence_manager()->entity_map(MBVERTEX);
   if (!verts.empty())
     printf("  Vertex ID  X        Y        Z        Adjacencies   \n"     

Modified: MOAB/trunk/MBReadUtil.hpp
===================================================================
--- MOAB/trunk/MBReadUtil.hpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/MBReadUtil.hpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -58,8 +58,8 @@
       const int num_elements, 
       const int verts_per_element,
       const MBEntityType mdb_type,
-      int preferred_start_id, 
-      int preferred_start_proc, 
+      const int preferred_start_id, 
+      const int preferred_start_proc, 
       MBEntityHandle& actual_start_handle, 
       MBEntityHandle*& array
       );

Modified: MOAB/trunk/MBReaderIface.hpp
===================================================================
--- MOAB/trunk/MBReaderIface.hpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/MBReaderIface.hpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -50,7 +50,7 @@
                                    MBEntityHandle& file_set,
                                    const FileOptions& opts,
                                    const int* material_set_list,
-                                   const int material_set_list_len ) = 0;
+                                   int material_set_list_len ) = 0;
 
 };
 

Modified: MOAB/trunk/ReadGmsh.hpp
===================================================================
--- MOAB/trunk/ReadGmsh.hpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/ReadGmsh.hpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -42,7 +42,7 @@
                         MBEntityHandle& file_set,
                         const FileOptions& opts,
                         const int* material_set_list,
-                        const int num_material_sets );
+                        int num_material_sets );
   
     //! Constructor
   ReadGmsh(MBInterface* impl = NULL);

Modified: MOAB/trunk/ReadSTL.hpp
===================================================================
--- MOAB/trunk/ReadSTL.hpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/ReadSTL.hpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -75,7 +75,7 @@
                         MBEntityHandle& file_set,
                         const FileOptions& opts,
                         const int* material_set_list,
-                        const int num_material_sets );
+                        int num_material_sets );
   
     //! Constructor
   ReadSTL(MBInterface* impl = NULL);

Modified: MOAB/trunk/ReadVtk.hpp
===================================================================
--- MOAB/trunk/ReadVtk.hpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/ReadVtk.hpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -34,7 +34,7 @@
                         MBEntityHandle& file_set,
                         const FileOptions&,
                         const int* material_set_list,
-                        const int num_material_sets );
+                        int num_material_sets );
   
     //! Constructor
   ReadVtk(MBInterface* impl = NULL);

Modified: MOAB/trunk/TypeSequenceManager.cpp
===================================================================
--- MOAB/trunk/TypeSequenceManager.cpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/TypeSequenceManager.cpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -550,7 +550,7 @@
 MBErrorCode TypeSequenceManager::check_valid_handles( MBEntityHandle first,
                                                       MBEntityHandle last ) const
 {
-  iterator i = lower_bound( first );
+  const_iterator i = lower_bound( first );
   if (i == end() || (*i)->start_handle() > first)
     return MB_ENTITY_NOT_FOUND;
 

Modified: MOAB/trunk/TypeSequenceManager.hpp
===================================================================
--- MOAB/trunk/TypeSequenceManager.hpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/TypeSequenceManager.hpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -133,9 +133,11 @@
 
     /**\brief Start of EntitySequence set */
   const_iterator begin() const { return sequenceSet.begin(); }
+  iterator begin() { return sequenceSet.begin(); }
 
     /**\brief End of EntitySequence set */
   const_iterator   end() const { return sequenceSet.end();   }
+  iterator   end() { return sequenceSet.end();   }
 
     /**\brief Return EntitySequence for specified handle.
      *
@@ -148,6 +150,11 @@
       DummySequence f(h);
       return sequenceSet.lower_bound( &f ); 
     }
+  iterator lower_bound( MBEntityHandle h )
+    { 
+      DummySequence f(h);
+      return sequenceSet.lower_bound( &f ); 
+    }
 
     /**\brief Return EntitySequence after specified handle.
      *
@@ -166,6 +173,7 @@
      *\return EntitySequence for handle, or NULL if no such sequence.
      */
   inline EntitySequence* find( MBEntityHandle h ) const;
+  inline EntitySequence* find( MBEntityHandle h );
   inline MBErrorCode find( MBEntityHandle h, EntitySequence*& );
   inline MBErrorCode find( MBEntityHandle h, const EntitySequence*& ) const;
   
@@ -335,6 +343,18 @@
     return lastReferenced;
   else {
     DummySequence seq(h);
+    const_iterator i = sequenceSet.find( &seq );
+    return i == end() ? 0 : (lastReferenced = *i);
+  }
+}   
+inline EntitySequence* TypeSequenceManager::find( MBEntityHandle h )
+{
+  if (!lastReferenced) // only null if empty
+    return 0;
+  else if (h >= lastReferenced->start_handle() && h <= lastReferenced->end_handle())
+    return lastReferenced;
+  else {
+    DummySequence seq(h);
     iterator i = sequenceSet.find( &seq );
     return i == end() ? 0 : (lastReferenced = *i);
   }
@@ -376,7 +396,7 @@
   }
   else {
     DummySequence ds(h);
-    iterator i = sequenceSet.lower_bound( &ds );
+    const_iterator i = sequenceSet.lower_bound( &ds );
     if (i == end() || (*i)->start_handle() > h ) {
       seq = 0;
       return MB_ENTITY_NOT_FOUND;

Modified: MOAB/trunk/WriteHDF5.hpp
===================================================================
--- MOAB/trunk/WriteHDF5.hpp	2007-12-07 20:59:52 UTC (rev 1447)
+++ MOAB/trunk/WriteHDF5.hpp	2007-12-07 21:10:23 UTC (rev 1448)
@@ -60,7 +60,7 @@
    * \param export_set_count Length of <code>export_sets</code> array.
    */
   MBErrorCode write_file( const char* filename,
-                          bool overwrite,
+                          const bool overwrite,
                           const FileOptions& opts,
                           const MBEntityHandle* export_sets,
                           const int export_set_count,




More information about the moab-dev mailing list