[protobuf] How to make a self-describing message

2012-07-10 Thread Barzo
Hi, I'm new to PB and I would ask a simple thing... I've already read the 'Techniques' page but, if I want to do the following: enum EMessages { MSG_FIRST; MSG_SECOND; } message MsgHeader { required FileDescriptorSet proto_files = 1; required string type_name = 2; required EMessages op

[protobuf] Retrieve a message field from a stream

2013-01-23 Thread Barzo
Hi, I'm trying to implement a system like described here where I have a Type List of Messages. Now, when I receive a message from an endpoint, I need a way to retrieve the message opCode (which is a filed contained i

[protobuf] Re: Retrieve a message field from a stream

2013-01-30 Thread Barzo
> > > So you want to use the opCode value to distinguish which message is sent? > The common practice is that you always send the sam message over the wire, > like this: > message TheOneMessageSentOverTheWire { > optional EMessages opCode = 1; > optional MSG_METHOD_CONNECT message1 = 2; > o

Re: [protobuf] Re: Retrieve a message field from a stream

2013-01-31 Thread Barzo
> Those messages are optional. You will only send one, the one that you > actually add. The others take up no space in the serialized data stream. > > Chris > Hi Chris, of course, you're right! I'm only new on this way of implementation! :-) But I will adapt to it, if it's the best way! Dan

[protobuf] How to avoid error C2662 on nested messages

2013-05-13 Thread Barzo
Hi, I have messages defined as: message MsgHeader { required EMessages opCode= 1; required int32 sessionRef= 2; optional int32 transactionId = 3 [default = 0]; optional int32 status= 4 [default = 0]; } message MSG_EVENT_METHOD_STATUS { optional EMessa

Re: [protobuf] How to avoid error C2662 on nested messages

2013-05-14 Thread Barzo
ist, and returns a pointer instead of a > reference. > > Chris > > On Mon, 13 May 2013 02:34:49 -0700 (PDT) > Barzo > wrote: > > > Hi, > > I have messages defined as: > > > > message MsgHeader > > { > > required EMessages opCode

[protobuf] Use protobuf-net in C++/CLI

2013-10-07 Thread Barzo
Hi, I have built a C++ framework which use protobuf library. Now I'm writing a C++/CLI wrapper to make it visible in .NET world. Since I cannot made a wrapper for each message in my c++ .proto file, is there a way to use the protobuf-net generated c# file in a C++/CLI project? Regards, Daniele.

Re: [protobuf] Use protobuf-net in C++/CLI

2013-10-07 Thread Barzo
Hi Marc, thanks for your reply. To be more clear... In the native SDK I have a native Message class which encapsulate messages from the protoc generated file. Then, in the managed wrapper, I have a managed MessageNET class which has to encapsulate messages from protogen generated file. Of course

Re: [protobuf] Use protobuf-net in C++/CLI

2013-10-07 Thread Barzo
Thanks a lot! Daniele. Il giorno lunedì 7 ottobre 2013 11:55:13 UTC+2, Marc Gravell ha scritto: > > > On 7 October 2013 10:45, Barzo > wrote: > >> In a meanwhile I have built the .cs generated file into a separate DLL >> assembly and I added it (linked) to my C+