[gme-users] BON interpreter problem about references - ConnectionEnd handling

Zoltan Molnar zolmol at isis.vanderbilt.edu
Thu May 17 09:53:55 CDT 2007


Hi,

Once you have a connection c, you can inquire for its ends

ConnectionEnd ce = c->getSrc();

Or if you have a connected end src:

std::multiset<ConnectionEnd> cends = src->getConnEnds();

The handle has the magic of figuring out what is connected actually, a
referenceport or a modelport.

for( std::multiset<BON::ConnectionEnd>::const_iterator iter =
srcEnds.begin(); iter != srcEnds.end(); ++iter) {
	handle( *iter);
}

void handle( ConnectionEnd& p_connectionend)
{
	BON::FCO connend_fco( p_connectionend);
	if( connend_fco)
	{
		// the connected object is an fco ! 
	}
	else
	{
		BON::ReferencePort connend_refport( p_connectionend);
		if( connend_refport)
		{
			// it's a referenceport: see ReferencePortImpl
for details
			BON::FCO fco = connend_refport->getFCO();
			BON::ReferencePortContainer rpc =
connend_refport->getContainer();
			BON::Reference ref = rpc->getReference();
		}
		else ASSERT(0); // it can't happen
	}
}



> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu 
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf 
> Of jwchen4 at stu.edu.cn
> Sent: Thursday, May 17, 2007 3:03 PM
> To: gme-users
> Subject: [gme-users] BON interpreter problem about references
> 
> 
> Hi all:
> 
> I am facing a problem about creating an interpreter. In the 
> metamodel I 
> have a Model A with ports in it. Then I use some references 
> RAs of A in 
> another model and connect the RAs by theirs ports. But  I can not get 
> the connectionends with the connections, and I need to get every 
> connection and its src and dst. So could someone help me?
> 
> Thanks.
> Juvin
> 
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
> 


More information about the gme-users mailing list