Implement copy constructor for class Monitor
To support the instance copy of Monitor like the following:
AMQP::Monitor monitor(consumer);
consumer->bindExchange(exchange, AMQP::direct).onSuccess([&, monitor](){
// do something when the consumer is ready!
if(monitor.valid())
consumer->doSomething();
});
This commit is contained in:
parent
fe01610e96
commit
4b7874c5b6
|
|
@ -57,6 +57,16 @@ public:
|
||||||
_watchable->add(this);
|
_watchable->add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy constructor
|
||||||
|
* @param monitor
|
||||||
|
*/
|
||||||
|
Monitor(const Monitor &monitor) : _watchable(monitor._watchable)
|
||||||
|
{
|
||||||
|
// register with the watchable
|
||||||
|
_watchable->add(this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue