Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

GetObjectType for Instances of Templates


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Jason Goepel   Members   -  Reputation: 368

Like
0Likes
Like

Posted 30 April 2014 - 08:05 AM

I have registered template specializations for my array class, for example Array<int>, Array<double>.  In prior versions of AngelScript I was able to make the following call to get the corresponding object type.

asIScriptEngine::GetObjectTypeByName("Array<double>")

This function now returns a null pointer.  There doesn't seem to be any way to get the type of a template specialization from the engine.  Am I missing something, or is this an oversight?



Sponsor:

#2 iraxef   Members   -  Reputation: 300

Like
0Likes
Like

Posted 30 April 2014 - 08:14 AM

Have you tried GetObjectTypeByDecl() ?

 

See here: http://www.gamedev.net/topic/653666-crash-when-caching-engine-gettypeidbydecl/

 

"GetObjectTypeByName() only accepts a single name for the lookup, it doesn't accept a type declaration, so it cannot be used to get the template instance type, e.g. array<int> array<MyType@>, etc.

 

I'll probably add a GetObjectTypeByDecl() for release 2.29.0 to better support this scenario."


Edited by iraxef, 30 April 2014 - 08:16 AM.


#3 Jason Goepel   Members   -  Reputation: 368

Like
0Likes
Like

Posted 30 April 2014 - 08:35 AM

GetObjectTypeByDecl is not exposed... but it does look like I can get it with a combination of GetObjectTypeById and GetTypeIdByDecl.

 

:-)



#4 iraxef   Members   -  Reputation: 300

Like
0Likes
Like

Posted 30 April 2014 - 08:44 AM

I think Andreas exposed it in 2.29. I do have it and am using it.



#5 Jason Goepel   Members   -  Reputation: 368

Like
0Likes
Like

Posted 30 April 2014 - 11:38 AM

You are correct.  I didn't have the latest WIP version.  I should have been more careful about checking for that.  Thanks!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS