Can you please give me an example of using the reflection SetString
method?
//this compiles
reflection-GetString(fractal_handle,fractal.GetDescriptor()-
FindFieldByName(name));
//this doesn't
reflection-SetString(fractal_handle,fractal.GetDescriptor()-
FindFieldByName(name),Mandlebrot);
I have a message which describes an image:
message Image
{
required int32 width = 1;
required int32 height = 2;
optional string name = 3;
message Pixel
{
required int32 red = 1;
required int32 green = 2;
required int32 blue = 3;
optional int32 alpha = 4;
}
repeated Pixel pixels =
I have the following message:
message device
{
enum Retraction
{
HOUSED = 0;
EXTENDED = 1;
}
optional Retraction retraction = 1;
}
How do I fix my syntax to set the retraction field (below)?
int main()
{
device dev;
if (stabiliser.retraction()==RR_system::HOUSED) coutTrue\n;
There was a typo in my original question. Should read:
int main()
{
device dev;
//this works
if (stabiliser.retraction()==device::HOUSED) coutTrue\n;
//but this doesn't compile
stabiliser.set_retraction(device::RETRACTED);
}
--
You received this message because you are subscribed to the
Both the following work in my code:
const Descriptor* d=message-GetDescriptor();
const Descriptor* d=message-descriptor();
What's the difference and which should I use?
Thanks!
--
You received this message because you are subscribed to the Google Groups
Protocol Buffers group.
To post to
1. Is there anything incorrect in my understanding so far?:
* Descriptors = INTROSPECTION (querying the message structure at
runtime)
* Reflection = Introspection + MODIFYING the message structure at
runtime
* Descriptors and Reflection are implemented as C++ structures with
member functions
*
I am new and want to understand the purpose/usage of default values in
the .proto file. E.g:
test
{
optional string a 1 [default =test];
}
When I create a message object and read the field value, the default
will be displayed:
test thing;
coutthing.a();
But when I serialise, write to a file,
Let's assume I'm designing a distributed (client-server) application.
The server owns a bunch of parameters. The client (GUI) is to be
periodically updated when any of their values change.
I could:
i) send a small wire message containing one field each time it changes
ii) periodically send a big
Hi,
I'm running Linux Mint, and trying to get started with protobuf-2.3.0.
My install was as follows (no problems reported that I could see):
./configure --prefix=/usr
make clean
make check
sudo make install
I then created a directory with a simple .proto file and executed:
protoc --ccp_out=.