I am working on a C ++ project with a large number of classes (150+), each of which has from 10 to 300 fields or so. I would really like to be able to create a scripting interface for testing so that I can encode callbacks that do not require recompilation. I would like to do this in Lua, since I am more familiar with its C API than with Python, but if this saves the headaches, I would be happy to do it in Python.
I have a clear understanding of how to call Lua functions from my C ++ and vice versa, and I know how to pass basic data types back and forth. I have a question how to split custom data types between them using SWIG.
For example, at some point in my C ++, I can evaluate a couple of parts of the data of an element in an object with 250 fields. I would like to pass this object to Lua, which could (hopefully?) Use the created SWIG wrappers to control this object, display specific fields and then pass the (potentially modified) object back to C ++ to continue using it.
I would also like to instantiate an object in Lua using wrappers and pass it to C ++, which will be used as a regular version of an object in C ++.
Is it possible? Can someone point me to a textbook or an explicit example?
Thanks for any help you can offer!
source
share