• Advertisement
Sign in to follow this  

How can I determine if a type is already registered ?

This topic is 4726 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

AngelScript 2.0. I want to determine if a type is registered or not. Can I rely on returned value for RegisterObjectType being asNAME_TAKEN ? Can it return asALREADY_REGISTERED ?

Share this post


Link to post
Share on other sites
Advertisement
If the name is already being used by another type, a type member, or a global property or function then asNAME_TAKEN will be returned.

asALREADY_REGISTERED is never returned by this method, although I suppose it would be a suitable return code if the type is already registered before.

Share this post


Link to post
Share on other sites
Yes, I already know that. But I want to distinct the case when the class is already registered from the one when the name is taken by a type member, function etc.

This is nec because I register the class from multiple code paths, so paths that are executed later doesn't exit with error when the class is already register. I'm forced to do that because I have multiple dynamically loaded modules that use the same types. The order of loading is not guaranteed.

I can go into more details if you want but the thing is that I need to determine if a class is registered or not. I could keep track myself in a structure separated from the compiler but it will be a waste of space.

Also it will be really useful (for me at least) if I could reregister the types behaviours (especially the addref, release).

Thanks
Licu

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement