[GME-commit] GMESRC/GME/Parser MgaParser.cpp,1.35,1.36

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Wed Feb 21 16:37:40 CST 2007


Update of /project/gme-repository/GMESRC/GME/Parser
In directory escher:/tmp/cvs-serv29367/Parser

Modified Files:
	MgaParser.cpp 
Log Message:
Parser prepared for multiple connroles in case of inherited connections. Will ignore.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: MgaParser.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Parser/MgaParser.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** MgaParser.cpp	3 Oct 2006 16:38:27 -0000	1.35
--- MgaParser.cpp	21 Feb 2007 22:37:38 -0000	1.36
***************
*** 1268,1271 ****
--- 1268,1308 ----
  	CComObjPtr<IMgaConnPoint> connpoint;
  
+ 	const std::string& role = GetByName(attributes, "role");
+ 	CComBSTR brole;
+ 	CopyTo( role, &brole);
+ 
+ 	// Since the Refresh operation created some derived connections
+ 	// in its own way, some derived connections might have been
+ 	// dumped with connroles, so that when the import happened
+ 	// the number of connroles went up to 4 or 6 or ...
+ 	// So to mitigate this issue the parser has been enhanced
+ 	// to eliminate superfuous connroles in case of derived conns
+ 	CComPtr<IMgaConnPoints> connpoints;
+ 	COMTHROW( conn->get_ConnPoints( &connpoints));
+ 	long c = 0;
+ 	if( connpoints) COMTHROW( connpoints->get_Count( &c));
+ 	for( long i = 1; i <= c; ++i)
+ 	{
+ 		CComPtr<IMgaConnPoint> old_cp;
+ 		COMTHROW( connpoints->get_Item( i, &old_cp));
+ 		if( old_cp)
+ 		{
+ 			CComBSTR old_role;
+ 			COMTHROW( old_cp->get_ConnRole( &old_role));
+ 			if( old_role == brole) // check if targets are equal
+ 			{
+ 				CComPtr<IMgaFCO> old_tgt;
+ 				COMTHROW( old_cp->get_Target( &old_tgt));
+ 				if( old_tgt == target)
+ 				{
+ 					// same role not inserted twice
+ 					CComBSTR msg( "Warning: Superfluous connection role ignored!");
+ 					if( m_GME) COMTHROW( m_GME->ConsoleMessage( msg, MSG_WARNING));
+ 					return;
+ 				}
+ 			}
+ 		}
+ 	}
+ 
  	COMTHROW( conn->AddConnPoint(PutInBstr(GetByName(attributes, "role")), 0,	// FIXME: multiplicity
  		target, coll, PutOut(connpoint)) );



More information about the GME-commit mailing list