Message ID | 20210729175554.686474-6-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
Series | QOM documentation updates | expand |
On 7/29/21 7:55 PM, Eduardo Habkost wrote: > Add two new subsection headings to make the separation between > "declaration macros" and "definition macros" more visible. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > docs/devel/qom.rst | 6 ++++++ > 1 file changed, 6 insertions(+) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
On Thu, 29 Jul 2021 at 19:01, Eduardo Habkost <ehabkost@redhat.com> wrote: > > Add two new subsection headings to make the separation between > "declaration macros" and "definition macros" more visible. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > docs/devel/qom.rst | 6 ++++++ > 1 file changed, 6 insertions(+) Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index 3f48016aa8f..05d045bf570 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -285,6 +285,9 @@ convention. To reduce the amount of boilerplate code that needs to be written for a new type there are two sets of macros to generate the common parts in a standard format. +Type declaration macros +----------------------- + A type is declared using the ``OBJECT_DECLARE`` macro family. In types which do not require any virtual functions in the class, the `OBJECT_DECLARE_SIMPLE_TYPE` macro is suitable, and is commonly placed @@ -323,6 +326,9 @@ struct, then the alternative `OBJECT_DECLARE_TYPE()` macro can be used. This does the same as `OBJECT_DECLARE_SIMPLE_TYPE()`, but without the 'struct MyDeviceClass' definition. +Type definition macros +---------------------- + To implement the type, the ``OBJECT_DEFINE`` macro family is available. In the simple case the `OBJECT_DEFINE_TYPE()` macro is suitable:
Add two new subsection headings to make the separation between "declaration macros" and "definition macros" more visible. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- docs/devel/qom.rst | 6 ++++++ 1 file changed, 6 insertions(+)