[MOAB-dev] r4174 - MOAB/trunk/src

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Sep 28 09:54:55 CDT 2010


Author: kraftche
Date: 2010-09-28 09:54:54 -0500 (Tue, 28 Sep 2010)
New Revision: 4174

Modified:
   MOAB/trunk/src/BitTagServer.cpp
   MOAB/trunk/src/BitTagServer.hpp
Log:
fix bug in bit tag server

Modified: MOAB/trunk/src/BitTagServer.cpp
===================================================================
--- MOAB/trunk/src/BitTagServer.cpp	2010-09-28 12:43:44 UTC (rev 4173)
+++ MOAB/trunk/src/BitTagServer.cpp	2010-09-28 14:54:54 UTC (rev 4174)
@@ -60,10 +60,10 @@
 }
 
 ErrorCode BitTagServer::get_tags( EntityHandle entity,  
-                                    std::vector<Tag> &tags ) const
+                                  std::vector<Tag> &tags ) const
 {
-  for (size_t i = 0; i < tagList.size(); ++i)
-    if (tagList[i].in_use())
+  for (size_t i = 0; i < tagList.size(); ++i) 
+    if (tagList[i].in_use() && tagList[i].is_tagged(entity))
       tags.push_back( (Tag)(i+1) );
   return MB_SUCCESS;
 }
@@ -334,7 +334,7 @@
       EntityHandle last = h + per_page - 1;
         // never zero ID
       if (!id) ++h;
-      hint = entities.insert( h, last );
+      hint = entities.insert( hint, h, last );
     }
   }
   return MB_SUCCESS;

Modified: MOAB/trunk/src/BitTagServer.hpp
===================================================================
--- MOAB/trunk/src/BitTagServer.hpp	2010-09-28 12:43:44 UTC (rev 4173)
+++ MOAB/trunk/src/BitTagServer.hpp	2010-09-28 14:54:54 UTC (rev 4174)
@@ -233,6 +233,8 @@
                                    EntityType type,
                                    int& num_entities ) const;
   
+  bool is_tagged( EntityHandle h ) const;
+  
   ErrorCode get_memory_use( unsigned long& total,
                               unsigned long& per_entity ) const;
                               
@@ -462,6 +464,14 @@
     set_bits( offset++, per_ent, value );
 }
 
+inline bool BitTag::is_tagged( EntityHandle h ) const
+{
+  EntityType type;
+  size_t page;
+  int offset;
+  unpack( h, type, page, offset );


More information about the moab-dev mailing list