diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-07-20 11:53:01 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 19:10:18 -0300 |
commit | e486e0bbe2065bbc228f84f93178e0636475021b (patch) | |
tree | 68477e77776beb0c4c1766b186e0072a35679876 /doc | |
parent | b3644ccd1f52073ed70ce8b6e0ed4f58a07632d7 (diff) |
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 <hugo.lima@openbossa.org>
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/typesystem_specifying_types.rst | 13 |
1 files changed, 13 insertions, 0 deletions
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="..." /> </typesystem> @@ -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. |