Skip to content

Commit cacb6c9

Browse files
committed
When SWIG'ing to Python, rename "Measure" to "PythonMeasure" so that we don't have SwigDirector_Measure name clashing
1 parent 1cc236d commit cacb6c9

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

Measure.i

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
#ifndef MEASURE_I
22
#define MEASURE_I
33

4+
5+
%begin %{
6+
// ... code in begin section ...
7+
%}
8+
9+
%runtime %{
10+
// ... code in runtime section ...
11+
%}
12+
13+
%header %{
14+
// ... code in header section ...
15+
%}
16+
17+
%wrapper %{
18+
// ... code in wrapper section ...
19+
%}
20+
21+
%init %{
22+
// ... code in init section ...
23+
%}
24+
425
%module mylib
5-
%module(directors="1") mylib
26+
%module(directors="1") mylib
27+
628

7-
%feature("director") Measure;
829

930
%include <stl.i>
1031
%include <std_string.i>

python/test_measure.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
import mylib
77

8-
class PythonTestMeasure(mylib.Measure):
8+
class PythonTestMeasure(mylib.PythonMeasure):
99
def __init__(self):
10-
mylib.Measure.__init__(self)
11-
print("Created Object")
10+
mylib.PythonMeasure.__init__(self)
11+
print("Created Object (Python __init__)")
1212

1313
def run(self, r: mylib.Runner):
1414
r.get_current_model().pushOp("Op from Python")

0 commit comments

Comments
 (0)