Hi,
Does anyone know if Protobuf's C++ output is ever going to support
enum classes? I'd like to be able to define the elements of my enum in
just one place (i.e. in the message definition file) and then use that
definition throughout my program, but I'd like it to be defined as an
enum class
Did you include the output of pkg-config --libs protobuf in your
linker command line?
Chris
On Sat, 24 Sep 2011 03:18:16 -0700 (PDT)
$ag@r Takawane [B-08] sagartakaw...@gmail.com wrote:
Hi all,
I have compiled protobuf code(.cc generated by protoc), its
wrapper(.cc c files) and made .a
Assuming you have a MyMessage, use the has_messagecommand() and
has_messageclose() functions to figure out whether each optional
field is present or absent.
Chris
On Mon, 26 Sep 2011 10:37:48 -0700 (PDT)
EJ j.gra...@gmail.com wrote:
Hello, I'm new to protocol buffers, so this may be a very
Did you remember to delimit your protobuf messages when sending them
over your sockets? Your use of send() suggests you're using a stream
socket and not a datagram socket (though that's no guarantee). If you
tell Protobuf to decode starting from the wrong place, or don't give
it
a full message, or
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
On Wed, 5 Oct 2011 02:48:39 -0700 (PDT)
yorick yorick.bru...@gmail.com wrote:
[snip]
Java :
Socket sock;
On Thu, 6 Oct 2011 01:00:37 -0700 (PDT)
yorick yorick.bru...@gmail.com wrote:
I have now for the Java (this is unchanged) :
--
IRobotData data = getRobotData();
System.out.println(phi:+data.getPhi()+,
distance:+data.getDistance());
int serDataSize =
What seems to be the problem? I just created a simple test case that
seems to work perfectly.
My proto file looks like this:
CUT HERE
message Outer {
message Inner {
required int32 foo = 1;
}
optional Inner inner = 1;
}
CUT HERE
My C++ source file looks
Not happening for me.
-- message.proto --
enum Value {
V1 = 0;
V2 = 1;
V3 = 2;
}
message Message {
required Value value = 1;
required int32 integer = 2;
required string text = 3;
}
-- test.cpp --
#include message.pb.h
#include iostream
#include
Protobuf messages are not aware of their own sizes, and you haven't
told the input stream how many bytes of message it should consume. Try
this:
coded_input-ReadLittleEndian32(objtype);
coded_input-ReadLittleEndian32(objlen);
CodedInputStream::Limit lim = coded_input-PushLimit(objlen);
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
If you're worried, just spec your format such that when you write a
binary-format file, you shove a magic unprintable signature on the
front. Now when you want to load data, try to parse it as binary first
(looking for the signature) and, if it
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
If you use the lite library instead of the full library, you lose
reflection/introspection (the ability to dynamically explore messages
without knowing at compile-time what type of message you're looking
at). As long as all you want to do is
On Tue, 17 Apr 2012 12:54:38 +0200
Martin Hellmich mhell...@cern.ch wrote:
Hi!
I am using google protocol buffers in C++ with memcached and I am
using the memcached_append command to edit lists.
I would like to know what happens if I append an item, which is not a
repeated field.
I
Protobuf messages do not have inherent delimiters; in fact, the
concatenation of two messages can sometimes be a perfectly valid single
message. Add delimiters in your protocol (if you are only sending a single
message then just shutdown() the socket afterwards and have the recipient
read until
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
You need to know how long the data will be, since Protobuf doesn’t tell
you that. Your protocol somehow decides that. Either you receive up to
EOF and that’s a message, or else the length of the message appears in
front of the message itself. I
Hi,
The -I option specifies where to look for files you refer to with
“import”. It is not used for the file you are trying to compile. You
want this:
protoc --cpp_out=/home/m/Projects /home/m/AddressBook.proto
If “AddressBook.proto” imports other proto files, you may then need to
add a -I
On Wed, 5 Dec 2012 07:37:40 -0800 (PST)
valadas valadas.gonc...@gmail.com wrote:
*FileinputStream pipe = new FileinputStream(pipeName);*
*char buffer = new char[4096];*
**
*pipe.read(buffer);*
*
MessagesProtos.OperationalMessage message =
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
On Fri, 8 Feb 2013 01:08:40 -0800 (PST)
RichM richardmur...@richardmurphy.demon.co.uk wrote:
it would be nice if i could do
typedef int ClientID
it appears not possible ?
tks
Richard.
Could you use the decltype() operator against a
See https://developers.google.com/protocol-buffers/docs/cpptutorial,
the section on required, optional, and repeated fields. The general
answer is yes, there’s full backwards and forwards compatibility
between different versions of protobuf and different versions of
your message, except that the
After unpacking your RAR file to get protobuff.log, I examined that
file. I believe that file is not a single message, but a set of
messages, and each message has a big-endian uint32 stuck in front of it
which is the length of the following message. For example, the first
four bytes are 0x00,
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Use the mutable_header() function instead. This creates the contained
object if it does not already exist, and returns a pointer instead of a
reference.
Chris
On Mon, 13 May 2013 02:34:49 -0700 (PDT)
Barzo dba...@gmail.com wrote:
Hi,
I have
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
On Thu, 23 May 2013 09:31:13 -0700 (PDT)
Ruffian Eo ruffia...@googlemail.com wrote:
Ever since I first used protocol buffers, the construct [packed=true]
appeared like a temporary hack to me.
Here my proposal:
Alternate syntax (with same
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Wouldn’t it be even smaller to do this
message Packet {
repeated uint32 pids = 1 [packed=true];
repeated string execnames = 2;
}
working under the assumption that the two repeated fields will be the
same length? You will burn two
On Thu, 15 Aug 2013 08:48:42 -0700 (PDT)
Nikolas Engelhard engelhard.niko...@gmail.com wrote:
Hello
I have a strange problem and need some assistance: I just started
using protobuf and transmit the serialized messages via TCP-Sockets
from Python to C++. This works very well if I don't use
On Tue, 20 Aug 2013 04:26:41 -0700 (PDT)
utkarsh deep utkarshdon1...@gmail.com wrote:
I want to send the structure over a network and my computer is Little
Endian and Host Computer is Big Endian .
Suppose I want to send
struct Contract_DESC CD;
char CounterPartyBrokerId[5];
On Sat, 24 Aug 2013 21:47:39 -0700 (PDT)
chrisg...@gmail.com wrote:
response = rpc_pb2.Response()
response.service_name =
response.method_name = SendHeartbeatResult
response.client_id = ALERT_SERVICE
response.status_cd = rpc_pb2.OK
response.response_proto =
On Mon, 26 Aug 2013 17:32:23 -0700 (PDT)
chrisg...@gmail.com wrote:
Thanks for taking the time to read/reply.
GetHeartbeat2 is my original version which I included as well and the
way I had thought it should probably work. This code is serializing
to string
on the inner buffer and then
.
--
Christopher Head
signature.asc
Description: PGP signature
library you use in your system: arrange for the .jar
to be in your classpath, like you would do with any other library .jar,
and then consume the appropriate classes in your own code, like you
would with any other library.
--
Christopher Head
signature.asc
Description: PGP signature
28 matches
Mail list logo