[MOAB-dev] r1523 - MOAB/trunk
kraftche at mcs.anl.gov
kraftche at mcs.anl.gov
Mon Jan 14 14:54:05 CST 2008
Author: kraftche
Date: 2008-01-14 14:54:05 -0600 (Mon, 14 Jan 2008)
New Revision: 1523
Modified:
MOAB/trunk/SparseTagCollections.cpp
MOAB/trunk/SparseTagCollections.hpp
MOAB/trunk/TagServer.cpp
MOAB/trunk/TagServer.hpp
Log:
remove unused find_entity function
Modified: MOAB/trunk/SparseTagCollections.cpp
===================================================================
--- MOAB/trunk/SparseTagCollections.cpp 2008-01-14 20:53:16 UTC (rev 1522)
+++ MOAB/trunk/SparseTagCollections.cpp 2008-01-14 20:54:05 UTC (rev 1523)
@@ -114,13 +114,6 @@
}
-MBEntityHandle SparseTagSuperCollection::find_entity( const MBTagId tag_handle, const void* data )
-{
- SparseTagCollection* coll = get_collection(tag_handle);
- return coll ? coll->find_entity( data ) : MB_TAG_NOT_FOUND;
-}
-
-
//! gets all entity handles that match a type and tag
MBErrorCode SparseTagSuperCollection::get_entities(const MBTagId tag_handle, const MBEntityType type,
MBRange &entities)
@@ -325,21 +318,6 @@
}
-
-MBEntityHandle SparseTagCollection::find_entity( const void* data )
-{
- std::map<MBEntityHandle, void*>::iterator iterator;
- for(iterator = mData.begin();
- iterator != mData.end();
- iterator++)
- {
- if(memcmp(data, iterator->second, mDataSize) == 0)
- return iterator->first;
- }
-
- return 0;
-}
-
//! get number of entities of type
MBErrorCode SparseTagCollection::get_number_entities(MBEntityType type, int& num_entities)
{
Modified: MOAB/trunk/SparseTagCollections.hpp
===================================================================
--- MOAB/trunk/SparseTagCollections.hpp 2008-01-14 20:53:16 UTC (rev 1522)
+++ MOAB/trunk/SparseTagCollections.hpp 2008-01-14 20:54:05 UTC (rev 1523)
@@ -83,9 +83,6 @@
//! removes the data
MBErrorCode remove_data(const MBEntityHandle entity_handle);
-
- //! finds the first entity handle that matches this data
- MBEntityHandle find_entity( const void* data );
//! get number of entities of type
MBErrorCode get_number_entities(MBEntityType type, int& num_entities);
@@ -171,9 +168,6 @@
//! removes data
MBErrorCode remove_data(const MBTagId tag_handle, const MBEntityHandle entity_handle);
-
- //! finds the entity handle with this data
- MBEntityHandle find_entity( const MBTagId tag_handle, const void* data );
//! gets all entity handles that match a type and tag
MBErrorCode get_entities(const MBTagId tag_handle, MBRange &entities);
Modified: MOAB/trunk/TagServer.cpp
===================================================================
--- MOAB/trunk/TagServer.cpp 2008-01-14 20:53:16 UTC (rev 1522)
+++ MOAB/trunk/TagServer.cpp 2008-01-14 20:54:05 UTC (rev 1523)
@@ -665,23 +665,6 @@
}
-MBEntityHandle TagServer::find_entity( const MBTag tag_handle, const void* data )
-{
-
- if(PROP_FROM_TAG_HANDLE(tag_handle) == MB_TAG_SPARSE)
- {
- return mSparseData->find_entity(ID_FROM_TAG_HANDLE(tag_handle), data);
- }
- else if (PROP_FROM_TAG_HANDLE(tag_handle) == MB_TAG_DENSE)
- {
- // todo: call RMS find entity
- return 0;
- }
- else
- return 0;
-
-}
-
//! gets all entity handles that match a type and tag
MBErrorCode TagServer::get_entities(const MBTag tag_handle, const MBEntityType type,
MBRange &entities)
@@ -1078,7 +1061,9 @@
// test the find_entity function. This test succeeds on failure
tag_data[0] = rand();
tag_server.set_data(my_tag_handle, 200, tag_data);
- assert( 200 != tag_server.find_entity(my_tag_handle, tag_data));
+ MBRange tmp_range;
+ tag_server.get_entities_with_tag_value( TYPE_FROM_HANDLE(200), my_tag_handle, tag_data, tmp_range );
+ assert( tmp_range.size() == 1 && tmp_range.begin() == 200 );
for( int i=0; i<SET_TAG_LOOPS; i++ )
{
Modified: MOAB/trunk/TagServer.hpp
===================================================================
--- MOAB/trunk/TagServer.hpp 2008-01-14 20:53:16 UTC (rev 1522)
+++ MOAB/trunk/TagServer.hpp 2008-01-14 20:54:05 UTC (rev 1523)
@@ -163,9 +163,6 @@
const MBTag tag_handle, const MBEntityType type,
int& num_entities);
- //! finds the first entity handle that matches this data
- MBEntityHandle find_entity( const MBTag tag_handle, const void* data );
-
//! gets a tag handle by name and entity handle
MBTag get_handle(const char *tag_name) const;
More information about the moab-dev
mailing list