Advertisement

Register classes with Luabind

Started by November 06, 2004 12:40 PM
1 comment, last by Gandalf 19 years, 10 months ago
I wonder if I must declare all classes to be registered by Luabind inside the module(L) [ ] scope or if it is possible to register the classes one by one (by adding them with a function call or something)?
Gandalf the Black
From memory you can do it in more than one place if you want to. You just have separate module(L)[] calls within each function that you want the binding to occur in. So long as L is the same luastate variable every time.

What I would avoid however is having too many compilation units which include any of the luabind headers. If you've been playing with Luabind you'll already have noticed that you can spend huge ammounts of time waitng for builds to finish, spreading this over more compilation units just makes it worse.

The last time I considered this it was to try and avoid some of the build time overheads, by putting stable bindings in one file and the things that I was working on in another file. With good management and a well planned design I'm confident that this could work, but it just made the build times worse IMO. It's not a good strategy if you were planning on frequent builds and rapid prototyping.
Advertisement
Thanks. I have noticed the long build times, and its very annoying and its hard to seperate the luabind code from the rest of the engine. I also dont like that Luabind is dependent of Boost (12 MB extra headers). I think I will stick with toLua for a while longer.
Gandalf the Black

This topic is closed to new replies.

Advertisement