forked from kactus2/kactus2dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPythonAPI.i
More file actions
90 lines (80 loc) · 3.59 KB
/
PythonAPI.i
File metadata and controls
90 lines (80 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* File : pythonAPI.i */
//%feature("autodoc", "2");
%module pythonAPI
%include "std_string.i"
%include "std_vector.i"
%include "std_map.i"
%include "InterfaceFiles/QString.i"
%include "InterfaceFiles/NameGroup.i"
%include <windows.i>
#define Q_DECL_EXPORT __declspec(dllexport)
#define Q_DECL_IMPORT __declspec(dllimport)
%include "../KactusAPI/KactusAPIGlobal.h"
%{
#include "../KactusAPI/KactusAPIGlobal.h"
#include "PythonAPI.h"
#include "../KactusAPI/include/CommonInterface.h"
#include "../KactusAPI/include/NameGroupInterface.h"
#include "../KactusAPI/include/ParameterizableInterface.h"
#include "../KactusAPI/include/MasterPortInterface.h"
#include "../KactusAPI/include/PortsInterface.h"
#include "../KactusAPI/include/AbstractParameterInterface.h"
#include "../KactusAPI/include/ParametersInterface.h"
#include "../KactusAPI/include/MemoryMapInterface.h"
#include "../KactusAPI/include/MemoryBlockInterface.h"
#include "../KactusAPI/include/SubspaceMapInterface.h"
#include "../KactusAPI/include/AddressBlockInterface.h"
#include "../KactusAPI/include/RegisterInterface.h"
#include "../KactusAPI/include/FieldInterface.h"
#include "../KactusAPI/include/ResetInterface.h"
#include "../KactusAPI/include/FileSetInterface.h"
#include "../KactusAPI/include/FileInterface.h"
#include "../KactusAPI/include/FileBuilderInterface.h"
#include "../KactusAPI/include/AbstractionTypeInterface.h"
#include "../KactusAPI/include/PortAbstractionInterface.h"
#include "../KactusAPI/include/PortMapInterface.h"
#include "../KactusAPI/include/BusInterfaceInterface.h"
#include "../KactusAPI/include/InterconnectGenerator.h"
%}
namespace std {
// %template(portsVector) vector<SimplePort*>;
%template(stringVector) vector<string>;
// %template(fieldInterfaceVector) vector<FieldInterface*>;
// %template(resetInterfaceVector) vector<ResetInterface*>;
// %template(registerInterfaceVector) vector<RegisterInterface*>;
};
/* Let's just grab the original header file here */
%include "PythonAPI.h"
%include "../KactusAPI/include/CommonInterface.h"
%include "../KactusAPI/include/NameGroupInterface.h"
%include "../KactusAPI/include/ParameterizableInterface.h"
%include "../KactusAPI/include/MasterPortInterface.h"
%include "../KactusAPI/include/PortsInterface.h"
%include "../KactusAPI/include/AbstractParameterInterface.h"
%include "../KactusAPI/include/ParametersInterface.h"
%include "../KactusAPI/include/MemoryMapInterface.h"
%include "../KactusAPI/include/MemoryBlockInterface.h"
%include "../KactusAPI/include/SubspaceMapInterface.h"
%include "../KactusAPI/include/AddressBlockInterface.h"
%include "../KactusAPI/include/RegisterInterface.h"
%include "../KactusAPI/include/FieldInterface.h"
%include "../KactusAPI/include/ResetInterface.h"
%include "../KactusAPI/include/FileSetInterface.h"
%include "../KactusAPI/include/FileInterface.h"
%include "../KactusAPI/include/FileBuilderInterface.h"
%include "../KactusAPI/include/AbstractionTypeInterface.h"
%include "../KactusAPI/include/PortAbstractionInterface.h"
%include "../KactusAPI/include/PortMapInterface.h"
%include "../KactusAPI/include/BusInterfaceInterface.h"
#include "../KactusAPI/include/InterconnectGenerator.h"
// Workaround fix for calling AddressBlockInterface/SubspaceMapInterface::addBlock(std::string const&) from python
%extend AddressBlockInterface {
void addBlock(std::string const& newBlockName = std::string("")) {
return static_cast<MemoryBlockInterface*>(self)->addBlock(newBlockName);
}
}
%extend SubspaceMapInterface {
void addBlock(std::string const& newBlockName = std::string("")) {
return static_cast<MemoryBlockInterface*>(self)->addBlock(newBlockName);
}
}