Firstly, I will say that I am not the most competent C ++ programmer, but I study and enjoy the power of Trottft.
I implemented a Thrift service with some basic functions that return void, i32 and a list. I am using a Python client controlled by a Django web application to make RPC calls and it works very well. The generated code is pretty straight forward, with the exception of the returned lists:
. crack description file:
namespace cpp Remote enum N_PROTO { N_TCP, N_UDP, N_ANY } service Rcon { i32 ping() i32 KillFlows() i32 RestartDispatch() i32 PrintActiveFlows() i32 PrintActiveListeners(1:i32 proto) list<string> ListAllFlows() }
Generated Signatures from Rcon.h:
int32_t ping(); int32_t KillFlows(); int32_t RestartDispatch(); int32_t PrintActiveFlows(); int32_t PrintActiveListeners(const int32_t proto); int64_t ListenerBytesReceived(const int32_t id); void ListAllFlows(std::vector<std::string> & _return);
As you can see, the generated ListAllFlows () function accepts a link to a row vector. I think I expect it to return a row vector, as described in the .thrift description.
I am wondering if I should provide the function with a row vector to modify, and then Thrift will handle its return to my client, even though the function returns void.
I can not find absolutely no resources or examples of using lists of Thrift <> types in C ++. Any recommendations would be appreciated.
source share