ReturnObject and ReturnInfoObject (Daemon subroutines): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%"><b>Specify the objects returned to the master thread.</b></span>
{{Template:Daemon:ReturnObject and ReturnInfoObject subtitle}}


ReturnObject is a member of the [[Daemon class]]
ReturnObject is a member of the [[Daemon class]]
Line 7: Line 7:
The ReturnInfoObject method was added in ''[[Sirius Mods]]'' Version 6.8.
The ReturnInfoObject method was added in ''[[Sirius Mods]]'' Version 6.8.


==ReturnObject and ReturnInfoObject Syntax==
==Syntax==
<pre>
{{Template:Daemon:ReturnObject syntax}}
%(Daemon):ReturnObject(%outputObj)
{{Template:Daemon:ReturnInfoObject syntax}}
%(Daemon):ReturnInfoObject(%outputObj)
===Syntax terms===
</pre>
 
==Syntax Terms==
<dl>
<dl>
   
   
Line 21: Line 18:
<dd>The object returned from the daemon method object in the last Run method invocation. '''%outputObj''' must be deep copyable, as described in [[Copying objects]]. </dl>
<dd>The object returned from the daemon method object in the last Run method invocation. '''%outputObj''' must be deep copyable, as described in [[Copying objects]]. </dl>


==Usage Notes==
==Usage notes==
<ul>
<ul>
   
   
Line 29: Line 26:




[[Category:Daemon methods|ReturnObject and ReturnInfoObject]]
==See also==
{{Template:Daemon:ReturnObject and ReturnInfoObject footer}}

Revision as of 04:53, 7 February 2011

Specify objects returned to the master thread (Daemon class)


ReturnObject is a member of the Daemon class

These shared methods specify the output objects to be returned to the master thread. The difference between ReturnObject and ReturnInfoObject is that the former returns the value of the (unnamed) third argument of the Run function, while the latter returns the value of the named Info object of the Run function.

The ReturnInfoObject method was added in Sirius Mods Version 6.8.

Syntax

%(Daemon):ReturnObject( outputObj)

%(Daemon):ReturnInfoObject( outputObj)

Syntax terms

%(Daemon)
The class name in parentheses denotes a shared method. Specifying %(Daemon): is not the only way to invoke the method (see :hdref refid=daemeth.).
%outputObj
The object returned from the daemon method object in the last Run method invocation. %outputObj must be deep copyable, as described in Copying objects.

Usage notes

  • ReturnObject and ReturnInfoObject can only be issued on daemon threads.
  • You can invoke ReturnObject and ReturnInfoObject as many times as you want for a single Run call. Each subsequent invocation replaces the object from the previous invocation of the same method.
  • You can invoke ReturnObject even if Run has no output parameter, and you can invoke ReturninfoObject even if Run has no Info parameter. However, a class mismatch between the ReturnObject argument and the output argument in Run, or between the ReturnInfoObject argument and the Info argument in Run, causes request cancellation in the master thread at the time the daemon finishes and Run is about to return.


See also