<div><br>Hi,</div>
<div>I am trying to get the type name of an instance. But how is it possible? In user manual, part: "Type inheritance in BON2" (page 109) it says: <br> <br><br><font color="#ff0000">"After a simple cast the user may obtain the type of the instance or the subtypes of the type. "</font> </div>
<div> </div>
<div>but I can not get the Type name of aan instance as a string or another printable format(in my exampe it is "Ship").<br> <br>For example My Type is Ship and its instance is RegisteredShipObject. When I reach the RegisteredShipObject in the code below,<br>
I can not get the type name which is Ship in my code?<br> <br>getType returns ok but how can I get the name of the type? (how can I achieve this casting operation)<br>I can not find a function like oo->getType()->getName()?<br>
<br>Here is my code: </div>
<div> <br><font color="#ff0000">for<br>( std::set<BON::Reference>::iterator iter = referenceSet.begin(); iter != referenceSet.end(); iter++ ) <br>{ <br>if( (*iter)->getObjectMeta().displayedName() == "OCReference" ) <br>
{ <br>BON::FCO mscModel = (*iter)->getReferred(); <br>BON::TypeInhObject oo = mscModel->getTypeInhObject();<br>if ( oo ->getType() ) <br>{<br> //I want to get name of type --- here Ship -- <br>}<br>}<br>}</font><br>
</div>
<div> </div>
<div><br> </div>
<div class="gmail_quote">On Tue, Aug 25, 2009 at 6:13 PM, Peter Volgyesi <span dir="ltr"><<a href="mailto:peter.volgyesi@gmail.com">peter.volgyesi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br><br>Do you need the meta "type" (kind) of the object or the archetype (if<br>you are using the type/instance feature of GME) ?<br>
The first can be accessed by getFCOMeta (or more specialized methods<br>for atoms, models, etc. by calling getXYMeta()).<br>The second can be acquired by calling getType().<br>Please, check the GME User Manual if you are not familiar with the<br>
"type/instance" feature.<br>Regards,<br><br>--<br>peter<br>
<div>
<div></div>
<div class="h5"><br><br><br>On Tue, Aug 25, 2009 at 5:02 AM, Vijdan KIZILAY<<a href="mailto:vkizilay@gmail.com">vkizilay@gmail.com</a>> wrote:<br>> Hello,<br>><br>> How can I take a type of a instance with BON2?<br>
><br>> I can take name, role, kind but I could not take the type of instance..<br>> How can be the instance's type taken?<br>><br>> I can get BON::Type but I can not get the name of type.<br>><br>> Vijdan<br>
><br></div></div>> _______________________________________________<br>> gme-users mailing list<br>> <a href="mailto:gme-users@list.isis.vanderbilt.edu">gme-users@list.isis.vanderbilt.edu</a><br>> <a href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users</a><br>
><br>><br>_______________________________________________<br>gme-users mailing list<br><a href="mailto:gme-users@list.isis.vanderbilt.edu">gme-users@list.isis.vanderbilt.edu</a><br><a href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users" target="_blank">http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users</a><br>
</blockquote></div><br>