You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Alan Conway <ac...@redhat.com> on 2012/01/31 16:47:29 UTC

Re: ./qpid/management/ManagementDirectExchange.h

On 05/12/2011 02:57 PM, Carl Trieloff wrote:
>
>
> ManagementDirectExchange::ManagementDirectExchange(const std::string&  _name,
>                                                     bool
> _durable,
>                                                     const FieldTable&   _args,
>                                                     Manageable*
> _parent, Broker* b ) :
>      Exchange (_name, _durable, _args, _parent, b),
>      DirectExchange(_name, _durable, _args, _parent, b),
>      managementAgent(0) {}
>
>
> why do we call Exchange() and DirectExchange() -- we only need
> DirectExchange() which will call Exchange() or am I missing something?
>

class ManagementDirectExchange : public virtual DirectExchange

Using virtual inheritance forces  you to explicitly call all the base class 
constructors, a bit of arcane C++ lore. However I have no idea why virtual 
inheritance is used here. It may be unnecessary.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: ./qpid/management/ManagementDirectExchange.h

Posted by Andrew Stitcher <as...@redhat.com>.
On Tue, 2012-01-31 at 10:47 -0500, Alan Conway wrote:
> On 05/12/2011 02:57 PM, Carl Trieloff wrote:
> >
> >
> > ManagementDirectExchange::ManagementDirectExchange(const std::string&  _name,
> >                                                     bool
> > _durable,
> >                                                     const FieldTable&   _args,
> >                                                     Manageable*
> > _parent, Broker* b ) :
> >      Exchange (_name, _durable, _args, _parent, b),
> >      DirectExchange(_name, _durable, _args, _parent, b),
> >      managementAgent(0) {}
> >
> >
> > why do we call Exchange() and DirectExchange() -- we only need
> > DirectExchange() which will call Exchange() or am I missing something?
> >
> 
> class ManagementDirectExchange : public virtual DirectExchange
> 
> Using virtual inheritance forces  you to explicitly call all the base class 
> constructors, a bit of arcane C++ lore. However I have no idea why virtual 
> inheritance is used here. It may be unnecessary.

There was a lot of unnecessary use of virtual inheritance early in the
history of the C++ code. Much of it has gone as code has been
maintained, quite possibly this is just an unnoticed hangover from that
era.

It's unlikely that virtual inheritance is really necessary here.

Andrew



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org