[GME-commit] GMESRC/GME/MgaUtil MakeClosure.cpp,1.7,1.8

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Aug 11 13:00:58 CDT 2004


Update of /var/lib/gme/GMESRC/GME/MgaUtil
In directory braindrain:/tmp/cvs-serv26339

Modified Files:
	MakeClosure.cpp 
Log Message:
Bug corrected: where to can the closure be inserted.


CVS User: zolmol

Index: MakeClosure.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/MgaUtil/MakeClosure.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** MakeClosure.cpp	3 Aug 2004 21:20:12 -0000	1.7
--- MakeClosure.cpp	11 Aug 2004 17:00:56 -0000	1.8
***************
*** 282,287 ****
  		for( unsigned int j = curr_start; j < m_selFolds.size() && i != m_selFolds.end(); ++j, ++i)
  		{
- 			CComBSTR name;
- 			COMTHROW( m_selFolds[j]->get_AbsPath( &name));
  			procObj( m_selFolds[j]);
  		}
--- 282,285 ----
***************
*** 1211,1215 ****
  	// looking for potential folder containers
  	unsigned int how_many_libraries = 0;
! 	set < string > goody;
  	for( CComObjPtrVector<IMgaFolder>::iterator fold_it = m_topFolds.begin(); fold_it != m_topFolds.end(); ++fold_it)
  	{
--- 1209,1214 ----
  	// looking for potential folder containers
  	unsigned int how_many_libraries = 0;
! 	set < string > goody_folds;
! 	bool goody_folds_init_done = false;
  	for( CComObjPtrVector<IMgaFolder>::iterator fold_it = m_topFolds.begin(); fold_it != m_topFolds.end(); ++fold_it)
  	{
***************
*** 1244,1256 ****
  
  		// calculate the intersection of the possible parent folders
! 		if ( goody.empty())
  		{
! 			goody = actual;
  		}
  		else
  		{
! 			set < string > res;
! 			set_intersection( goody.begin(), goody.end(), actual.begin(), actual.end(), inserter( res, res.begin()));
! 			goody = res;
  		}
  	}
--- 1243,1256 ----
  
  		// calculate the intersection of the possible parent folders
! 		if ( goody_folds_init_done)
  		{
! 			set < string > res;
! 			set_intersection( goody_folds.begin(), goody_folds.end(), actual.begin(), actual.end(), inserter( res, res.begin()));
! 			goody_folds = res;
  		}
  		else
  		{
! 			goody_folds = actual;
! 			goody_folds_init_done = true;
  		}
  	}
***************
*** 1276,1289 ****
  		}
  
! 		// calculate the intersection of the possible parent folders ( goody might be already filled from the cycle before)
! 		if ( goody.empty()) // if good_set is empty set it
  		{
! 			goody = actual;
  		}
  		else
  		{
! 			set < string > res;
! 			set_intersection( goody.begin(), goody.end(), actual.begin(), actual.end(), inserter( res, res.begin()));
! 			goody = res;
  		}
  	}
--- 1276,1290 ----
  		}
  
! 		// calculate the intersection of the possible parent folders ( goody_folds might be already filled from the cycle before)
! 		if ( goody_folds_init_done) // if goody_folds inited already
  		{
! 			set < string > res;
! 			set_intersection( goody_folds.begin(), goody_folds.end(), actual.begin(), actual.end(), inserter( res, res.begin()));
! 			goody_folds = res;
  		}
  		else
  		{
! 			goody_folds = actual;
! 			goody_folds_init_done = true;
  		}
  	}
***************
*** 1292,1296 ****
  	{
  		// these folders may contain all objects ( topFCOs and topFolders)
! 		for( set< string > :: iterator git = goody.begin(); git != goody.end(); ++git)
  			m_acceptingKindsAndFolders.push_back( *git);
  	}
--- 1293,1297 ----
  	{
  		// these folders may contain all objects ( topFCOs and topFolders)
! 		for( set< string > :: iterator git = goody_folds.begin(); git != goody_folds.end(); ++git)
  			m_acceptingKindsAndFolders.push_back( *git);
  	}
***************
*** 1298,1302 ****
  	{
  		if( m_topFolds.size() == how_many_libraries || // there are no other folders OR
! 			goody.end() != goody.find( rootfolder_str))  // the RootFolder is a good target for the regular folders and kinds
  			m_acceptingKindsAndFolders.push_back( rootfolder_str);
  	}
--- 1299,1303 ----
  	{
  		if( m_topFolds.size() == how_many_libraries || // there are no other folders OR
! 			goody_folds.end() != goody_folds.find( rootfolder_str))  // the RootFolder is a good target for the regular folders and kinds
  			m_acceptingKindsAndFolders.push_back( rootfolder_str);
  	}
***************
*** 1310,1313 ****
--- 1311,1315 ----
  		// will store the intersection of accepting models
  		set < string > goody_models;
+ 		bool goody_models_init_done = false;
  		CComObjPtrVector<IMgaFCO>::iterator fco_it = m_topFcos.begin();
  		for( ; fco_it != m_topFcos.end(); ++fco_it)
***************
*** 1341,1353 ****
  
  			// calculate the intersection of the possible parent models
! 			if ( goody_models.empty()) // set if not set already
! 			{
! 				goody_models = actual_models;
! 			}
! 			else
  			{
  				set < string > res;
  				set_intersection( goody_models.begin(), goody_models.end(), actual_models.begin(), actual_models.end(), inserter( res, res.begin()));
  				goody_models = res;
  			}
  		}
--- 1343,1356 ----
  
  			// calculate the intersection of the possible parent models
! 			if ( goody_models_init_done) // if set already
  			{
  				set < string > res;
  				set_intersection( goody_models.begin(), goody_models.end(), actual_models.begin(), actual_models.end(), inserter( res, res.begin()));
  				goody_models = res;
+ 			}
+ 			else
+ 			{
+ 				goody_models = actual_models;
+ 				goody_models_init_done = true;
  			}
  		}



More information about the GME-commit mailing list