[GME-commit] GMESRC/GME/Mga MgaLibOps.h,1.4,1.5 MgaLibOps.cpp,1.15,1.16 MgaLibRefr.cpp,1.3,1.4

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu Jan 25 17:48:33 CST 2007


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

Modified Files:
	MgaLibOps.h MgaLibOps.cpp MgaLibRefr.cpp 
Log Message:
Refresh bugs (connection duplication removed in certain subtypes) fixed.
Dependency information maintanence improved.



CVS User: Zoltan Molnar, ISIS (zolmol)

Index: MgaLibRefr.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Mga/MgaLibRefr.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MgaLibRefr.cpp	18 Jan 2007 16:54:10 -0000	1.3
--- MgaLibRefr.cpp	25 Jan 2007 17:48:30 -0000	1.4
***************
*** 299,304 ****
  			VARIANT_BOOL in_lib;
  			COMTHROW( owner->get_IsLibObject( &in_lib));
! 			if( in_lib == VARIANT_TRUE) // the connection also in the library
! 				continue;
  
  			CComPtr<IMgaFCO> myself;
--- 299,316 ----
  			VARIANT_BOOL in_lib;
  			COMTHROW( owner->get_IsLibObject( &in_lib));
! 			
! 			elem_struct elem_conn;
! 			getElemDetails( CComQIPtr<IMgaFCO>( owner), elem_conn);
! 			if( in_lib == VARIANT_TRUE && elem_conn.inlib) // which lib? it matters!
! 			{
! 				if( elem_conn.uid.libId == Identifier::getLibRootOf( one_fco))
! 					continue;
! 				else
! 					if( m_changedLibs.end() == std::find( m_changedLibs.begin(), m_changedLibs.end(), elem_conn.uid.libId))
! 						m_changedLibs.push_back( elem_conn.uid.libId);
! 			}
! 
! 			/*if( in_lib == VARIANT_TRUE) // the connection also in the library
! 				continue;*/
  
  			CComPtr<IMgaFCO> myself;
***************
*** 313,318 ****
  			// then no need to store it, since its base will be recreated
  			// and then the change propagated down into this place
! 			if( one_conn.is_derived && one_conn.is_sec_derived && !one_conn.baseConnInLib)
! 				continue;
  
  			// even a sec-derd connection from library needs to be stored
--- 325,335 ----
  			// then no need to store it, since its base will be recreated
  			// and then the change propagated down into this place
! 			if( one_conn.is_derived && one_conn.is_sec_derived)
! 			{
! 				if( one_conn.baseConnId.libId != Identifier::getLibRootOf( one_fco)) // which lib? it matters!
! 					continue;
! 			}
! 			/*if( one_conn.is_derived && one_conn.is_sec_derived && !one_conn.baseConnInLib)
! 				continue;*/
  
  			// even a sec-derd connection from library needs to be stored
***************
*** 504,507 ****
--- 521,527 ----
  				MyCComBSTR msg;
  				msg.appendLink( new_conn); 
+ #ifdef _DEBUG
+ 				//CComBSTR ncid; new_conn->get_ID( &ncid); msg.AppendBSTR( ncid);if( current_i.is_derived && current_i.is_sec_derived) msg.Append( L" napofsec "); else msg.Append( L" reg ");
+ #endif
  				msg.Append( L" reconstructed in "); 
  				msg.appendLink( pM);
***************
*** 1219,1222 ****
--- 1239,1259 ----
  	getConnectionDetails( owner, one_conn);
  
+ 	// check if connection is (or precisely: was) secondary derived
+ 	SEC_DER_NAP::const_iterator it = napOfSecondaryDeriveds.find( p_cn);
+ 	if( it != napOfSecondaryDeriveds.end()) // found
+ 	{
+ 		ASSERT( !one_conn.is_derived);
+ 		// when this occurs relations are already cut
+ 		// that is why getConnectionDetails reported
+ 		// that one_conn is NOT derived (is_derived=false)
+ 		// but based on the napOfSecondaryDeriveds we can
+ 		// confirm that it is derived, and the connection
+ 		// will be saved altered into conns_stored
+ 		one_conn.is_derived = true;
+ 		one_conn.is_sec_derived = true;
+ 		one_conn.baseConnId = it->second;
+ 		one_conn.baseConnInLib = true;
+ 	}
+ 
  	// if sec derived from a project conn (non library conn)
  	// then no need to store it, since its base will be recreated
***************
*** 2244,2248 ****
  
  			// add the dependency info to the includes list
! 			Ozer::addIncludes( libroot, id);
  		}
  	}
--- 2281,2285 ----
  
  			// add the dependency info to the includes list
! 			//done elsewhere: //Ozer::addIncludes( libroot, id);
  		}
  	}
***************
*** 2436,2439 ****
--- 2473,2486 ----
  #if(DONT_OPTIM)
  									mapOfSecondaryDeriveds [ my_id ] = base_guid;
+ #endif
+ #ifdef _DEBUG
+ 									//MyCComBSTR m;
+ 									//m.Append( my_id);
+ 									//m.Append( L" ----::---- ");
+ 									//if( primDer != VARIANT_TRUE) 
+ 									//	m.Append( L" napOfSec");
+ 									//else
+ 									//	m.Append( L" nop");
+ 									//m_reporter.show( m);
  #endif
  									// check if its really a secondary derived object

Index: MgaLibOps.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Mga/MgaLibOps.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** MgaLibOps.cpp	18 Jan 2007 16:54:10 -0000	1.15
--- MgaLibOps.cpp	25 Jan 2007 17:48:30 -0000	1.16
***************
*** 738,743 ****
  				// it does something only in No-optimized refresh case !!!
  				Ozer::copyIncludedBy( self, libimgroot);
! 				Ozer::removeDepForAll( mgaproject, corerf, self, false);
! 				Ozer::removeDepForAll( mgaproject, corerf, self, true);
  
  				inDeleteObject();
--- 738,743 ----
  				// it does something only in No-optimized refresh case !!!
  				Ozer::copyIncludedBy( self, libimgroot);
! 				Ozer::syncRelForAll( mgaproject, corerf, self, libimgroot, false);
! 				Ozer::syncRelForAll( mgaproject, corerf, self, libimgroot, true);
  
  				inDeleteObject();
***************
*** 1014,1020 ****
  }
  
! void Ozer::loserForAll( CMgaProject*               p_mgaproject
                        , CoreObj&                   p_libimgroot
! 					  , const std::string&         p_tokenizable
                        , bool                       p_incOrIncBy)
  {
--- 1014,1021 ----
  }
  
! void Ozer::findReplace( CMgaProject*               p_mgaproject
                        , CoreObj&                   p_libimgroot
!                       , CoreObj&                   p_newlibimgroot
!                       , const std::string&         p_tokenizable
                        , bool                       p_incOrIncBy)
  {
***************
*** 1022,1025 ****
--- 1023,1029 ----
  	ObjForCore( p_libimgroot)->get_ID( &lib_id_to_remove);
  	
+ 	CComBSTR lib_id_to_add;
+ 	ObjForCore( p_newlibimgroot)->get_ID( &lib_id_to_add);
+ 	
  	const std::string& includes_vals = p_tokenizable;
  
***************
*** 1043,1047 ****
  		{
  			bool lib_freed = false;
! 			bool all_right = Ozer::loseIncludedBy(  lib, lib_id_to_remove, p_incOrIncBy, lib_freed);
  		}
  	}
--- 1047,1054 ----
  		{
  			bool lib_freed = false;
! 			bool all_right = Ozer::loseRelation( lib, lib_id_to_remove, p_incOrIncBy, lib_freed);
! 
! 			if( !p_incOrIncBy) // includedBy case
! 				Ozer::addIncludes( lib, lib_id_to_add);
  		}
  	}
***************
*** 1049,1055 ****
  }
  
! void Ozer::removeDepForAll( CMgaProject* p_mgaproject
                            , CoreObj&     p_rootfolder
                            , CoreObj&     p_libimgroot
                            , bool         p_depsOrIncs)
  {
--- 1056,1063 ----
  }
  
! void Ozer::syncRelForAll  ( CMgaProject* p_mgaproject
                            , CoreObj&     p_rootfolder
                            , CoreObj&     p_libimgroot
+                           , CoreObj&     p_newlibimgroot
                            , bool         p_depsOrIncs)
  {
***************
*** 1058,1065 ****
  	else              Ozer::StorageMgr::getIncludedBy( p_libimgroot, valb);
  
! 	std::string vals;
!     CopyTo( valb, vals);
  
! 	loserForAll( p_mgaproject, p_libimgroot, vals, p_depsOrIncs);
  
  
--- 1066,1079 ----
  	else              Ozer::StorageMgr::getIncludedBy( p_libimgroot, valb);
  
! 	if( valb && valb.Length() > 0)
! 	{
! 		std::string vals;
! 		CopyTo( valb, vals);
  
! 		// libs enumerated in vals will loose all referrals to p_libimgroot
! 		// and will get a new referral to p_newlibimgroot (in case of the
! 		// inclusions)
! 		findReplace( p_mgaproject, p_libimgroot, p_newlibimgroot, vals, p_depsOrIncs);
! 	}
  
  
***************
*** 1124,1128 ****
  }
  
! bool Ozer::loseIncludedBy( CoreObj&          p_fldCore
                           , const CComBSTR&   p_idToRemoveFromReg
                           , bool              p_incOrIncBy
--- 1138,1142 ----
  }
  
! bool Ozer::loseRelation  ( CoreObj&          p_fldCore
                           , const CComBSTR&   p_idToRemoveFromReg
                           , bool              p_incOrIncBy
***************
*** 1292,1296 ****
--- 1306,1321 ----
  	Ozer::StorageMgr::getIncludedBy( p_oldLib, list);
  	if( list && list.Length() > 0) // save info if not empty
+ 	{
+ 		CComBSTR val;
+ 		Ozer::StorageMgr::getIncludedBy( p_newLib, val);
+ 		if( val && val.Length() > 0)
+ 		{
+ 			list.Append( L"\n");
+ 			list.AppendBSTR( val);
+ 		}
  		Ozer::StorageMgr::setIncludedBy( p_newLib, list);
+ 	}
+ 
+ 	// what about refreshing the idlist of these containing libs?
  }
  

Index: MgaLibOps.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Mga/MgaLibOps.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MgaLibOps.h	18 Jan 2007 16:54:10 -0000	1.4
--- MgaLibOps.h	25 Jan 2007 17:48:30 -0000	1.5
***************
*** 166,170 ****
                             , const CComBSTR&       p_idToAddToReg);
  
! 	static bool loseIncludedBy( CoreObj&          p_fldCore
  	                          , const CComBSTR&   p_idToRemoveFromReg
  	                          , bool              p_incOrIncBy
--- 166,170 ----
                             , const CComBSTR&       p_idToAddToReg);
  
! 	static bool loseRelation  ( CoreObj&          p_fldCore
  	                          , const CComBSTR&   p_idToRemoveFromReg
  	                          , bool              p_incOrIncBy
***************
*** 174,184 ****
  	                          , CoreObj&     p_newLib);
  
! 	static void removeDepForAll( CMgaProject* p_mgaproject
  	                           , CoreObj&     p_rootfolder
  	                           , CoreObj&     p_libimgroot
  	                           , bool         p_depsOrIncs);
  
! 	static void loserForAll( CMgaProject*              p_mgaproject
  	                       , CoreObj&                  p_libimgroot
  	                       , const std::string&        p_tokenizable
  	                       , bool                      p_incOrIncBy);
--- 174,186 ----
  	                          , CoreObj&     p_newLib);
  
! 	static void syncRelForAll  ( CMgaProject* p_mgaproject
  	                           , CoreObj&     p_rootfolder
  	                           , CoreObj&     p_libimgroot
+ 	                           , CoreObj&     p_newlibimgroot
  	                           , bool         p_depsOrIncs);
  
! 	static void findReplace( CMgaProject*              p_mgaproject
  	                       , CoreObj&                  p_libimgroot
+ 	                       , CoreObj&                  p_newlibimgroot
  	                       , const std::string&        p_tokenizable
  	                       , bool                      p_incOrIncBy);



More information about the GME-commit mailing list