sharing the document between the c++ application, the API and the python script
aoloe opened this issue · comments
- the c++ application might or not have an open document.
- if there is an open document, it's shared with the API.
- the API can modify the document.
- while the script is running, the C++ application is not allowed to modify the document(s).
- (eventually, trough the API it should be possible to change the current document to any other open document)
- through the API, it should be possible to open documents / create new documents.
- (eventually, the document will be left open when the script is finished)
in https://github.com/aoloe/cpp-pybind11-playground/tree/master/scripter-api i have a Sample::Document
which is the document in the Sample C++ application and a ScripterAPI::Document
which will be used to create the module for Python.
i'm now looking for a good (modern) way of managing the sharing of the Sample::Document
...
passing a reference is not possible, since there might not be a document.
the most straight forward way seems to be to pass a raw pointer.
it might also be the only sane way...
this revision has code that works with raw pointers:
https://github.com/aoloe/cpp-pybind11-playground/tree/51f00ad6964ecbe5de896e92bdc0936ef2fbeb14