[gme-users] How to get the derived classes of one base class in the <<connection>>

=?GB2312?B?yubV17jb?= zgshu2004 at 163.com
Fri Jun 23 23:27:24 CDT 2006


hi,all

   I meet with a problem.In my meta-model, one <<connection>> called "DataLink" connects two Ends,the src is an abstract <<Atom>> called "BaseType", the dst is an <<atom>> called EditBox. two <<atom>>s  called "Float" and "Int" inherit "BaseType".


In my user-model,a true Int <<Atom>> connects a EditBox by a "DataLink" line.When developing interpreter,I want to get the Int class instead of BaseType class.But I only find the following  method:

BaseType  DataLinkImpl::getSrc()
{
    BON::ConnectionEnd ce = ConnectionImpl::getSrc();
	BaseType sp( ce);
	if ( sp)
		return sp;

	BaseType empty;
	return empty;  
}


I try to translate base class "BastType" into "Int" or "Float" class by dynamic_cast<>,
I failed. 

BaseType bt=DataLink->getSrc();
Int myInt(bt);

failed again.

help me!!    thanks!


Z.G.Shu

  Ph.D Candidate
  College of Automation Engineering, South China University of Technology, 
  Guangzhou, China.
  Phone: +86-20-87114637
  Email: zgshu2004 at 163.com






More information about the gme-users mailing list