| 1 | #include <vector>
|
|---|
| 2 |
|
|---|
| 3 | struct A
|
|---|
| 4 | {
|
|---|
| 5 | int data;
|
|---|
| 6 | virtual int f() { return 0; }
|
|---|
| 7 | ~A()
|
|---|
| 8 | {
|
|---|
| 9 | std::cout << "Destructed" << endl;
|
|---|
| 10 | }
|
|---|
| 11 | };
|
|---|
| 12 | std::vector<boost::shared_ptr<A>> test3;
|
|---|
| 13 | std::vector<boost::shared_ptr<A>> test4;
|
|---|
| 14 |
|
|---|
| 15 | void TestWriteDisk(boost::shared_ptr<A> readDIsk)
|
|---|
| 16 | {
|
|---|
| 17 |
|
|---|
| 18 | test3.push_back(readDIsk);
|
|---|
| 19 | test4.push_back(readDIsk);
|
|---|
| 20 | }
|
|---|
| 21 | void CLearWrite()
|
|---|
| 22 | {
|
|---|
| 23 | test3.clear();
|
|---|
| 24 | }
|
|---|
| 25 | BOOST_PYTHON_MODULE(PyWrap)
|
|---|
| 26 | {
|
|---|
| 27 |
|
|---|
| 28 | class_<A, boost::shared_ptr<A> >("A")
|
|---|
| 29 | .def("f", &A::f)
|
|---|
| 30 | ;
|
|---|
| 31 | boost::python::def("TestWriteDisk", TestWriteDisk, "");
|
|---|
| 32 | boost::python::def("ClearWrite", CLearWrite, "");
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | // PYTHON FILE
|
|---|
| 37 | // import NVMeCMDWrapper as PyWrap
|
|---|
| 38 | // PyWrap.TestWriteDisk(PyWrap.A())
|
|---|
| 39 | // PyWrap.ClearWrite()
|
|---|