ReturnObject and ReturnInfoObject (Daemon subroutines): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:Daemon:ReturnObject and ReturnInfoObject subtitle}}
{{Template:Daemon:ReturnObject and ReturnInfoObject subtitle}}
<var>ReturnObject</var> and <var>ReturnInfoObject</var> specify the output objects to be returned to the master thread. The difference between them is that <var>ReturnObject</var> returns the value of the (unnamed) third argument of the <var>[[Run (Daemon function)|Run]]</var> function, while <var>ReturnInfoObject</var> returns the value of the <var>Info</var> named object of the <var>Run</var> function.  
<var>ReturnObject</var> and <var>ReturnInfoObject</var> specify the output objects to be returned to the master thread. The difference between them is that <var>ReturnObject</var> returns the value of the <var>Output</var> argument of the <var>[[Run (Daemon function)|Run]]</var> function, while <var>ReturnInfoObject</var> returns the value of the <var>Info</var> argument of the <var>Run</var> function.  


==Syntax==
==Syntax==
{{Template:Daemon:ReturnObject syntax}}
{{Template:Daemon:ReturnObject syntax}}
{{Template:Daemon:ReturnInfoObject syntax}}
{{Template:Daemon:ReturnInfoObject syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th><var>%(Daemon)</var></th>
<tr><th><var class="nobr">%(Daemon)</var></th>
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>ReturnObject</var> and <var>ReturnInfoObject</var> can also be invoked via a <var>Daemon</var> object variable, which may be null.</td></tr>
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>ReturnObject</var> and <var>ReturnInfoObject</var> can also be invoked via a <var>Daemon</var> object variable, which may be null.</td></tr>
<tr><th>outputObj</th>
<tr><th>outputObj</th>
<td>The object returned from the daemon method object in the last <var>Run</var> method invocation. <var class="term">outputObj</var> must be deep copyable, as described in [[Copying objects|"Copying objects"]].</td></tr>
<td>The object returned from the daemon method object in the last <var>Run</var> method invocation. <var class="term">outputObj</var> must be deep copyable, as described in [[Copying objects|"Copying objects"]].</td></tr>
Line 16: Line 18:
<ul>  
<ul>  
<li><var>ReturnObject</var> and <var>ReturnInfoObject</var> can only be issued on daemon threads.  
<li><var>ReturnObject</var> and <var>ReturnInfoObject</var> can only be issued on daemon threads.  
<li>You can invoke <var>ReturnObject</var> and/or <var>ReturnInfoObject</var> as many times as you want for a single <var>Run</var> call. Each subsequent invocation replaces the object from the previous invocation of the same method.  
<li>You can invoke <var>ReturnObject</var> and/or <var>ReturnInfoObject</var> as many times as you want for a single <var>Run</var> call. Each subsequent invocation replaces the object from the previous invocation of the same method.  
<li>You can invoke <var>ReturnObject</var> even if <var>Run</var> has no output parameter, and you can invoke <var>ReturnInfoObject</var> even if <var>Run</var> has no <var>Info</var> parameter.
<li>You can invoke <var>ReturnObject</var> even if <var>Run</var> has no output parameter, and you can invoke <var>ReturnInfoObject</var> even if <var>Run</var> has no <var>Info</var> parameter.
<li>A class mismatch between the <var>ReturnObject</var> argument and the <var>Run</var> output argument; or between the <var>ReturnInfoObject</var> argument and the <var>Run</var> <var>Info</var> argument, causes request cancellation in the master thread at the time the daemon finishes and <var>Run</var> method was about to return.
 
<li>A class mismatch between the <var>ReturnObject</var> argument and the <var>Run</var> output argument, or between the <var>ReturnInfoObject</var> argument and the <var>Run</var> <var>Info</var> argument, causes request cancellation in the master thread at the time the daemon finishes and <var>Run</var> method was about to return.
</ul>
</ul>


==See also==
==See also==
{{Template:Daemon:ReturnObject and ReturnInfoObject footer}}
{{Template:Daemon:ReturnObject and ReturnInfoObject footer}}

Latest revision as of 00:59, 16 February 2014

Specify objects returned to the master thread (Daemon class)

ReturnObject and ReturnInfoObject specify the output objects to be returned to the master thread. The difference between them is that ReturnObject returns the value of the Output argument of the Run function, while ReturnInfoObject returns the value of the Info argument of the Run function.

Syntax

%(Daemon):ReturnObject( outputObj)

%(Daemon):ReturnInfoObject( outputObj)

Syntax terms

%(Daemon) The class name in parentheses denotes a shared method. ReturnObject and ReturnInfoObject can also be invoked via a Daemon object variable, which may be null.
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/or 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.
  • A class mismatch between the ReturnObject argument and the Run output argument, or between the ReturnInfoObject argument and the Run Info argument, causes request cancellation in the master thread at the time the daemon finishes and Run method was about to return.

See also