> On Aug. 7, 2013, 7:22 p.m., Andrew Stitcher wrote:
> > /trunk/qpid/cpp/include/qpid/messaging/Message.h, line 45
> > <https://reviews.apache.org/r/13328/diff/2/?file=338325#file338325line45>
> >
> >     To be consistent with the other constructors there should be one that 
> > takes a Variant now.
> 
> Gordon Sim wrote:
>     I'll add that.
> 
> Gordon Sim wrote:
>     Actually, this more problematic. If I add such a constructor then 
> expressions such as:
>     
>        Message m("blah");
>     
>     will no longer compile due to ambiguity between the existing constructor 
> taking a std::string and this new one.
> 
> Andrew Stitcher wrote:
>     Perhaps we should make the Variant constructors explicit - that should 
> fix this problem.

The problem with that is that it breaks the API, which I'd like to avoid, and 
actually prevents you doing some useful things. I'm not sure the consistency in 
Message is worth that change. The latest patch does add a constructor that 
takes a (non-const) reference to a Variant. While not ideal, this does avoid 
the ambiguity issue without breaking the API and while still offering a way to 
pass in an initial object if desired.


- Gordon


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/13328/#review24805
-----------------------------------------------------------


On Aug. 8, 2013, 11:39 a.m., Gordon Sim wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/13328/
> -----------------------------------------------------------
> 
> (Updated Aug. 8, 2013, 11:39 a.m.)
> 
> 
> Review request for qpid.
> 
> 
> Bugs: QPID-5040
>     https://issues.apache.org/jira/browse/QPID-5040
> 
> 
> Repository: qpid
> 
> 
> Description
> -------
> 
> In AMQP 1.0, though you can of course still send raw data (as a Data section) 
> with a content-type specified in the properties, the preferred method of 
> sending maps and lists is through an AmqpValue section with the type encoded 
> in the bytes making up that section.
> 
> Over 0-10, the approach used was to have encode/decode functions that work 
> with a Variant::Map or Variant::List. The application was responsible for 
> encoding outgoing messages before sending them and checking the content-type 
> on received messages and decoding them if appropriate.
> 
> Now that the content-type cannot be relied on to indicate the type of the 
> message (indeed the specification encourages it *not* to be used, relying 
> only on the type encoding in the AmqpValue section), a different approach is 
> necessary.
> 
> I've added a method to Message to get the content as a Variant. This can be 
> used for a whole range of different types of data including binary or maps 
> and lists. See the changes to qpid-send and qpid-receive for example of how 
> to use this.
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/cpp/examples/messaging/drain.cpp 1510678 
>   /trunk/qpid/cpp/examples/messaging/map_receiver.cpp 1510678 
>   /trunk/qpid/cpp/examples/messaging/map_sender.cpp 1510678 
>   /trunk/qpid/cpp/examples/messaging/spout.cpp 1510678 
>   /trunk/qpid/cpp/include/qpid/messaging/Message.h 1510678 
>   /trunk/qpid/cpp/src/CMakeLists.txt 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/DataBuilder.h PRE-CREATION 
>   /trunk/qpid/cpp/src/qpid/amqp/DataBuilder.cpp PRE-CREATION 
>   /trunk/qpid/cpp/src/qpid/amqp/Encoder.h 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/Encoder.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/ListBuilder.h PRE-CREATION 
>   /trunk/qpid/cpp/src/qpid/amqp/ListBuilder.cpp PRE-CREATION 
>   /trunk/qpid/cpp/src/qpid/amqp/MapBuilder.h 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/MapBuilder.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/MessageEncoder.h 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/MessageEncoder.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/MessageReader.h 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/MessageReader.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/descriptors.h 1510678 
>   /trunk/qpid/cpp/src/qpid/amqp/typecodes.h 1510678 
>   /trunk/qpid/cpp/src/qpid/broker/amqp/Message.h 1510678 
>   /trunk/qpid/cpp/src/qpid/broker/amqp/Message.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/broker/amqp/Translation.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h 1510678 
>   /trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/client/amqp0_10/IncomingMessages.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/client/amqp0_10/OutgoingMessage.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.h 1510678 
>   /trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/messaging/Message.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/messaging/MessageImpl.h 1510678 
>   /trunk/qpid/cpp/src/qpid/messaging/MessageImpl.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.h 1510678 
>   /trunk/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp 1510678 
>   /trunk/qpid/cpp/src/qpid/types/encodings.h PRE-CREATION 
>   /trunk/qpid/cpp/src/tests/qpid-receive.cpp 1510678 
>   /trunk/qpid/cpp/src/tests/qpid-send.cpp 1510678 
> 
> Diff: https://reviews.apache.org/r/13328/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Gordon Sim
> 
>

Reply via email to