MOOSE/docs/Documentation/ScheduleDispatcher.html
FlightControl 846edca815 Merge remote-tracking branch 'refs/remotes/origin/master' into FlightControl
# Conflicts:
#	Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
#	Moose Mission Setup/Moose.lua
#	Moose Test Missions/SPA - Spawning/SPA-010 - Spawn Demo/SPA-010 -
Spawn Demo.miz
#	Moose Test Missions/SPA - Spawning/SPA-011 - Ground Ops - Simple
Spawning/SPA-011 - Ground Ops - Simple Spawning.miz
#	Moose Test Missions/SPA - Spawning/SPA-012 - Ground Ops - Multiple
Spawns/SPA-012 - Ground Ops - Multiple Spawns.miz
#	Moose Test Missions/SPA - Spawning/SPA-013 - Ground Ops - Scheduled
Spawns/SPA-013 - Ground Ops - Scheduled Spawns.miz
#	Moose Test Missions/SPA - Spawning/SPA-014 - Ground Ops - Scheduled
Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.miz
#	Moose Test Missions/SPA - Spawning/SPA-015 - Ground Ops - Randomize
Route/SPA-015 - Ground Ops - Randomize Route.miz
#	Moose Test Missions/SPA - Spawning/SPA-016 - Ground Ops - Randomize
Zones/SPA-016 - Ground Ops - Randomize Zones.miz
#	Moose Test Missions/SPA - Spawning/SPA-017 - Ground Ops - Set AI
inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while
spawning.miz
#	Moose Test Missions/SPA - Spawning/SPA-018 - Ground Ops - Randomize
Templates/SPA-018 - Ground Ops - Randomize Templates.miz
#	Moose Test Missions/SPA - Spawning/SPA-100 - CleanUp Inactive
Units/SPA-100 - CleanUp Inactive Units.miz
#	Moose Test Missions/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 -
Limit Spawning.miz
#	Moose Test Missions/SPA - Spawning/SPA-121 - Air Ops - Scheduled
Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled
Spawns with Repeat on Landing with Limit.miz
#	Moose Test Missions/SPA - Spawning/SPA-130 - Uncontrolled
Spawning/SPA-130 - Uncontrolled Spawning.miz
#	Moose Test Missions/SPA - Spawning/SPA-200 - Randomize Unit
Types/SPA-200 - Randomize Unit Types.miz
#	Moose Test Missions/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 -
Randomize Zones.miz
#	Moose Test Missions/SPA - Spawning/SPA-310 - Spawn at Static
position/SPA-310 - Spawn at Static position.miz
#	Moose Test Missions/SPA - Spawning/SPA-320 - Spawn at Unit
position/SPA-320 - Spawn at Unit position.miz
#	Moose Test Missions/SPA - Spawning/SPA-330 - Spawn at Vec2
position/SPA-330 - Spawn at Vec2 position.miz
#	Moose Test Missions/SPA - Spawning/SPA-340 - Spawn at Vec3
position/SPA-340 - Spawn at Vec3 position.miz
#	Moose Test Missions/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal
Zone.miz
#	docs/Documentation/Zone.html
2017-03-03 09:51:17 +01:00

463 lines
11 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
<li><a href="AI_Cas.html">AI_Cas</a></li>
<li><a href="AI_Patrol.html">AI_Patrol</a></li>
<li><a href="Account.html">Account</a></li>
<li><a href="Airbase.html">Airbase</a></li>
<li><a href="AirbasePolice.html">AirbasePolice</a></li>
<li><a href="Assign.html">Assign</a></li>
<li><a href="Base.html">Base</a></li>
<li><a href="Cargo.html">Cargo</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="CommandCenter.html">CommandCenter</a></li>
<li><a href="Controllable.html">Controllable</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Detection.html">Detection</a></li>
<li><a href="DetectionManager.html">DetectionManager</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="Fsm.html">Fsm</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="Identifiable.html">Identifiable</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="Movement.html">Movement</a></li>
<li><a href="Object.html">Object</a></li>
<li><a href="Point.html">Point</a></li>
<li><a href="Positionable.html">Positionable</a></li>
<li><a href="Process_JTAC.html">Process_JTAC</a></li>
<li><a href="Process_Pickup.html">Process_Pickup</a></li>
<li><a href="Route.html">Route</a></li>
<li><a href="Scenery.html">Scenery</a></li>
<li>ScheduleDispatcher</li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li><a href="Set.html">Set</a></li>
<li><a href="Smoke.html">Smoke</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="Static.html">Static</a></li>
<li><a href="Task.html">Task</a></li>
<li><a href="Task_A2G.html">Task_A2G</a></li>
<li><a href="Task_PICKUP.html">Task_PICKUP</a></li>
<li><a href="Task_SEAD.html">Task_SEAD</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="Utils.html">Utils</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>ScheduleDispatcher</code></h1>
<p>This module defines the SCHEDULEDISPATCHER class, which is used by a central object called _SCHEDULEDISPATCHER.</p>
<hr/>
<p>Takes care of the creation and dispatching of scheduled functions for SCHEDULER objects.</p>
<p>This class is tricky and needs some thorought explanation.
SCHEDULE classes are used to schedule functions for objects, or as persistent objects.
The SCHEDULEDISPATCHER class ensures that:</p>
<ul>
<li>Scheduled functions are planned according the SCHEDULER object parameters.</li>
<li>Scheduled functions are repeated when requested, according the SCHEDULER object parameters.</li>
<li>Scheduled functions are automatically removed when the schedule is finished, according the SCHEDULER object parameters.</li>
</ul>
<p>The SCHEDULEDISPATCHER class will manage SCHEDULER object in memory during garbage collection:
- When a SCHEDULER object is not attached to another object (that is, it's first :Schedule() parameter is nil), then the SCHEDULER </p>
<pre><code>object is _persistent_ within memory.
</code></pre>
<p> - When a SCHEDULER object <em>is</em> attached to another object, then the SCHEDULER object is <em>not persistent</em> within memory after a garbage collection!
The none persistency of SCHEDULERS attached to objects is required to allow SCHEDULER objects to be garbage collectged, when the parent object is also desroyed or nillified and garbage collected.
Even when there are pending timer scheduled functions to be executed for the SCHEDULER object, <br/>
these will not be executed anymore when the SCHEDULER object has been destroyed.</p>
<p>The SCHEDULEDISPATCHER allows multiple scheduled functions to be planned and executed for one SCHEDULER object.
The SCHEDULER object therefore keeps a table of "CallID's", which are returned after each planning of a new scheduled function by the SCHEDULEDISPATCHER.
The SCHEDULER object plans new scheduled functions through the <a href="Scheduler.html##(SCHEDULER).Schedule">Scheduler#SCHEDULER.Schedule</a>() method.
The Schedule() method returns the CallID that is the reference ID for each planned schedule.</p>
<hr/>
<hr/>
<h3>Contributions: -</h3>
<h3>Authors: FlightControl : Design &amp; Programming</h3>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#SCHEDULEDISPATCHER">SCHEDULEDISPATCHER</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(SCHEDULEDISPATCHER)">Type <code>SCHEDULEDISPATCHER</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).AddSchedule">SCHEDULEDISPATCHER:AddSchedule(Scheduler, ScheduleFunction, ScheduleArguments, Start, Repeat, Randomize, Stop)</a></td>
<td class="summary">
<p>Add a Schedule to the ScheduleDispatcher.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).CallID">SCHEDULEDISPATCHER.CallID</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).ClassName">SCHEDULEDISPATCHER.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).Clear">SCHEDULEDISPATCHER:Clear(Scheduler)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).New">SCHEDULEDISPATCHER:New()</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).ObjectSchedulers">SCHEDULEDISPATCHER.ObjectSchedulers</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).PersistentSchedulers">SCHEDULEDISPATCHER.PersistentSchedulers</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).RemoveSchedule">SCHEDULEDISPATCHER:RemoveSchedule(Scheduler, CallID)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).Schedule">SCHEDULEDISPATCHER.Schedule</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).Start">SCHEDULEDISPATCHER:Start(Scheduler, CallID)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULEDISPATCHER).Stop">SCHEDULEDISPATCHER:Stop(Scheduler, CallID)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(SCHEDULEDISPATCHER)">#SCHEDULEDISPATCHER</a></em>
<a id="SCHEDULEDISPATCHER" >
<strong>SCHEDULEDISPATCHER</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(ScheduleDispatcher)" >Type <code>ScheduleDispatcher</code></a></h2>
<h2><a id="#(SCHEDULEDISPATCHER)" >Type <code>SCHEDULEDISPATCHER</code></a></h2>
<p>The SCHEDULEDISPATCHER structure</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).AddSchedule" >
<strong>SCHEDULEDISPATCHER:AddSchedule(Scheduler, ScheduleFunction, ScheduleArguments, Start, Repeat, Randomize, Stop)</strong>
</a>
</dt>
<dd>
<p>Add a Schedule to the ScheduleDispatcher.</p>
<p>The development of this method was really tidy.
It is constructed as such that a garbage collection is executed on the weak tables, when the Scheduler is nillified.
Nothing of this code should be modified without testing it thoroughly.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Scheduler.html##(SCHEDULER)">Core.Scheduler#SCHEDULER</a> Scheduler </em></code>: </p>
</li>
<li>
<p><code><em> ScheduleFunction </em></code>: </p>
</li>
<li>
<p><code><em> ScheduleArguments </em></code>: </p>
</li>
<li>
<p><code><em> Start </em></code>: </p>
</li>
<li>
<p><code><em> Repeat </em></code>: </p>
</li>
<li>
<p><code><em> Randomize </em></code>: </p>
</li>
<li>
<p><code><em> Stop </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).CallID" >
<strong>SCHEDULEDISPATCHER.CallID</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(SCHEDULEDISPATCHER).ClassName" >
<strong>SCHEDULEDISPATCHER.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).Clear" >
<strong>SCHEDULEDISPATCHER:Clear(Scheduler)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> Scheduler </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).New" >
<strong>SCHEDULEDISPATCHER:New()</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).ObjectSchedulers" >
<strong>SCHEDULEDISPATCHER.ObjectSchedulers</strong>
</a>
</dt>
<dd>
<p> setmetatable( {}, { __mode = "v" } )</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).PersistentSchedulers" >
<strong>SCHEDULEDISPATCHER.PersistentSchedulers</strong>
</a>
</dt>
<dd>
<p> Initialize the ObjectSchedulers array, which is a weakly coupled table.
If the object used as the key is nil, then the garbage collector will remove the item from the Functions array.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).RemoveSchedule" >
<strong>SCHEDULEDISPATCHER:RemoveSchedule(Scheduler, CallID)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> Scheduler </em></code>: </p>
</li>
<li>
<p><code><em> CallID </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).Schedule" >
<strong>SCHEDULEDISPATCHER.Schedule</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).Start" >
<strong>SCHEDULEDISPATCHER:Start(Scheduler, CallID)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> Scheduler </em></code>: </p>
</li>
<li>
<p><code><em> CallID </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULEDISPATCHER).Stop" >
<strong>SCHEDULEDISPATCHER:Stop(Scheduler, CallID)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> Scheduler </em></code>: </p>
</li>
<li>
<p><code><em> CallID </em></code>: </p>
</li>
</ul>
</dd>
</dl>
</div>
</div>
</body>
</html>