Re: [protobuf] Inserting values by tag numbers

2011-07-08 Thread Pherl Liu
Which language are you using? In c++, you can call message::GetDescriptor()-FindFieldByNumber() to get a FieldDescriptor; then call GetReflection()-Set* functions. On Fri, Jul 8, 2011 at 3:58 AM, SM makkapati.suma...@gmail.com wrote: Hello, Is there a way to set the field value by the tag

[protobuf] Re: Issue 312 in protobuf: Required field with default value serializes if not set

2011-07-08 Thread protobuf
Comment #4 on issue 312 by big4...@gmail.com: Required field with default value serializes if not set http://code.google.com/p/protobuf/issues/detail?id=312 Thanks for the thorough explanation. I understand calling IsInitialized is not free, but the fact that the PartialSerialize and

[protobuf] Re: tag number range explanation

2011-07-08 Thread nicolas hofmann
Thank for your help but I don't think you understood my problem. I will give more detail. I'm trying to make communicate two process using protocol buffers in pipes (the group thing won’t work). For efficiency purpose, they will keep their connection as long as they are alive but the messages

[protobuf] comiler error from generated .proto file

2011-07-08 Thread Lars Schouw
I am getteing an error error CS1001: Identifier expected when I generate a .cs file from this .proto file. How can I fix this and make it compile? person.proto message Person { required int32 id = 1; optional string name = 2; optional string motto = 3 [default=When the cat is away, the mouse

[protobuf] java and dotnet

2011-07-08 Thread Lars Schouw
How do I construct protobuf-net messages from protostuff messages and visa versa? I am using protostuff from dotnet and this seems to work by using ikvm to call Java from C#. But I would like to move the java message objects back into my native net protobuffer framework, What is the

Re: [protobuf] java and dotnet

2011-07-08 Thread Marc Gravell
I haven't used protostuff/IKVM, but I would *hope* that IKVM allows some kind of passing of either a Stream or byte[]. That would allow you to serialize/deserialize to swap between models. If you have access to *both* models at once, perhaps another possibility is AutoMapper on the .NET side.

[protobuf] Re: Inserting values by tag numbers

2011-07-08 Thread SM
Hi, I'm using java I found the corresponding methods in java. Thanks for the quick response. On Jul 8, 3:08 am, Pherl Liu liuj...@google.com wrote: Which language are you using? In c++, you can call message::GetDescriptor()-FindFieldByNumber() to get a FieldDescriptor; then call

[protobuf] Re: New types?

2011-07-08 Thread Eric Hopper
On Jun 30, 10:16 am, Christopher Smith cbsm...@gmail.com wrote: You could always extend the compiler, but I bet you could get away with a simple preprocessor that aliases types and represents those larger integers as raw bytes. I guess. This is an interesting and general problem. Practically

[protobuf] Re: Safe way to access the functionality of MutableCProtoInsidePyProto

2011-07-08 Thread A Richardson
Responding to my own post in case the outcome is useful to anyone. I have been perplexed for a while with the python pyext (C++) implementation of protobuf, and i think I finally figured out how it was intended to work: python_protobuf.h declares the GetCProtoInsidePyProto and

[protobuf] Re: Issue 313 in protobuf: in c++ generated header, has_FIELD will return random results if more than 32 optional fields defined in single message

2011-07-08 Thread protobuf
Comment #2 on issue 313 by agca...@gmail.com: in c++ generated header, has_FIELD will return random results if more than 32 optional fields defined in single message http://code.google.com/p/protobuf/issues/detail?id=313 The problem was that the developer of the library I was using update

Re: [protobuf] Re: tag number range explanation

2011-07-08 Thread Jason Hsueh
Zero is reserved for historical reasons; it used to be used for propagating error codes. The wire format was designed with extensibility in mind; while in many applications unknown fields won't be encountered, this support is critical in many internal applications. Note that simply adding a zero

Re: [protobuf] comiler error from generated .proto file

2011-07-08 Thread Jason Hsueh
You'll have to check with the developer of the C# implementation for support, but it appears that this code is the initialization of the member to the default value. My guess is the implementation's code generator looks up the enum name of the default value, and assumes that the default value is

Re: [protobuf] Allocator Support for strings

2011-07-08 Thread Jason Hsueh
We don't support this at this time - the primary problem is that specifying an allocator for C++ string's produces a completely new type. This means allocators can't simply be injected into a particularly message instance; instead it would have to be part of the message definition. On Wed, Jul 6,

Re: [protobuf] Re: New types?

2011-07-08 Thread Christopher Smith
On Fri, Jul 8, 2011 at 9:46 AM, Eric Hopper omnifari...@gmail.com wrote: I guess. This is an interesting and general problem. Practically every system like protobuf needs to solve it. Python itself, for example, solves it for pickle by allowing you to write custom methods for your classes to

Re: [protobuf] Re: New types?

2011-07-08 Thread Jason Hsueh
Echoing Chris's messages, we don't really want to get into supporting arbitrary types in the core implementation. Various language-specific annotations could be added, but doing this portably across languages would be difficult. Supporting these types also complicate the reflection

Re: [protobuf] Allocator Support for strings

2011-07-08 Thread Gokulakannan Somasundaram
Thanks a lot for the reply. I understood that part. Currently in the .proto file, there is a string definition which gets translated to std::string. What we actually need is a typedef which can be configured as per the end user wish, before building the protobuf. But can i get some assistance on