[GME-commit] GMESRC/GME/Mga MgaComplexOps.cpp,1.21,1.22

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Mon Oct 9 19:07:52 CDT 2006


Update of /project/gme-repository/GMESRC/GME/Mga
In directory escher:/tmp/cvs-serv22640

Modified Files:
	MgaComplexOps.cpp 
Log Message:
DetachFromArcheType stores archetype's guid in registry for future use.
AttachToArcheType checks whether this valid guid exists in registry, unamiguous match might be performed.
If no guid found in registry the plain old name + role based matching is used.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: MgaComplexOps.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Mga/MgaComplexOps.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** MgaComplexOps.cpp	19 Sep 2006 16:34:31 -0000	1.21
--- MgaComplexOps.cpp	9 Oct 2006 18:07:50 -0000	1.22
***************
*** 5,9 ****
  #include "MgaComplexOps.h"
  #include "MgaSet.h"
! 
  /////////////////////////////////////////////////////////////////////////////////////////////////////
  /////////////////////////////////// DELETE //////////////////////////////////////////////////////////
--- 5,9 ----
  #include "MgaComplexOps.h"
  #include "MgaSet.h"
! #define DETACHED_FROM "_detachedFrom"
  /////////////////////////////////////////////////////////////////////////////////////////////////////
  /////////////////////////////////// DELETE //////////////////////////////////////////////////////////
***************
*** 1508,1511 ****
--- 1508,1518 ----
  					case ATTRID_MASTEROBJ:
  					{
+ 						CoreObj nmas = nobj[ai];
+ 						if( nobj.IsFCO() && nmas.IsFCO()) // save its master's guid into registry
+ 						{
+ 							CComBSTR bstr;
+ 							ObjForCore( nmas)->GetGuidDisp( &bstr);
+ 							if( bstr) ObjForCore( nobj)->put_RegistryValue( CComBSTR( DETACHED_FROM), bstr);
+ 						}
  						nobj[ai] = CComVariant( (IDispatch*) 0);//an empty value;
  						break;
***************
*** 1734,1739 ****
  						std::map< int, int> match;
  						std::map< CoreObj, CoreObj> matchO;
! 						std::vector<metaref_type> kidsVec, kidsVec2;
! 						std::vector<std::string> nameVec, nameVec2;
  						
  						unsigned int kids_o = 0;
--- 1741,1746 ----
  						std::map< int, int> match;
  						std::map< CoreObj, CoreObj> matchO;
! 						//std::vector<metaref_type> kidsVec, kidsVec2;
! 						//std::vector<std::string> nameVec, nameVec2;
  						
  						unsigned int kids_o = 0;
***************
*** 1742,1751 ****
  							++kids_o;
  							metaref_type role_i = ITER[ATTRID_META];
! 							kidsVec.push_back( role_i);
  							
  							CComBSTR nm_i;
  							ObjForCore(ITER)->get_Name( &nm_i);
! 							std::string nm_ii; CopyTo( nm_i, nm_ii);
! 							nameVec.push_back( nm_ii);
  
  							CoreObj outer_ITER = ITER;
--- 1749,1761 ----
  							++kids_o;
  							metaref_type role_i = ITER[ATTRID_META];
! 							//kidsVec.push_back( role_i);
  							
  							CComBSTR nm_i;
  							ObjForCore(ITER)->get_Name( &nm_i);
! 							//std::string nm_ii; CopyTo( nm_i, nm_ii);
! 							//nameVec.push_back( nm_ii);
! 
! 							CComBSTR gd_i;
! 							ObjForCore(ITER)->GetGuidDisp( &gd_i);
  
  							CoreObj outer_ITER = ITER;
***************
*** 1756,1767 ****
  								++kids_n;
  								metaref_type role_j = ITER[ATTRID_META];
! 								kidsVec2.push_back( role_j);
  								
  								CComBSTR nm_j;
  								ObjForCore(ITER)->get_Name( &nm_j);
! 								std::string nm_jj; CopyTo( nm_j, nm_jj);
! 								nameVec2.push_back( nm_jj);
  								
! 								if( nm_j == nm_i && role_i == role_j 
  									&& match.find(kids_n) == match.end()) // not found <==> not assigned
  								{
--- 1766,1783 ----
  								++kids_n;
  								metaref_type role_j = ITER[ATTRID_META];
! 								//kidsVec2.push_back( role_j);
  								
  								CComBSTR nm_j;
  								ObjForCore(ITER)->get_Name( &nm_j);
! 								//std::string nm_jj; CopyTo( nm_j, nm_jj);
! 								//nameVec2.push_back( nm_jj);
! 
! 								CComBSTR gd_j;
! 								ObjForCore(ITER)->get_RegistryValue( CComBSTR( DETACHED_FROM), &gd_j);
  								
! 								// name based equality is considered only if 
! 								// no stored master guid (Detached from) was found
! 								if( ( gd_j == gd_i && gd_j.Length() > 0 || nm_j == nm_i && gd_j.Length() == 0) 
! 									&& role_i == role_j 
  									&& match.find(kids_n) == match.end()) // not found <==> not assigned
  								{



More information about the GME-commit mailing list