Re: [protobuf] Detecting modifications to Protobuf messages

2016-09-16 Thread 'Adam Cozzette' via Protocol Buffers
I have to admit that I'm not very familiar with the protocol buffers API
for Python, so hopefully someone more knowledgeable can chime in. But given
that Python does not have a message differencer, I think your best bet
would be to try to use the reflection API to implement something similar.
It should allow you to iterate over the fields for a particular message
type and check for differences between two protos. On this page
 under
"Advanced Usage" there are some hints about how to do this.

On Thu, Sep 15, 2016 at 10:16 AM, Jordan Kaye 
wrote:

> Hello all,
>
> I've been searching for the better part of a day without finding much
> information on this topic, so I figured I'd go ahead and ask here.
>
> I'm looking for a way to receive notifications of changes to individual
> Protobuf message instances. I have an application that would like to
> persist the changes of a message through time (event sourcing), and it
> would make things extremely clean if there were some way to accomplish this.
>
> If I were working in C++, it seems that there would at least be the
> possibility of using the message differencer for this (I could copy a
> message before applying some logic to it then run the differencer on the
> the copy and the message after the modification), but the code that I
> currently have is in Python.
>
> I understand that this is probably a very specific use case, but is there
> any way for me to achieve something like this?
>
> Thanks,
> Jordan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: protobuf-3.0 on freebsd-7

2016-09-16 Thread 'Adam Cozzette' via Protocol Buffers
Sowmya, my guess that your compiler version is just too old (it's from
2007). Could you try with a more recent version of g++ and let us know if
that solves the problem?

On Wed, Sep 14, 2016 at 10:53 PM, Sowmya Narayanam 
wrote:

> I am using g++ (GCC) 4.2.1 20070719  [FreeBSD]
>
>
>
> On Saturday, September 10, 2016 at 4:02:56 AM UTC+5:30, Gerben Stavenga
> wrote:
>>
>> I dont think the OS matters. Which version of g++ do you use?
>>
>>
>> On Friday, September 9, 2016 at 2:47:24 PM UTC-7, Sowmya Narayanam wrote:
>>>
>>> Can i compile protobuf-3.0 on freebsd-7
>>>
>>> Is there any compatibility matrix , for the supported OS and the probuf
>>> versions.
>>>
>>> I tried compiling and i got this error
>>>
>>> Making all in src
>>> depbase=`echo google/protobuf/api.pb.lo | sed
>>> 's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/bash ../libtool  --tag=CXX
>>> --mode=compile g++ -DHAVE_CONFIG_H  -I. -I.. -D_THREAD_SAFE -pthread
>>> -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT
>>> google/protobuf/api.pb.lo -MD -MP -MF $depbase.Tpo -c -o
>>> google/protobuf/api.pb.lo google/protobuf/api.pb.cc && mv -f
>>> $depbase.Tpo $depbase.Plo
>>> libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -D_THREAD_SAFE -pthread
>>> -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT
>>> google/protobuf/api.pb.lo -MD -MP -MF google/protobuf/.deps/api.pb.Tpo
>>> -c google/protobuf/api.pb.cc  -fPIC -DPIC -o
>>> google/protobuf/.libs/api.pb.o
>>> ./google/protobuf/arena.h: In static member function 'static
>>> GenericType* google::protobuf::internal::Ge
>>> nericTypeHandler::NewFromPrototype(const GenericType*,
>>> google::protobuf::Arena*) [with GenericType = google::protobuf::Option]':
>>> ./google/protobuf/arena.h:623: sorry, unimplemented: inlining failed in
>>> call to 'static T* google::protobuf::Arena::Creat
>>> eMaybeMessage(google::protobuf::Arena*, ...) [with T =
>>> google::protobuf::Option]': function not inlinable
>>> ./google/protobuf/repeated_field.h:565: sorry, unimplemented: called
>>> from here
>>> *** Error code 1
>>>
>>> Any help on this is highly appreciated. Thanks in advance
>>>
>>> regards,
>>> Sowmya
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: proto3 - message inside messages

2016-09-16 Thread Jordan Kaye
I believe you're looking for 
oneof: https://developers.google.com/protocol-buffers/docs/proto#oneof

--Jordan

On Wednesday, September 14, 2016 at 2:44:40 PM UTC-5, Sachin Gole wrote:
>
> Hi All,
>
> I have one requirement where I wanted to pass request object either Socket 
> or GetHost
>
> Can any one know how to define that in Action message
>
> message Action {
>
> uint32 protocol_version = 1; // protocol version
> int64 request_uid = 2; // request uid
> int64 socket_id = 3; // value 0 is reserved for static methods
> uint32 service_type = 4; // type of service which should process 
> message
> uint32 left_messages = 5;
> message request_object = 6;
> }
>
> message Socket {
>uint32 id = 1;
> }
>
> message GetHost {
> string url = 1;
> }
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.