From: "Andreas Färber" <afaerber@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
Pantelis Koukousoulas <pktoss@gmail.com>,
Antony Pavlov <antonynpavlov@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] a QOM Coding Conventions question
Date: Mon, 16 Dec 2013 14:26:30 +0100 [thread overview]
Message-ID: <52AEFF86.9070106@suse.de> (raw)
In-Reply-To: <CAEgOgz5QUujFwrjWjHxnLXJD36fdsZJ+mBtzFxvuvLaFELo10w@mail.gmail.com>
Hi guys,
Am 16.12.2013 13:48, schrieb Peter Crosthwaite:
> On Sun, Dec 15, 2013 at 7:02 PM, Pantelis Koukousoulas
> <pktoss@gmail.com> wrote:
>> Why not add "protected" then for the fields that are only
>> meant to be accessible by the implementation but not
>> public ?
>>
>
> Ok by me if the documentation generation can be cleanly and easily
> taught to interpret this correctly. I don't know much about the docs
> TBH.
/*< private >*/ and /*< public >*/ are the only two visibility tags
supported by gtk-doc [1] (private=off and public=on, basically), so
unless someone sets out to write better tools, that won't work as intended.
And we do want to document what the meaning of certain fields is, so
using private everywhere is counterproductive.
The main reason why the gtk-doc patches [2] keep catching dust is that
the gtk-doc scanner tool makes some assumptions about coding style that
don't hold true for QEMU and thus required a slightly patched version of
gtk-doc (patches posted by Anthony Liguori).
So someone contributing a working gtk-doc compatible scanner (or getting
upstream gtk-doc to accept the necessary changes) might actually be
appreciated - in which case we could restart the discussion of mark-up
extensions.
Until then you can use human-readable comments to indicate that
something is not supposed to be touched (which I personally consider the
historical default though).
That said, the intent in the QOM usage that I adopted from Anthony L. is
to hide the implementation-specific parent field, just like I have been
fighting to get it out of DO_UPCAST() and related usage patterns.
The standardized name parent_obj serves to allow for grep'ing and
together with the requested spacing after the parent_obj field serves to
aid in visually spotting which structs are related to QOM. Apart from
the parent field, we have encouraged to group internal data fields such
as MemoryRegions vs. public child<> and link<> properties.
HTH,
Andreas
[1]
https://developer.gnome.org/gtk-doc-manual/1.18/documenting_symbols.html.en
[2] http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/gtk-doc
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-12-16 13:26 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
2013-12-15 9:02 ` Pantelis Koukousoulas
2013-12-16 12:48 ` Peter Crosthwaite
2013-12-16 13:26 ` Andreas Färber [this message]
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=52AEFF86.9070106@suse.de \
--to=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=antonynpavlov@gmail.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=pktoss@gmail.com \
--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).