Re: [protobuf] How to use reflection of Protobuf to modify a Map

2022-04-26 Thread 'Adam Cozzette' via Protocol Buffers
For the purposes of reflection, maps are treated like a repeated field of
messages, where each message has a key in field 1 and a value in field 2.
The Descriptor type has map_key()

and map_value() methods to make it easy to get ahold of the key and value
field descriptors.

On Tue, Apr 26, 2022 at 8:05 AM Yuhui ZHI  wrote:

>
> https://stackoverflow.com/questions/71995707/how-to-use-reflection-of-protobuf-to-modify-a-map
>
> I just don't know how to use reflection to set a google::protobuf::Map.
>
> Can someone show me an example?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/83e20e38-162a-4a20-98db-86b9fc547091n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CADqAXr5xcHEec03ERBVdoyCtjq5L0JnuNKeXMqsHcKt_y37NfQ%40mail.gmail.com.


[protobuf] How to use reflection of Protobuf to modify a Map

2022-04-26 Thread Yuhui ZHI
https://stackoverflow.com/questions/71995707/how-to-use-reflection-of-protobuf-to-modify-a-map

I just don't know how to use reflection to set a google::protobuf::Map.

Can someone show me an example?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/83e20e38-162a-4a20-98db-86b9fc547091n%40googlegroups.com.