Sign in to follow this  
Licu

How can I determine if a type is already registered ?

Recommended Posts

Licu    128
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
WitchLord    4678
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
Licu    128
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this