I have a quit big c++ program and I want to have a function which I can edit in a text file to change the behavior of my c++ program without compiling it again.
To achieve this I thought I could embed a script in my c++ program.
My function should take two c++ objects and return a boolean in relation to the two objects and their members. The pseudo code would be similar to the following:
//In c++ program
CppObject cpp1, cpp2;
ScSriptObject o1 = transform(cpp1);
ScriptObject o2 = transform(cpp2);
boolean result = call function(o1, o2);
//Script function in text file
boolean function(Object o1, Object o2)
{
return do_something(o1, o2)
}
I would like to know if there is another maybe better solution. And with which scripting languages can this be done easily and how can it be done?
I have already taken a look at python and Python/C API, but I had some troubles to get the basic examples working and I'm wondering if there is a simpler option.
Thank you for your help :)