[gme-users] Question regarding BON extender interpreter and "getReferred()"

Thompson, Robert C robert.c.thompson3 at boeing.com
Sat Sep 3 22:55:12 CDT 2005


Hi,

I have a question regarding BON extender interpreter-generated code and
the method "getReferred()".  This is with GME 4.11.10.  

In my metamodel I have a class "A" and a class that references it "RA".
RA also inherits from two other classes "B" and "C".  In the
extender-interpreter generated code, I get something like the following:

class RAImpl : virtual public BON::ReferenceImpl, public BImpl, public
CImpl { 
...
public:
	virtual BON::Model getReferred();
...
}

Later, in a plugin, if I have an instance named "r" of RA (not RAImpl),
I tried this:

BON::Model m = r->getReferred();

When I do this, I get an instant death to my GME sesssion, no warning or
message, just "poof".

So, I tried this:

BON::Model m = (dynamic_cast<BON::ReferenceImpl*>(r.operator->()))
->getReferred();

This gives me the desired behavior.  So basically I have to cast "r" to
BON::ReferenceImpl so that I use BON::ReferenceImpl::getReferred instead
of RAImpl's version.  

Am I missing something?  I had expected that the RAImpl::getReferred()
(i.e. the one exposed on the extender-interpreter-generated interface)
would give me what I wanted...  A wild guess makes me think it's
something with the virtual inheritance of BON::ReferenceImpl and the
virtual-ness of RAImpl::getReferred()... because the body of
RA::getReferred() invokes "getReferred()". But I don't really know for
sure that this is causing my problem.

Any help or pointers would be much appreciated.  It can be worked around
but I'm confused as to what is the expected meaning/behavior of the
method that seems to be causing me trouble.

Thanks
-ace
Ace Thompson
Systems and Software Engineer
FCS LSI C4ISR Battle Command
robert.c.thompson3 at boeing.com
+1 480 891 2284
The Boeing Company




More information about the gme-users mailing list