-
Refer to the Object
Parameter Examples
-
in parameters share a reference count (#1)
-
caller supplies var as parameter
-
server simply uses the object as necessary
-
if server needs to retain the object it must duplicate the reference
-
return values must give a reference count to the caller (#2)
-
after computing answer, server uses _retn() to give the reference back
-
be careful, though, if Va is a member variable
-
if so, you just gave away your reference
-
instead:
Object_var result = Va; return result._retn()
-
out parameters also give a reference back (#3)
-
caller uses
out()
method to provide a return area
-
server assigns a return value to the pointer reference
-
inout
parameters are more complex (#4)
-
Caller gives a reference which is released and then give a new reference
-
caller uses
inout
method to provide a value and capture the result
-
server can use p like an in parameter
-
but must release p if an out value is to be supplied
|