Hi Gordon,
Thanks for your help: your example indeed works (and it is in fact the
kind of behaviour that I was expecting from this class). I will
investigate further on my code to see whether I was doing some other
mistake.

Best,
Davide


-----Original Message-----
From: Gordon Sim [mailto:[email protected]] 
Sent: 01 March 2012 14:45
To: [email protected]
Subject: Re: Default copy constructor behaviour for the class
messaging::Receiver and messaging::Sender

On 03/01/2012 10:19 AM, Davide Anastasia wrote:
> What is the default behaviour for the copy constructor of the classes 
> messaging::Receiver and messaging::Sender?

All the common classes in the messaging API are 'handles' and can be
copied and assigned as expected. I.e. if creating a copy, both the
original and the copy refer to the same
sender/receiver/session/connection.

[...]
> It seems to me that the
> copy constructor just creates a blank Sender. (messaging::Receiver 
> shows the same problem).

It shouldn't. Does the attached example work for you? It creates a very
simple Producer class with a Sender as a member, uses the default copy
constructor for that to create a copy of that and then sends a message
using the sender in both original and copied instance.

(run e.g. the drain example to see the output: drain -f amq.topic)

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to