path: root/doc
diff options
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-02-08 13:25:59 -0300
committerHugo Lima <hugo.lima@openbossa.org>2010-02-09 18:59:24 -0200
commitebf9aed32e291bb832fa59fa8dd6f17fe004e4e2 (patch)
tree86224bc76b352634f60ff9aeb27e376fd3587b78 /doc
parent8d037108eb0216e178855bb2ba22a09154454ea9 (diff)
Reactivated 'reference-count' tag.
The type system tag '<reference-count action="Add|Remove|..."/>' used on argument modification was uncommented, documentation was written and a unit test was created for it. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Diffstat (limited to 'doc')
1 files changed, 31 insertions, 1 deletions
diff --git a/doc/typesystem_arguments.rst b/doc/typesystem_arguments.rst
index eb035509..eef455d9 100644
--- a/doc/typesystem_arguments.rst
+++ b/doc/typesystem_arguments.rst
@@ -112,7 +112,37 @@ define-ownership
<define-ownership class="target | shell"
owner="target | c++ | default" />
- </modify-argument>
+ </modify-argument>
+ The reference-count tag dictates how an argument should be handled by the
+ target language reference counting system (if there is any), it also indicates
+ the kind of relationship the class owning the function being modified has with
+ the argument. For instance, in a model/view relation a view receiving a model
+ as argument for a **setModel** method should increment the model's reference
+ counting, since the model should be kept alive as much as the view lives.
+ Remember that out hypothetical view could not become parent of the model,
+ since the said model could be used by other views as well.
+ The ``action`` attribute specifies what should be done to the argument
+ reference counting when the modified method is called. It accepts the
+ following values:
+ * add: increments the argument reference counter.
+ * remove: decrements the argument reference counter.
+ * ignore: does nothing with the argument reference counter
+ (sounds worthless, but could be used in situations
+ where the reference counter increase is mandatory
+ by default).
+ .. code-block:: xml
+ <modify-argument>
+ <reference-count action="add|remove|ignore" />
+ </modify-argument>