Warning

The following content refers to the deprecated way of creating SWIG interface files for C modules. See Swig Interface File for the non-deprecated way.

Deprecated SWIG Interface File

The swig interface file makes it possible to create, setup and manipulate the Basilisk module from python. This *.i file is in the module folder with the *.h and *.c files.

The basic swig interface file looks like this:

 1%module someModule
 2%{
 3   #include "someModule.h"
 4%}
 5
 6%include "swig_conly_data.i"
 7
 8%constant void Update_someModule(void*, uint64_t, uint64_t);
 9%ignore Update_someModule;
10%constant void SelfInit_someModule(void*, uint64_t);
11%ignore SelfInit_someModule;
12%constant void Reset_someModule(void*, uint64_t, uint64_t);
13%ignore Reset_someModule;
14
15%include "someModule.h"
16
17%include "architecture/msgPayloadDefC/SomeMsgPayload.h"
18struct SomeMsg_C;
19
20%pythoncode %{
21import sys
22protectAllClasses(sys.modules[__name__])
23%}

In contrast to the C++ swig interface files, note that here extra lines are required regarding the Update, SelfInit and Reset methods.

Regarding what swig interfaces to include, see C++ Swig Interface File for additional options.