protocol-buffers

Maven & Protobuf compile error: Cannot find symbol in package com.google.protobuf

假如想象 提交于 2019-12-05 09:16:45
问题 I'm new to Linux and Protobuf.. I need help. I'm trying to "mvn package" a project that contains many ".proto" files, and a pom.xml file of course... I'm working on Ubuntu ======================================= ERROR When I run "mvn package", I receive this error: after ... Compiling 11 source files to .../target/classes ... I get a bunch of these errors: [ERROR] .../target/generated-sources/...java:[16457,30] cannot find symbol [ERROR] symbol : class Parser [ERROR] location: package com

Protocol Buffer Messages via Akka IO and Sockets

牧云@^-^@ 提交于 2019-12-05 09:08:47
I came across this blog post , which I found awesome and enlightening, showing how to do fixed-length framing of string messages sent to an Akka IO socket server. I have been working with an open source library I found here called ScalaBuff , which creates a nice thin layer on top of protocol buffer objects. The trouble I'm having is in adapting the blog author's (couldn't find a link to contact him directly) code to take the length (4-byte sequence) and then the protobuf byte array. I can worry about figuring out which message is on the wire later, right now I just want to get the code to

Java Serialization with Protocol Buffer

感情迁移 提交于 2019-12-05 08:12:15
I want to use protobuff in a Java application to facilitate serialization and I have a question about this quote from the Google web site Protocol Buffers and O-O Design Protocol buffer classes are basically dumb data holders (like structs in C++); they don't make good first class citizens in an object model. If you want to add richer behaviour to a generated class, the best way to do this is to wrap the generated protocol buffer class in an application-specific class. Wrapping protocol buffers is also a good idea if you don't have control over the design of the .proto file (if, say, you're

Compile Protocol Buffers 2.6.1 using VS 2015?

对着背影说爱祢 提交于 2019-12-05 07:21:25
I want to use ProtoBuf 2.6.1 with a VS 2015 C++ application. However, I can't link against libprotobuf.lib compiled using VS 2013. I tried to compile libprotobuf.lib again using VS 2015, but am running into compile errors, complaining about <hash_map> and <hash_set> being deprecated. It looks like the cmake files for ProtoBuf at the GitHub repo are now all set up for ProtoBuf 3.0. Is it still possible to compile libprotobuf using VS 2015? Paul To get the unit tests running you also need to modify a couple of tests that concatenate strings with a preprocessor macro in the middle. Just add a

Binary object graph serialization

不想你离开。 提交于 2019-12-05 06:58:28
I'm looking for advice on serialization in a .net app. The app is a desktop/thick client app and the serialization represents the persisted document format. The requirements for the serializer is Must allow serializing fields, not public properties only. Must not require parameterless constructors. Must handle general object graphs, i.e. not only DAG but shared/bidirectional references. Must work with framework classes (e.g. Serialize Dictionaries). Currently we use the BinaryFormatter which handles all of the above quite well, but size/performance and version tolerance is an issue. We use the

High performance object serialization library supporting sum types

江枫思渺然 提交于 2019-12-05 05:38:26
I wonder if any of the high performance serialization libraries (like Google protocol buffers) support sum types . Sum types are tagged unions, basically the ability to say that something is either A, B, or C. Sum types are used in languages such as Haskell and ML which support Algebraic Data Types If by "like Google protocol buffers" you mean ability to generate code for multiple languages then probably such thing doesn't exist. Emulating sum types in languages which don't support them is awkward at best (try to pattern match on boost:variant for example). So it makes sense to leave them out

C# .net protocol buffers - protobuf-net support for serializing dictionary of object values?

纵然是瞬间 提交于 2019-12-05 04:29:40
i'm new to protocol buffers and I am using protobuf-net for VS2010. from what i'm reading here Dictionary in protocol buffers , it doesn't seem that protobuf can serialize a dictionary with object types as values. but here on his site i read this: Notes on types supported: custom classes that: are marked as data-contract have a parameterless constructor for Silverlight: are public many common primitives etc single dimension arrays: T[] List / IList Dictionary / IDictionary any type which implements IEnumerable and has an Add(T) method The code assumes that types will be mutable around the

How protobuf-net serialize DateTime?

左心房为你撑大大i 提交于 2019-12-05 04:01:22
I'm working on a project consisting on Client/Server. Client is written in Python (will run on linux) and server in C#. I'm communicating through standard sockets and I'm using protobuf-net for protocol definition. However, I'm wondering how would protobuf-net handle DateTime serialization. Unix datetime differs from .net standard datetime, so how should I handle this situation? Thanks DateTime is spoofed via a multi-field message that is not trivial, but not impossible to understand. In hindsight, I wish I had done it a different way, but it is what it is. The definition is available in bcl

package com.google.protobuf does not exist on OS X Maverick

浪尽此生 提交于 2019-12-05 02:51:27
I am on OS X Mavericks and starting learning about protobuf, i download the example from https://code.google.com/p/protobuf/downloads/list I am successfully able to create the .java file from the proto but while compiling the existing java code using make java, i am getting following error com/example/tutorial/AddressBookProtos.java:91: package com.google.protobuf does not exist com.google.protobuf.GeneratedMessage ^ com/example/tutorial/AddressBookProtos.java:12: package com.google.protobuf does not exist extends com.google.protobuf.MessageOrBuilder { ^ com/example/tutorial/AddressBookProtos

Protobuf streaming (lazy serialization) API

本小妞迷上赌 提交于 2019-12-05 02:44:40
问题 We have an Android app that uses Protocol Buffers to store application data. The data format (roughly) is a single protobuf ("container") that contains a list of protobufs ("items") as a repeated field: message Container { repeated Item item = 1; } When we want to save a change to an item, we must recreate the protobuf container, add all the items to it, then serialize it and write it to a file. The problem with this a approach is it potentially triples the memory used when saving because the