How to reference large ugly class from script


If you have a rather large, ugly class or struct on the C++ side, and you want to share an instance of the class with the scripting side, what is the suggested way to do it?

I’m assuming that every specific thing in the class must be individually ‘added’. In other words, I’m assuming that there is no way to ‘add’ an entire class and have the script access members of the class that haven’t been explicitly ‘added’. Is that the case?


I truly wish there was a way to do it all at once, but C++ provides no mechanism for this (yet). There are possibilities for using libclang or similar to generate bindings, and I think there’s some in the works here

But for now, unless you want to try out siplasplas, you’re going to have to manually write each member out. Some people make helper macros to make it simpler, but I don’t provide any.



How does one mark posts as answered?


It’s under the “edit topic” button next to the topic name.