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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Mar 17 16:01:24 CDT 2010


Author: kraftche
Date: 2010-03-17 16:01:23 -0500 (Wed, 17 Mar 2010)
New Revision: 3648

Modified:
   MOAB/trunk/src/Core.cpp
Log:
accept either old 'MB'-prefixed names or new names for MBCore::query_interface

Modified: MOAB/trunk/src/Core.cpp
===================================================================
--- MOAB/trunk/src/Core.cpp	2010-03-17 20:58:51 UTC (rev 3647)
+++ MOAB/trunk/src/Core.cpp	2010-03-17 21:01:23 UTC (rev 3648)
@@ -227,7 +227,7 @@
 
 ErrorCode Core::query_interface(const std::string& iface_name, void** iface)
 {
-  if(iface_name == "ReadUtilIface")
+  if(iface_name == "ReadUtilIface" || iface_name == "MBReadUtilIface")
   {
     if(mMBReadUtil)
       *iface = (ReadUtilIface*)mMBReadUtil;
@@ -235,7 +235,7 @@
       *iface = (ReadUtilIface*)(mMBReadUtil = new ReadUtil(this, mError));
     return MB_SUCCESS;
   }
-  else if(iface_name == "WriteUtilIface")
+  else if(iface_name == "WriteUtilIface" || iface_name == "MBWriteUtilIface")
   {
     if(mMBWriteUtil)
       *iface = (WriteUtilIface*)mMBWriteUtil;
@@ -243,7 +243,7 @@
       *iface = (WriteUtilIface*)(mMBWriteUtil = new WriteUtil(this, mError));
     return MB_SUCCESS;
   }
-  else if(iface_name == "ReaderWriterSet")
+  else if(iface_name == "ReaderWriterSet" || iface_name == "MBReaderWriterSet")
   {
     *iface = reader_writer_set();
     return MB_SUCCESS;
@@ -262,16 +262,16 @@
   if(iface == NULL)
     return MB_FAILURE;
 
-  if(iface_name == "ReadUtilIface")
+  if(iface_name == "ReadUtilIface" || iface_name == "MBReadUtilIface")
   {
       // Is it possible to crash here?  We should fail gracefully instead.
     return MB_SUCCESS;
   }
-  else if(iface_name == "WriteUtilIface")
+  else if(iface_name == "WriteUtilIface" || iface_name == "MBWriteUtilIface")
   {
     return MB_SUCCESS;
   }
-  else if(iface_name == "ReaderWriterSet")
+  else if(iface_name == "ReaderWriterSet" || iface_name == "MBReaderWriterSet")
   {
     return MB_SUCCESS;
   }



More information about the moab-dev mailing list