protocol-buffers

How to build protocol buffer by Android NDK [closed]

风格不统一 提交于 2019-11-26 21:15:26
问题 I want to built a native version of Google's protocol buffers library. How would I do that? 回答1: I Use this Android.mk and build SUCCESSFUL # Copyright (C) 2009 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software #

protoc not generating service stub files

梦想与她 提交于 2019-11-26 20:34:50
问题 I have just started playing with google proto. When I try to compile proto file present in proto-java example, it does not generate any grpc file. proto file, https://github.com/grpc/grpc-java/blob/master/examples/src/main/proto/hello_world.proto terminal output, rsonkhla@raman-OptiPlex-9020:~/sandbox/grpc-java/examples$ protoc --version libprotoc 3.0.0 rsonkhla@raman-OptiPlex-9020:~/sandbox/grpc-java/examples$ protoc --java_out=test/ -I../../grpc-java/examples ../../grpc-java/examples/src

Storing multiple messages in one protocol buffer binary file

不想你离开。 提交于 2019-11-26 20:21:19
问题 I have repeating messages which I want to store in a single file. Currently I have to wrap this repeating message in another message. Is there a way around this? package foo; message Box { required int32 tl_x = 1; required int32 tl_y = 2; required int32 w = 3; required int32 h = 4; } message Boxes { repeated Box boxes = 1; } 回答1: Here's what "Techniques" section of the Protocol Buffers documentation says about repeated messages: If you want to write multiple messages to a single file or

High performance serialization: Java vs Google Protocol Buffers vs …?

本秂侑毒 提交于 2019-11-26 18:50:24
问题 For some caching I'm thinking of doing for an upcoming project, I've been thinking about Java serialization. Namely, should it be used? Now I've previously written custom serialization and deserialization (Externalizable) for various reasons in years past. These days interoperability has become even more of an issue and I can foresee a need to interact with .Net applications so I've thought of using a platform-independant solution. Has anyone had any experience with high-performance use of

Undefined reference to google::protobuf::internal::empty_string_[abi:cxx11]

↘锁芯ラ 提交于 2019-11-26 16:50:04
问题 I'm trying to build simple test application with Protocol Buffers 2.6.1 and GNU GCC 5.1.0 (on Ubuntu 14.10) and I get following errors: /home/ragnar/cpp-tools/gcc-linux/bin/g++ -c "/home/ragnar/cpp-projects/gprotobuf_test/main.cpp" -g -O0 -Wall -o ./Debug/main.cpp.o -I. -I/home/ragnar/cpp-tools/libs/linux64/protobuf/include -I. /home/ragnar/cpp-tools/gcc-linux/bin/g++ -c "/home/ragnar/cpp-projects/gprotobuf_test/messages.pb.cc" -g -O0 -Wall -o ./Debug/messages.pb.cc.o -I. -I/home/ragnar/cpp

raw decoder for protobufs format

青春壹個敷衍的年華 提交于 2019-11-26 16:00:14
问题 I'd like to find a way to convert a binary protobuf message into a human readable description of the contained data, without using the .proto files. The background is that I have a .proto message that it being rejected by the parser on Android, but it's not entirely clear why. I could go through the message by hand, but it's rather tedious. I tried protoc --decode_raw , but it just gives the error "Failed to parse input.". I google hoping/expecting someone would have done a nice web utility

C++ Serialization Performance

坚强是说给别人听的谎言 提交于 2019-11-26 15:42:07
问题 I'm building a distributed C++ application that needs to do lots of serialization and deserialization of simple data structures that's being passed between different processes and computers. I'm not interested in serializing complex class hierarchies, but more of sending structures with a few simple members such as number, strings and data vectors. The data vectors can often be many megabytes large. I'm worried that text/xml-based ways of doing it is too slow and I really don't want to write

Why required and optional is removed in Protocol Buffers 3

拈花ヽ惹草 提交于 2019-11-26 15:01:14
问题 I'm recently using gRPC with proto3 , and I've noticed that required and optional has been removed in new syntax. Would anyone kindly explain why required/optional are removed in proto3? Such kind of constraints just seem necessary to make definition robust. syntax proto2: message SearchRequest { required string query = 1; optional int32 page_number = 2; optional int32 result_per_page = 3; } syntax proto3: syntax = "proto3"; message SearchRequest { string query = 1; int32 page_number = 2;

How to build Google's protobuf in Windows using MinGW?

此生再无相见时 提交于 2019-11-26 12:44:07
问题 I\'m using Codeblocks as my IDE with MingGW. I\'m trying to use google protocol buffers, but I\'m having trouble building the protobuf. The readme file for protobuf says: If you are using Cygwin or MinGW, follow the Unix installation instructions, above. The Unix instructions says: To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following: $ ./configure $ make $ make check $ make install I don\'t know how to perform these in Windows

Biggest differences of Thrift vs Protocol Buffers?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 11:44:01
问题 What are the biggest pros and cons of Apache Thrift vs Google\'s Protocol Buffers? 回答1: They both offer many of the same features; however, there are some differences: Thrift supports 'exceptions' Protocol Buffers have much better documentation/examples Thrift has a builtin Set type Protocol Buffers allow "extensions" - you can extend an external proto to add extra fields, while still allowing external code to operate on the values. There is no way to do this in Thrift I find Protocol Buffers