From e486e0bbe2065bbc228f84f93178e0636475021b Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Wed, 20 Jul 2011 11:53:01 -0300 Subject: Added default constructor option for value types. The unit test is in place and the 'value-type' tag documentation was update with information about the 'default-constructor' attribute. Reviewed by Hugo Parente Reviewed by Luciano Wolf --- doc/typesystem_specifying_types.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/typesystem_specifying_types.rst') diff --git a/doc/typesystem_specifying_types.rst b/doc/typesystem_specifying_types.rst index cadddfe99..d5a4ef2d9 100644 --- a/doc/typesystem_specifying_types.rst +++ b/doc/typesystem_specifying_types.rst @@ -94,6 +94,11 @@ primitive-type and "long long" become "long" but we should prefer the "qint64" version. For this reason we mark "long long" with preferred-conversion="no". + The *optional* **default-constructor** specifies the minimal constructor + call to build one value of the primitive-type. This is not needed when the + primitive-type may be built with a default constructor (the one without + arguments). + The *optional* **preferred-conversion** attribute tells how to build a default instance of the primitive type. It should be a constructor call capable of creating a instance of the primitive type. Example: a class "Foo" could have @@ -212,6 +217,7 @@ value-type copyable="yes | no" hash-function="..." stream="yes | no" + default-constructor="..." revision="..." /> @@ -226,6 +232,13 @@ value-type The *optional* **since** value is used to specify the API version of this type. + The *optional* **default-constructor** specifies the minimal constructor + call to build one instance of the value-type. This is not needed when the + value-type may be built with a default constructor (the one without arguments). + Usually a code generator may guess a minimal constructor for a value-type based + on its constructor signatures, thus **default-constructor** is used only in + very odd cases. + The **revision** attribute can be used to specify a revision for each type, easing the production of ABI compatible bindings. -- cgit v1.2.3