| 1 | import sys |
| 2 | import os.path |
| 3 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), |
| 4 | '..', '..', 'build', 'examples', 'std_shared_ptr')) |
| 5 | |
| 6 | import sp |
| 7 | |
| 8 | def factory(): |
| 9 | return sp.Foo('factory') |
| 10 | |
| 11 | def use(): |
| 12 | a = factory() |
| 13 | print a.get_datum() |
| 14 | |
| 15 | use() |
| 16 | |
| 17 | f = sp.Foo("hello123") |
| 18 | sp.function_that_takes_foo(f) |
| 19 | f1 = sp.function_that_returns_foo() |
| 20 | print f1.get_datum() |
| 21 | f.set_datum("xxxx") |
| 22 | print f1.get_datum() |
| 23 |