qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Antony Pavlov" <antonynpavlov@gmail.com>
Subject: Re: [Qemu-devel] a QOM Coding Conventions question
Date: Sun, 15 Dec 2013 09:51:15 +1000	[thread overview]
Message-ID: <CAEgOgz7FAmq7Gybj4MpvdFD6-mtf0SnSbsFgbP4jstFrfhVf1Q@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_w=77K10ye0BLMLUbhH1h2dc_v0wh9UQfffxZyd4oF2A@mail.gmail.com>

On Sun, Dec 15, 2013 at 9:42 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 14 December 2013 23:06, Peter Crosthwaite
> <peter.crosthwaite@xilinx.com> wrote:
>> On Sat, Dec 14, 2013 at 6:26 AM, Antony Pavlov <antonynpavlov@gmail.com> wrote:
>>> What do the "< private >" and "< public >" comments exactly mean here?
>>
>> Private means inaccessible to everybody, including the implementation
>> of class being instantiated. No one should ever dereference a private
>> variable, they should be managed by QOM indirectly via casts if
>> needed. Public means that at least someone can access it. Note that
>> public does not declare a free-for-all. QOM class variables may be
>> "public" in the sense that the class implementation may access them.
>> Container devices however still can not, and they are private from
>> that point of view.
>
> I'm not sure I find this a terribly convincing explanation. Last time
> I asked this IIRC the answer was just "they need to be there for the
> output of the documentation generator".
>
> The usual definition of 'public' vs 'private' is "what can a user of the
> object rather than the implementor safely access?". That would be
> actually interesting to document IMHO. (I should resurrect my patch
> for marking those fields up with __private so we enforce it...)
>

Yes, that means we really have three levels of access, but only tags
for two. Hence the confusion over public.

Regards,
Peter

> thanks
> -- PMM
>

  reply	other threads:[~2013-12-14 23:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 20:26 [Qemu-devel] a QOM Coding Conventions question Antony Pavlov
2013-12-14 23:06 ` Peter Crosthwaite
2013-12-14 23:42   ` Peter Maydell
2013-12-14 23:51     ` Peter Crosthwaite [this message]
2013-12-15  9:02       ` Pantelis Koukousoulas
2013-12-16 12:48         ` Peter Crosthwaite
2013-12-16 13:26           ` Andreas Färber
2013-12-15 11:17   ` Antony Pavlov
2013-12-16 14:17     ` Andreas Färber

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=CAEgOgz7FAmq7Gybj4MpvdFD6-mtf0SnSbsFgbP4jstFrfhVf1Q@mail.gmail.com \
    --to=peter.crosthwaite@xilinx.com \
    --cc=afaerber@suse.de \
    --cc=antonynpavlov@gmail.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).