qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] a QOM Coding Conventions question


From: Peter Maydell
Subject: Re: [Qemu-devel] a QOM Coding Conventions question
Date: Sat, 14 Dec 2013 23:42:18 +0000

On 14 December 2013 23:06, Peter Crosthwaite
<address@hidden> wrote:
> On Sat, Dec 14, 2013 at 6:26 AM, Antony Pavlov <address@hidden> 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...)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]