[gme-users] BON2 and subtypes of instances

Peter Volgyesi peter.volgyesi at vanderbilt.edu
Mon Aug 11 17:45:32 CDT 2008


It is indeed a bug in BON2.
The next release will contain the fix.
In the meantime, you can replace the implementation of
FCOImpl::getType() manually in BONImpl.cpp with the following:

------------------------------------
FCOImpl* FCOImpl::getType()
	{
		if ( m_bAllTypeFCOs )
			return m_pType;
		m_bAllTypeFCOs = true;
		FCOPtr spFCO;
		VARIANT_BOOL vbInstance;
		COMTHROW( getFCOI()->get_IsInstance( &vbInstance ) );
		if (vbInstance) {
			COMTHROW( getFCOI()->get_Type( spFCO.Addr() ) );
		}
		else
		{
			COMTHROW( getFCOI()->get_BaseType( spFCO.Addr() ) );
		}
		
		if ( spFCO ) {
			m_pType = FCOImpl::attachI( spFCO, ObjectImpl::m_pProject, getObjectMeta() );
			m_pType->onRetrievedAsType( this, false );
		}
		return m_pType;
	}
------------------------------------
--
peter



On Fri, Aug 8, 2008 at 5:03 PM, Adam Nagel <nagelar at isis.vanderbilt.edu> wrote:
> Csaba –
>
>
>
> I don't believe that I have encountered this case before, so I can't say if
> this has always been the behavior.  I plan to work though it more closely
> with Akos next week – we can let the mailing list know the resolution once
> we have explored it further.
>
>
>
> -- Adam
>
>
>
> ________________________________
>
> From: gme-users-bounces at list.isis.vanderbilt.edu
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Csaba Toth
> Sent: Friday, August 08, 2008 4:58 PM
> To: gme-users
> Subject: Re: [gme-users] BON2 and subtypes of instances
>
>
>
> Hi Adam!
>
>
>
> Is this a feature which worked OK in previous versions and went wrong after
> some releases?
>
> Or is this a newly discovered bug?
>
>
>
> I mean: this operation what you described was not tested before?
>
>
>
> Thanks,
>
> Csaba
>
>
>
> From: gme-users-bounces at list.isis.vanderbilt.edu
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Adam Nagel
> Sent: Friday, August 08, 2008 4:31 PM
> To: gme-users
> Subject: [gme-users] BON2 and subtypes of instances
>
>
>
> We are encountering problems using BON2 with subtypes and instances.
>
>
>
> Take models A and B.  Instantiate model A into model B, creating A(inst).
> Then create a subtype of model B and call it B(sub).  Model B(sub) now
> contains A(inst)(inst), which seems to be considered an instance of A(inst)
> by GME.
>
>
>
> Our interpreter finds A(inst)(inst) within B(sub).  We first call
> getTypeInhObject() to acquire the TypeInhObject for A(inst)(inst).  Then we
> call isInstance() on it, which returns true.  However, when we call
> getType(), we get a null object.
>
>
>
> This seems like a strange case, so I wanted to see if we're missing some
> detail that prevents us from finding the type of A(inst)(inst).  The end
> goal is to trace all of the way back to A from A(inst)(inst).
>
>
>
> I would be glad to clarify the case if this description is especially
> confusing. J
>
>
>
> Adam Nagel
>
> Staff Engineer
>
> ISIS / Vanderbilt University
>
>
>
> _______________________________________________
> 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