Jump to content
  • Advertisement

module GetFunctionByName namespace

Recommended Posts


It seems that `asCModule::GetFunctionByName` does not understand namespaces (but `GetFunctionByDecl` does). Instead it requires me to set the module level default namespace.

This has the problem that it doesn't seem thread safe. So I'd like to ask for support in finding a function by name in a namespace.

Sorry if this is already done, I'm using about 5 months old version of AngelScript (I didn't update to check if this was already added because I'm trying to get a version of my project ready for release).

Share this post

Link to post
Share on other sites

Hi Boost,

You're right. GetFunctionByName doesn't currently understand namespaces, and it is indeed not safe for multithreading to use the separate SetDefaultNamespace call. 

I'll add this to the to-do list for an upcoming release as a priority item.

If this is vital for your project you should be able to temporarily customize the GetFunctionByName implementation to check if the given name includes the scope and if so use engine->FindNameSpace and look for the function in that namespace instead of the default one.



Share this post

Link to post
Share on other sites

Thanks. I've been able to use the find by declaration as an alternative for the few places where I needed this, though that is not optimal as I don't care about the exact function signature.

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!