Ok, quick and hopefully a simple question here ...
I have a big C ++ API, which is basically a socket API with a top-level type protocol. This is a package of distributed sources from the company. All source code is written to header files (including the implementation of functions) for some odd reason (I think they find it easier for developers to import an H file and not worry about compiling multiple cpp files?). The source is also available in C, Java, and .NET.
The application I am writing is in Python, on Linux, and needs to use this API through Python. My three options seem to either run the applications separately, or the messaging protocols between them, by running SWIG (or similar) to create a Python interception or to override the entire source code in Python. Ultimately, I would like to make it as asynchronous as possible (already using Twisted in other parts of the application).
Using SWIG seems to be the fastest, but there are many customizable typed structures that are used when passing and exiting functions, as well as returning from functions that, as I heard, may be a problem with SWIG.
I would prefer not to write a message protocol, as this creates another point of failure and two different source codes in two different languages ββthat I have to manage. Re-executing C ++ code in Python may ultimately be a good solution, but it will take a lot of effort and time.
My question is, does SWIG seem like a good idea, and if so, will I need to write C ++ files for compilation that wrap the headers, or should I just forget SWIG and look at something else?
I appreciate any help or thoughts. Thanks.
EDIT . It turns out that I used to make a mistake ... there is a lot of source code in the header files, but I found a bunch of .lib and .a . Can I use SWIG, Boost, or the like in these types of files? Or do I need to write a top-level API above them and try this? So far, my attempts have failed.
SOLUTION In the end, I just used my own API directly from Python. It turns out that the protocol specification was not so complicated, and C ++ libraries really made it difficult to work. I also have the added bonus of creating lib inside an asynchronous structure, instead of making threads with synchronous calls.