[protobuf] Re: ProtobufStreamObjectSource

2021-07-12 Thread Sanjana Gupta
But actually, the unit tests make me think otherwise. They use a variety of different messages in the tests. On Monday, July 12, 2021 at 3:24:17 PM UTC-7 Sanjana Gupta wrote: > I actually found this in the comments: > "This implementation uses a google.protobuf.Type for tag and

[protobuf] Re: ProtobufStreamObjectSource

2021-07-12 Thread Sanjana Gupta
I actually found this in the comments: "This implementation uses a google.protobuf.Type for tag and name lookup." Which implies I can write my own extension similar to this for my own message type it seems. On Monday, July 12, 2021 at 3:14:21 PM UTC-7 Sanjana Gupta wrote: > Hi,

[protobuf] ProtobufStreamObjectSource

2021-07-12 Thread Sanjana Gupta
Hi, I want to use ProtobufStreamObjectSource in a project. I am a little confused about the type.pb.h and type_info.h files. Is this an example class (ProtobufStreamObjectSource) that uses type.pb.h and type_info.h as example case and I should implement my own extension of the ObjectSource cl

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-31 Thread sanjana gupta
Hello Marc, I wanted to let you know that I tried using *fixed32 and fixed64* protobuf types and it has helped me save quite some bytes on the encoded data size. Allow me to show the protobuf message I created which is capable for storing one or multiple v4/v6 IPs : message IpAddress { messag

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread sanjana gupta
", which will always take 4 bytes, but... if you do that, you > can't conveniently store ipv6 in the same field. So: since you mention > needing to store both ipv4 and ipv6, "repeated bytes" is your simplest > option. And as above: it isn't any more expensive than &q

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread sanjana gupta
ired. > > On Wed, 18 Jul 2018, 10:28 sanjana gupta, > wrote: > >> Hey Marc, >> >> I am sorry if I am repeating my words. Please enlighten me on this thing : >> >> "bytes" requires me to give a std::string (c++) value as input. The >> problem

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread sanjana gupta
nt" type) Is my understanding correct? Thanks! On Wednesday, July 18, 2018 at 2:40:01 PM UTC+5:30, Marc Gravell wrote: > > At that point I'd probably use "repeated bytes", then. It'll cost you an > extra byte on v4 addresses, but it is simple. > > On Wed, 1

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread sanjana gupta
nce it will only require a single > header. You can then create a union of those: > > oneof ip_addr { > fixed32 v4 = 1; > bytes v6 = 2; > } > > That seems pretty optimal to me. > > Marc > > On Wed, 18 Jul 2018, 08:16 sanjana gupta, >

[protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread sanjana gupta
I read that protobuf has a type called "*bytes*" which can store arbitrary number of bytes and is the equivalent of "C++ string". The reason why I don't prefer to use "bytes" is that it expects input as a C++ string i.e., boost IP will need to be converted to a string. Now my concern lies