🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How can I determine if a type is already registered ?

Started by
2 comments, last by WitchLord 19 years, 4 months ago
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 ?
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.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

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
I'll see what I can do. Your requests doesn't impact any other features so I don't see why not.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement