Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1241

proton::messaging_handler is not copyable (because it contains a pn_unique_ptr)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • proton-0.14.0
    • cpp-binding
    • None

    Description

      One fundamental of the Proton C++ API is that the user supplies their own handler class.

      We should strive in our implementation to limit the API user as little as possible. Unfortunately , because of some historical implementation decisions the messaging_handler class contains a single member which is not copyable (this is a unique_ptr to the associated internal messaging_adapter).

      This stops the user being able to natural things with her own classes like:

      class MyHandler: public messaging_handler {
      ...
      }
      ...
      auto h = MyHandler{};
      ...
      Myhandler g;
      auto i = g;
      

      The user knows what she wants to do with her classes and there is no real intrinsic requirement for the messaging_handler to keep hold of a messaging_adapter. So we need to get out of the users way and remove the pn_unique_ptr from messaging_handler.

      Attachments

        Activity

          People

            astitcher Andrew Stitcher
            astitcher Andrew Stitcher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: