[
https://issues.apache.org/jira/browse/PROTON-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15446652#comment-15446652
]
Andrew Stitcher commented on PROTON-1288:
-----------------------------------------
I'd pretty much reached the same conclusion as this as well.
So I think we are in agreement here:
* Need to add a few more scalar types to represent string_or_null,
symbol_or_null and maybe timestamp_or_null.
Aside: This last may not actually be required from a reading the spec which is
maddeningly ambiguous when talking about absent properties of messages. It just
talks about treating them as the appropriate default values for the type, but
doesn't seem to specify the appropriate defaults for any types!
* And add _value getter variants which return these scalar variants - they will
automatically convert to value in most useful contexts (assignment and
construction) so _value isn't a misnomer.
* Also add value setters.
> c++ provide access to message maps as proton::value
> ---------------------------------------------------
>
> Key: PROTON-1288
> URL: https://issues.apache.org/jira/browse/PROTON-1288
> Project: Qpid Proton
> Issue Type: Bug
> Components: cpp-binding
> Affects Versions: 0.14.0
> Reporter: Alan Conway
> Assignee: Alan Conway
> Fix For: 0.15.0
>
>
> We need to provide access to the message property maps as a proton::value.
> Given
> {code}
> std::map<string, scalar> my_map;
> proton::message m;
> {code}
> Here are some options:
> 1. Add new message accessor: proton::value& properties_value()
> proton::get(m.properties_value(), my_map)
> 2. Add value() accessor to cached_map
> proton::get(m.properties().value(), my_map)
> 3. Make cached_map : public proton::value()
> proton::get(m.properties(), my_map)
> 3 is neatest, 1 provides a clearer separation between the case where you want
> a convenient cached map vs. you want to decode to your own C++ map, work on
> it, and possibly re-encode it later. I lean towards 3. but open to persuasion.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]