|
6 | 6 | # @generated
|
7 | 7 | #
|
8 | 8 |
|
| 9 | +from libcpp.memory cimport make_shared, unique_ptr |
| 10 | +from cython.operator cimport dereference as deref, address |
| 11 | +from libcpp.utility cimport move as cmove |
9 | 12 | cimport module.types as _fbthrift_ctypes
|
| 13 | +from thrift.py3.serializer cimport ( |
| 14 | + cserialize as __cserialize, |
| 15 | + cdeserialize as __cdeserialize, |
| 16 | +) |
| 17 | +from thrift.python.protocol cimport Protocol |
| 18 | +cimport folly.iobuf as _folly__iobuf |
10 | 19 |
|
11 | 20 |
|
12 | 21 | cdef shared_ptr[_fbthrift_cbindings.cComplexUnion] ComplexUnion_convert_to_cpp(object inst) except*:
|
13 |
| - return (<_fbthrift_ctypes.ComplexUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 22 | + return make_shared[_fbthrift_cbindings.cComplexUnion](deref( |
| 23 | + (<_fbthrift_ctypes.ComplexUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 24 | + )) |
14 | 25 |
|
15 | 26 | cdef object ComplexUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cComplexUnion]& c_struct):
|
16 | 27 | return _fbthrift_ctypes.ComplexUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)
|
17 | 28 |
|
18 | 29 | cdef shared_ptr[_fbthrift_cbindings.cListUnion] ListUnion_convert_to_cpp(object inst) except*:
|
19 |
| - return (<_fbthrift_ctypes.ListUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 30 | + return make_shared[_fbthrift_cbindings.cListUnion](deref( |
| 31 | + (<_fbthrift_ctypes.ListUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 32 | + )) |
20 | 33 |
|
21 | 34 | cdef object ListUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cListUnion]& c_struct):
|
22 | 35 | return _fbthrift_ctypes.ListUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)
|
23 | 36 |
|
24 | 37 | cdef shared_ptr[_fbthrift_cbindings.cDataUnion] DataUnion_convert_to_cpp(object inst) except*:
|
25 |
| - return (<_fbthrift_ctypes.DataUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 38 | + return make_shared[_fbthrift_cbindings.cDataUnion](deref( |
| 39 | + (<_fbthrift_ctypes.DataUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 40 | + )) |
26 | 41 |
|
27 | 42 | cdef object DataUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cDataUnion]& c_struct):
|
28 | 43 | return _fbthrift_ctypes.DataUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)
|
29 | 44 |
|
30 | 45 | cdef shared_ptr[_fbthrift_cbindings.cVal] Val_convert_to_cpp(object inst) except*:
|
31 |
| - return (<_fbthrift_ctypes.Val?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 46 | + return make_shared[_fbthrift_cbindings.cVal](deref( |
| 47 | + (<_fbthrift_ctypes.Val?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 48 | + )) |
32 | 49 |
|
33 | 50 | cdef object Val_from_cpp(const shared_ptr[_fbthrift_cbindings.cVal]& c_struct):
|
34 | 51 | return _fbthrift_ctypes.Val._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)
|
35 | 52 |
|
36 | 53 | cdef shared_ptr[_fbthrift_cbindings.cValUnion] ValUnion_convert_to_cpp(object inst) except*:
|
37 |
| - return (<_fbthrift_ctypes.ValUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 54 | + return make_shared[_fbthrift_cbindings.cValUnion](deref( |
| 55 | + (<_fbthrift_ctypes.ValUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 56 | + )) |
38 | 57 |
|
39 | 58 | cdef object ValUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cValUnion]& c_struct):
|
40 | 59 | return _fbthrift_ctypes.ValUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)
|
41 | 60 |
|
42 | 61 | cdef shared_ptr[_fbthrift_cbindings.cVirtualComplexUnion] VirtualComplexUnion_convert_to_cpp(object inst) except*:
|
43 |
| - return (<_fbthrift_ctypes.VirtualComplexUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 62 | + return make_shared[_fbthrift_cbindings.cVirtualComplexUnion](deref( |
| 63 | + (<_fbthrift_ctypes.VirtualComplexUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 64 | + )) |
44 | 65 |
|
45 | 66 | cdef object VirtualComplexUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cVirtualComplexUnion]& c_struct):
|
46 | 67 | return _fbthrift_ctypes.VirtualComplexUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)
|
47 | 68 |
|
48 | 69 | cdef shared_ptr[_fbthrift_cbindings.cNonCopyableStruct] NonCopyableStruct_convert_to_cpp(object inst) except*:
|
49 |
| - return (<_fbthrift_ctypes.NonCopyableStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 70 | + cdef unique_ptr[_folly__iobuf.cIOBuf] _fbthrift__iobuf = cmove( |
| 71 | + __cserialize( |
| 72 | + (<_fbthrift_ctypes.NonCopyableStruct?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), |
| 73 | + Protocol.BINARY, |
| 74 | + ) |
| 75 | + ) |
| 76 | + cdef shared_ptr[_fbthrift_cbindings.cNonCopyableStruct] _fbthrift__out = make_shared[_fbthrift_cbindings.cNonCopyableStruct]() |
| 77 | + __cdeserialize(_fbthrift__iobuf.get(), _fbthrift__out.get(), Protocol.BINARY) |
| 78 | + return cmove(_fbthrift__out) |
50 | 79 |
|
51 | 80 | cdef object NonCopyableStruct_from_cpp(const shared_ptr[_fbthrift_cbindings.cNonCopyableStruct]& c_struct):
|
52 | 81 | return _fbthrift_ctypes.NonCopyableStruct._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)
|
53 | 82 |
|
54 | 83 | cdef shared_ptr[_fbthrift_cbindings.cNonCopyableUnion] NonCopyableUnion_convert_to_cpp(object inst) except*:
|
55 |
| - return (<_fbthrift_ctypes.NonCopyableUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE |
| 84 | + cdef unique_ptr[_folly__iobuf.cIOBuf] _fbthrift__iobuf = cmove( |
| 85 | + __cserialize( |
| 86 | + (<_fbthrift_ctypes.NonCopyableUnion?>inst)._cpp_obj_FBTHRIFT_ONLY_DO_NOT_USE.get(), |
| 87 | + Protocol.BINARY, |
| 88 | + ) |
| 89 | + ) |
| 90 | + cdef shared_ptr[_fbthrift_cbindings.cNonCopyableUnion] _fbthrift__out = make_shared[_fbthrift_cbindings.cNonCopyableUnion]() |
| 91 | + __cdeserialize(_fbthrift__iobuf.get(), _fbthrift__out.get(), Protocol.BINARY) |
| 92 | + return cmove(_fbthrift__out) |
56 | 93 |
|
57 | 94 | cdef object NonCopyableUnion_from_cpp(const shared_ptr[_fbthrift_cbindings.cNonCopyableUnion]& c_struct):
|
58 | 95 | return _fbthrift_ctypes.NonCopyableUnion._create_FBTHRIFT_ONLY_DO_NOT_USE(c_struct)
|
|
0 commit comments