-
Notifications
You must be signed in to change notification settings - Fork 54
/
fftest.py
81 lines (68 loc) · 2.33 KB
/
fftest.py
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
def testBase(a1, a2, a3):
print('testBase', a1, a2, a3)
return 0
def testStl(a1, a2, a3):
print('testStl', a1, a2, a3)
return True
def test_returnStl():
print('test_returnStl')
#map<string, list<vector<int> > >
ret = {'Oh':[[111,222], [333, 444] ] }
return ret
def testRegFunction():
import ffpython
ffpython.printVal(123, 45.6 , "----789---", [3.14])
ret = ffpython.returnStl()
print('testRegFunction', ret)
def testRegisterBaseClass():
import ffpython
foo = ffpython.Foo(20130426)
print("testRegisterBaseClass get_val:", foo.getValue())
foo.setValue(778899)
print("testRegisterBaseClass get_val:", foo.getValue(), foo.nValue)
foo.testStl({"key": [11,22,33] })
print('testRegisterBaseClass testRegisterBaseClass', foo)
def testRegisterInheritClass():
import ffpython
dumy = ffpython.Dumy(20130426)
print("testRegisterInheritClass get_val:", dumy.getValue())
dumy.setValue(778899)
print("testRegisterInheritClass get_val:", dumy.getValue(), dumy.nValue)
dumy.testStl({"key": [11,22,33] })
dumy.dump()
print('testRegisterInheritClass', dumy)
def testCppObjToPy_ext(foo):
print('testCppObjToPy_ext', len(foo))
for k in range(0, len(foo)):
print('testCppObjToPy_ext', k, foo[k].nValue)
def testCppObjToPy(foo):
import ffpython
print("testCppObjToPy get_val:", foo.getValue())
foo.setValue(778899)
print("testCppObjToPy get_val:", foo.getValue(), foo.nValue)
foo.testStl({"key": [11,22,33] })
foo.nValue = 100
print('testCppObjToPy testRegisterBaseClass', foo)
def testCppObjToPy2(dumyList):
dumy = dumyList[0]
import ffpython
print("testCppObjToPy get_val:", dumy.getValue())
dumy.setValue(778899)
print("testCppObjToPy get_val:", dumy.getValue(), dumy.nValue)
dumy.testStl({"key": [11,22,33] })
dumy.dump()
ffpython.objTest(dumy)
print('testCppObjToPy', dumy)
return dumy
class PyClass:
def __init__(self):
print('PyClass init....')
def sayHi(self, a1, a2):
print('sayHi..', a1, a2)
def testCppObjReturnPyObj():
import ffpython
return PyClass()
def testCppObjReturnPyLambda():
def testLambda(a1):
print('testLambda....', a1)
return testLambda