|
|
|
@ -34,6 +34,18 @@ cdef int _compare_pointer(void* first_pointer, void* second_pointer): |
|
|
|
|
return 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cdef class _GrpcArgWrapper: |
|
|
|
|
|
|
|
|
|
cdef grpc_arg arg |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cdef tuple _wrap_grpc_arg(grpc_arg arg): |
|
|
|
|
|
|
|
|
|
wrapped = _GrpcArgWrapper() |
|
|
|
|
wrapped.arg = arg |
|
|
|
|
return ("grpc.python._cygrpc._GrpcArgWrapper", wrapped) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cdef class _ArgumentProcessor: |
|
|
|
|
|
|
|
|
|
cdef void c(self, argument, grpc_arg_pointer_vtable *vtable, references): |
|
|
|
@ -51,6 +63,8 @@ cdef class _ArgumentProcessor: |
|
|
|
|
if encoded_value is not value: |
|
|
|
|
references.append(encoded_value) |
|
|
|
|
self.c_argument.value.string = encoded_value |
|
|
|
|
elif isinstance(value, _GrpcArgWrapper): |
|
|
|
|
self.c_argument = (<_GrpcArgWrapper>value).arg |
|
|
|
|
elif hasattr(value, '__int__'): |
|
|
|
|
# Pointer objects must override __int__() to return |
|
|
|
|
# the underlying C address (Python ints are word size). The |
|
|
|
|