GetObjectType for Instances of Templates

Started by
3 comments, last by Jason Goepel 10 years ago

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?

Advertisement

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."

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

:-)

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

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

This topic is closed to new replies.

Advertisement