I would like to embed lua to allow scripts in my C ++ application. In particular, I have two structures that I would like to pass as arguments for this lua function. One of them will be available for reading only, the other for reading / writing. The following are simplified examples of these structures:
struct inData
{
int x;
int y;
};
struct outData
{
int a;
double b;
};
Both of these structures are created in C ++ code and will be processed there both before and after calling the lua functions. How to pass these structures to the lua function so that the function can do such things:
if(inData.x > 5) then outData.a = 1 end
and does the outData instance really save the changes after returning from the lua function?
source
share