qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Anthony Liguori" <anthony@codemonkey.ws>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] ARM QOM conversion / class hierarchy
Date: Tue, 20 Mar 2012 17:01:52 +0000	[thread overview]
Message-ID: <201203201701.53143.paul@codesourcery.com> (raw)
In-Reply-To: <20120320163120.GB29058@illuin>

> Rather than key off an ID you could also just break
> implementation-specific functionality out into a set of interfaces you
> implement/override as part of the objects' initialization. Same ends, and
> still fits the model pretty nicely, assuming the functionality is all
> derivable from the common base-class.

I don't think that helps a great deal, and the implementation ends up much the 
same.

You're just replacing an explicit enumeration with an implicit set of 
subclasses.  The only reason I can see for that is if you want to build a 
deliberately crippled version of qemu, which seems a bit of a stretch. Of if 
you're trying to maintain something out of tree, in which case you deserve all 
the pain we can give you.

Note that you can't make the interface part of the CPUState object, as single 
inheritance prevents those having any state.  It has to be a separate object 
that the CPUState links to.

Paul

      parent reply	other threads:[~2012-03-20 17:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 12:12 [Qemu-devel] ARM QOM conversion / class hierarchy Peter Maydell
2012-03-20 14:08 ` Paul Brook
2012-03-20 14:59   ` Peter Maydell
2012-03-20 16:06     ` Paul Brook
2012-03-20 16:20       ` Peter Maydell
2012-03-20 17:14         ` Paul Brook
2012-03-20 17:19           ` Peter Maydell
2012-03-20 16:56   ` Anthony Liguori
2012-03-20 17:14     ` Paul Brook
2012-03-20 17:20       ` Andreas Färber
2012-03-20 16:31 ` Michael Roth
2012-03-20 16:32   ` Peter Maydell
2012-03-20 19:04     ` Michael Roth
2012-03-20 17:01   ` Paul Brook [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201203201701.53143.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).