[英]apache thrift, serialize unsigned
Currently i need to transfer data between C++ and Python applications. 目前,我需要在C ++和Python应用程序之间传输数据。
As long as Thrift doesn't work with unsigned int
, what's the best way to transfer unsigned
? 只要Thrift不能与
unsigned int
,传输unsigned
的最佳方法是什么?
Is there only way like: 是否只有这样的方式:
Should i do it manually all the time or there are already some 3rd party libraries? 我应该一直手动进行还是应该有一些第三方库?
How do i do it in the case of C++/Python applications? 在C ++ / Python应用程序中该怎么办? In C++/C++ applications i can just
static_cast<signed/unsigned>(unsigned/signed)
for conversion, but what about Python? 在C ++ / C ++应用程序中,我只能进行
static_cast<signed/unsigned>(unsigned/signed)
转换,但是Python呢?
There are two options that make sense (and a bunch of others): 有两个有意义的选择(以及其他许多选择):
The "bunch of others" include “其他人”包括
But again, I'd recommend 1. or 2. 但是我还是建议1.或2。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.