Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

registering specialized template class?


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
6 replies to this topic

#1 slicer4ever   Crossbones+   -  Reputation: 3177

Like
0Likes
Like

Posted 04 October 2012 - 12:32 PM

I'm attempting to register several specialzed template classes, but i keep getting the error: "Error : Failed in call to function 'RegisterObjectType' with 'LLObject<ConvexHull@>' (Code: -8)"

i'm registering it like so:

m_ScriptEngine->RegisterObjectType("ConvexHull", sizeof(ConvexHull), asOBJ_REF|asOBJ_NOCOUNT);
m_ScriptEngine->RegisterObjectType("LLObject<ConvexHull@>", 0, asOBJ_REF|asOBJ_NOCOUNT);

any tips on what i'm doing wrong?, if you need more code, i can post more, just tell me w/e u need.

edit: also, i'm using AS 2.25.0

Edited by slicer4ever, 04 October 2012 - 12:33 PM.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3220

Like
0Likes
Like

Posted 04 October 2012 - 04:56 PM

Have you registered the LLObject template first?
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 slicer4ever   Crossbones+   -  Reputation: 3177

Like
0Likes
Like

Posted 04 October 2012 - 05:59 PM

yes, i've tried it with declaring it as a template, before i declared the specialized class like so:

m_ScriptEngine->RegisterObjectType("ConvexHull", sizeof(ConvexHull), asOBJ_REF|asOBJ_NOCOUNT);
m_ScriptEngine->RegisterObjectType("LLObject<class T>", 0, asOBJ_REF|asOBJ_NOCOUNT|asOBJ_TEMPLATE);
m_ScriptEngine->RegisterObjectType("LLObject<ConvexHull@>", 0, asOBJ_REF|asOBJ_NOCOUNT);

but this still results in the same error code.

Edited by slicer4ever, 04 October 2012 - 06:11 PM.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

#4 Andreas Jonsson   Moderators   -  Reputation: 3220

Like
1Likes
Like

Posted 04 October 2012 - 07:28 PM

It might be a bug in AngelScript when parsing the template specialization with the handle as subtype. I'll investigate it.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#5 slicer4ever   Crossbones+   -  Reputation: 3177

Like
0Likes
Like

Posted 04 October 2012 - 08:07 PM

It might be a bug in AngelScript when parsing the template specialization with the handle as subtype. I'll investigate it.


Thanks Andreas, in the meantime, I can probably come up with an alternative solution, not exactly what i'd like, but it'll have to do for now=-).
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

#6 Andreas Jonsson   Moderators   -  Reputation: 3220

Like
1Likes
Like

Posted 06 October 2012 - 09:47 AM

The registration was failing because the LLObject template type didn't have a default constructor, which AngelScript treated as if the template type cannot be instanciated at all.

I've fixed this in revision 1424.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#7 slicer4ever   Crossbones+   -  Reputation: 3177

Like
0Likes
Like

Posted 06 October 2012 - 09:00 PM

thanks Andreas=-), i've successfully templated several types without any complaints from the compiler so far.

I'll post a response if i run into any more issues.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.




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