[protobuf] Re: Issue 274 in protobuf: Python generated protobufs are not hashable in 2.4.0a

2011-04-15 Thread protobuf
Updates: Status: WorkingAsIntended Comment #1 on issue 274 by liuj...@google.com: Python generated protobufs are not hashable in 2.4.0a http://code.google.com/p/protobuf/issues/detail?id=274 Sorry we didn't mention this in document. Quote from our internal change log:

[protobuf] Re: UnmodifiableLazyStringList is not Serializable

2011-04-15 Thread J.S.
Ok, I got it: - the buffer at once is serializable - a attribut of the buffer (a repeated string) might be not so I have to copy the UnmodifiableLazyStringList to an ArrayList if I'd like to use the attribut as an argument to pass between beans. Pro: I dont need to include protobuf.jar into all

[protobuf] abstract

2011-04-15 Thread Lars Schouw
Can I specify that the message is abstract so I can implemented it at will on my client? This is possible in XSD schemas. Lars -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To

[protobuf] Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
My problem is to serialize protobuf data in C++ and deserialize the data in Java probably. In fact I get **InvalidProtobufferException** in Java. Here is my minimal example: My protobuf file looks like this: option java_outer_classname = NameProtos; message Name { required

Re: [protobuf] Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread Jason Hsueh
On Fri, Apr 15, 2011 at 2:06 AM, platzhirsch konrad.rei...@googlemail.comwrote: My problem is to serialize protobuf data in C++ and deserialize the data in Java probably. In fact I get **InvalidProtobufferException** in Java. Here is my minimal example: My protobuf file looks like this:

[protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
Right! I think I refactored the whole writing and reading, still I am stuck. However by this I get this Exception: com.google.protobuf.UninitializedMessageException: Message missing required fields: name In C++: Name name; name.set_name(platzhirsch); boost::asio::streambuf b; std::ostream

Re: [protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread Jason Hsueh
On Fri, Apr 15, 2011 at 9:48 AM, platzhirsch konrad.rei...@googlemail.comwrote: Right! I think I refactored the whole writing and reading, still I am stuck. However by this I get this Exception: com.google.protobuf.UninitializedMessageException: Message missing required fields: name In C++:

[protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
I am sorry, could you clarify this? With destroy you mean call the delete operator? The changes: boost::asio::streambuf b; std::ostream os(b); ZeroCopyOutputStream *raw_output = new OstreamOutputStream(os); CodedOutputStream *coded_output = new CodedOutputStream(raw_output);

Re: [protobuf] Using Protocol Buffers without generating code

2011-04-15 Thread Jason Hsueh
Protobufs reflection support allows you to do this. We don't have a walkthrough, but you can create types dynamically using the Descriptors classes along with DynamicMessage. You can build the definitions you want into a FileDescriptorProto (along with any dependencies it may have) and call

Re: [protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread Jason Hsueh
yup, that's what I meant. Can you check that you are writing data to the stream? Also, I didn't notice that you are writing the message length as a header. Did you read that value from the socket prior to calling parse? The Java-side parseFrom call should only be reading the data read by

[protobuf] Re: Issue 274 in protobuf: Python generated protobufs are not hashable in 2.4.0a

2011-04-15 Thread protobuf
Comment #2 on issue 274 by wbm...@gmail.com: Python generated protobufs are not hashable in 2.4.0a http://code.google.com/p/protobuf/issues/detail?id=274 Thanks for the clarification and the recommendation. I assumed there was a good reason and it looks like now, even if I don't upgrade to

[protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
Adding the delete operator was good, now actually data it send, as the socket.send function now returns a value 0. I did not read the message length prior to calling parse, but I changed it: CodedInputStream cis =

[protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
Oh, maybe this line was flawed after all: System.out.println(name.newBuilder().build().toString()); Which cannot work, can it? ;-) I changed it to name.getName() and there it is, the data I've sent, thank you! -- You received this message because you are subscribed to the Google Groups

Re: [protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread Jason Hsueh
Oh, of course, glad it worked. Also I realized I was mistaken about CodedOutputStream: it doesn't do any internal buffering; it's OstreamOutputStream that does (some other ZeroCopyOutputStream implementations do as well). In any event, keep destroying the streams before you send. On Fri, Apr 15,

Re: [protobuf] how to use Protobuf encode map like structure?

2011-04-15 Thread Jason Hsueh
We have bandied about the idea of supporting maps for some time. Past discussion: http://groups.google.com/group/protobuf/browse_thread/thread/5b43b26dec43bf99 At the moment, you just have to build your own map structures around the protobuf. On Fri, Apr 8, 2011 at 2:56 PM, Felix

Re: [protobuf] Checking compatibility of Descriptors with the same full_name

2011-04-15 Thread Jason Hsueh
The Descriptor classes don't support this as typically we want to enforce that the Descriptor objects are in fact the same instances. In the protobuf code you'll see simple pointer comparisons. You could convert the descriptors back to DescriptorProtos and compare those: however, this won't

[protobuf] Issue 275 in protobuf: Incorrect installation with setup.py breaks local override

2011-04-15 Thread protobuf
Status: New Owner: ken...@google.com Labels: Type-Defect Priority-Medium New issue 275 by zbe...@google.com: Incorrect installation with setup.py breaks local override http://code.google.com/p/protobuf/issues/detail?id=275 What steps will reproduce the problem? 1. Unpack the distribution