qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PROTON-1288) c++ provide access to message maps as proton::value
Date Wed, 24 May 2017 19:45:04 GMT

    [ https://issues.apache.org/jira/browse/PROTON-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16023536#comment-16023536
] 

ASF subversion and git services commented on PROTON-1288:
---------------------------------------------------------

Commit 864519ddca6c45a10ec01598b3ff3b33e5591561 in qpid-proton's branch refs/heads/master
from [~aconway]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=864519d ]

PROTON-1288: c++ provide convenient access to message/filter maps

proton::map type to wrap map values for message properties/annotations and source filters.

Has the following features:

- type safe template for the standard AMQP 'restricted map' types
- simple get()/put() interface for simple check/set individual properties
- converts directly to/from a proton::value efficient pass-through, no re-coding
- converts directly to/from std:map, std::unordered_map etc.
- encode/decode only as required

Intended use: use proton::map directly for simple get()/put(), convert to a
standard map or sequence type for more complex use (iteration, preserving
encoded order etc.)


> 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, 0.15.0
>            Reporter: Alan Conway
>            Assignee: Alan Conway
>             Fix For: 0.18.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.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message