<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Crystal Space 1.2.1: csutil/cseventq.h Source File (Crystal Space 1.2.1 Public API Reference)</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <table border="0" cellpadding="0" cellspacing="0" width="100%" class="head"> <tr height="59"> <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td> <td class="head"><h2>Public API Reference</h2></td> </tr> <tr height="11"> <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td> </tr> </table> <div class="content"> <!-- Generated by Doxygen 1.5.3 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <h1>csutil/cseventq.h</h1><a href="cseventq_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> Crystal Space 3D engine: Event Queue interface</span> <a name="l00003"></a>00003 <span class="comment"> Copyright (C) 1998 by Andrew Zabolotny <bit@freya.etu.ru></span> <a name="l00004"></a>00004 <span class="comment"> Copyright (C) 2001 by Eric Sunshine <sunshine@sunshineco.com></span> <a name="l00005"></a>00005 <span class="comment"> Copyright (C) 2005 by Adam D. Bradley <artdodge@cs.bu.edu></span> <a name="l00006"></a>00006 <span class="comment"></span> <a name="l00007"></a>00007 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00008"></a>00008 <span class="comment"> modify it under the terms of the GNU Library General Public</span> <a name="l00009"></a>00009 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00010"></a>00010 <span class="comment"> version 2 of the License, or (at your option) any later version.</span> <a name="l00011"></a>00011 <span class="comment"></span> <a name="l00012"></a>00012 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00013"></a>00013 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00014"></a>00014 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00015"></a>00015 <span class="comment"> Library General Public License for more details.</span> <a name="l00016"></a>00016 <span class="comment"></span> <a name="l00017"></a>00017 <span class="comment"> You should have received a copy of the GNU Library General Public</span> <a name="l00018"></a>00018 <span class="comment"> License along with this library; if not, write to the Free</span> <a name="l00019"></a>00019 <span class="comment"> Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00020"></a>00020 <span class="comment">*/</span> <a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="preprocessor">#ifndef __CS_CSEVENTQ_H__</span> <a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define __CS_CSEVENTQ_H__</span> <a name="l00024"></a>00024 <span class="preprocessor"></span> <a name="l00025"></a>00025 <span class="preprocessor">#ifdef ADB_DEBUG </span><span class="comment">/* debugging output... */</span> <a name="l00026"></a>00026 <span class="preprocessor">#include <iostream></span> <a name="l00027"></a>00027 <span class="preprocessor">#endif</span> <a name="l00028"></a>00028 <span class="preprocessor"></span> <a name="l00033"></a>00033 <span class="preprocessor">#include "csextern.h"</span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="csutil_2array_8h.html" title="Generic Array Template.">csutil/array.h</a>"</span> <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="hash_8h.html" title="A generic hash table.">csutil/hash.h</a>"</span> <a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="ref_8h.html" title="Smart Pointers.">csutil/ref.h</a>"</span> <a name="l00038"></a>00038 <span class="preprocessor">#include "<a class="code" href="refarr_8h.html" title="Smart Pointer array.">csutil/refarr.h</a>"</span> <a name="l00039"></a>00039 <span class="preprocessor">#include "<a class="code" href="scf__implementation_8h.html" title="Crystal Space Shared Class Facility (SCF) - implementation creation support.">csutil/scf_implementation.h</a>"</span> <a name="l00040"></a>00040 <span class="preprocessor">#include "<a class="code" href="mutex_8h.html" title="Mutual-exclusion object.">csutil/threading/mutex.h</a>"</span> <a name="l00041"></a>00041 <span class="preprocessor">#include "<a class="code" href="weakref_8h.html" title="Weak Reference.">csutil/weakref.h</a>"</span> <a name="l00042"></a>00042 <span class="preprocessor">#include "<a class="code" href="csutil_2eventhandlers_8h.html" title="Event handler naming, name management, indexing, and instantiation.">csutil/eventhandlers.h</a>"</span> <a name="l00043"></a>00043 <span class="preprocessor">#include "<a class="code" href="eventh_8h.html" title="Event handler interface.">iutil/eventh.h</a>"</span> <a name="l00044"></a>00044 <span class="preprocessor">#include "<a class="code" href="eventq_8h.html" title="General event queue.">iutil/eventq.h</a>"</span> <a name="l00045"></a>00045 <span class="preprocessor">#include "cssubscription.h"</span> <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keyword">struct </span><a class="code" href="structiObjectRegistry.html" title="This interface serves as a registry of other objects.">iObjectRegistry</a>; <a name="l00048"></a>00048 <a name="l00049"></a>00049 <span class="keyword">class </span><a class="code" href="classcsEventCord.html" title="Event cord.">csEventCord</a>; <a name="l00050"></a>00050 <span class="keyword">class </span><a class="code" href="classcsEventOutlet.html" title="A class which implements the iEventOutlet interface.">csEventOutlet</a>; <a name="l00051"></a>00051 <span class="keyword">class </span><a class="code" href="classcsPoolEvent.html" title="This class is a system event designed for the pool system.">csPoolEvent</a>; <a name="l00052"></a>00052 <a name="l00057"></a><a class="code" href="cseventq_8h.html#054ca799eab350a68e6008ee6a06678c">00057</a> <span class="preprocessor">#define DEF_EVENT_QUEUE_LENGTH 256</span> <a name="l00058"></a>00058 <span class="preprocessor"></span> <a name="l00059"></a>00059 <span class="keyword">template</span><> <a name="l00060"></a><a class="code" href="classcsHashComputer_3_01iEventHandler_01_5_01_4.html">00060</a> <span class="keyword">class </span><a class="code" href="classcsHashComputer.html" title="Template for hash value computing.">csHashComputer</a><<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a> *> : <span class="keyword">public</span> <a class="code" href="classcsHashComputerIntegral.html" title="Template for hash value computing, suitable for integral types and types that can...">csHashComputerIntegral<iEventHandler *></a> {}; <a name="l00061"></a>00061 <a name="l00067"></a><a class="code" href="classcsEventQueue.html">00067</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a> : <a name="l00068"></a>00068 <span class="keyword">public</span> <a class="code" href="classscfImplementation1.html">scfImplementation1</a><csEventQueue, iEventQueue> <a name="l00069"></a>00069 { <a name="l00070"></a><a class="code" href="classcsEventQueue.html#045c4aa8c93411d96adb6374223fca27">00070</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsEventOutlet.html" title="A class which implements the iEventOutlet interface.">csEventOutlet</a>; <a name="l00071"></a><a class="code" href="classcsEventQueue.html#ec50ba80b5421ab09fcde6246b667423">00071</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsPoolEvent.html" title="This class is a system event designed for the pool system.">csPoolEvent</a>; <a name="l00072"></a><a class="code" href="classcsEventQueue.html#38be8f61f3116fd02fd4b301a7d7ce9c">00072</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsEventTree.html" title="This class is used to represent the event namespace (tree).">csEventTree</a>; <a name="l00073"></a><a class="code" href="classcsEventQueue.html#f404f613d3150d4f80c6da84fa375a24">00073</a> <span class="keyword">friend</span> <span class="keyword">class </span>csEventQueueTest; <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="keyword">private</span>: <a name="l00076"></a>00076 <span class="comment">// Shared-object registry</span> <a name="l00077"></a>00077 <a class="code" href="structiObjectRegistry.html" title="This interface serves as a registry of other objects.">iObjectRegistry</a>* Registry; <a name="l00078"></a>00078 <span class="comment">// Event name registry</span> <a name="l00079"></a>00079 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventNameRegistry></a> NameRegistry; <a name="l00080"></a>00080 <span class="comment">// Event handler registry</span> <a name="l00081"></a>00081 <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventHandlerRegistry></a> HandlerRegistry; <a name="l00082"></a>00082 <span class="comment">// The queue itself (technically, a ring buffer)</span> <a name="l00083"></a>00083 <span class="keyword">volatile</span> <a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a>** EventQueue; <a name="l00084"></a>00084 <span class="comment">// Queue head and tail pointers</span> <a name="l00085"></a>00085 <span class="keyword">volatile</span> <span class="keywordtype">size_t</span> evqHead, evqTail; <a name="l00086"></a>00086 <span class="comment">// The maximum queue length</span> <a name="l00087"></a>00087 <span class="keyword">volatile</span> <span class="keywordtype">size_t</span> Length; <a name="l00088"></a>00088 <span class="comment">// Protection against multiple threads accessing same event queue</span> <a name="l00089"></a>00089 <a class="code" href="classCS_1_1Threading_1_1MutexImpl.html" title="General mutex class.">CS::Threading::Mutex</a> <a class="code" href="namespaceCS_1_1Threading.html#a77233dd556d212f73dba0999f0cb596" title="Basic non-recursive mutex.">Mutex</a>; <a name="l00090"></a>00090 <span class="comment">// Event tree. All subscription PO graphs and delivery queues hang off</span> <a name="l00091"></a>00091 <span class="comment">// of this.</span> <a name="l00092"></a>00092 <a class="code" href="classcsEventTree.html" title="This class is used to represent the event namespace (tree).">csEventTree</a> *EventTree; <a name="l00093"></a>00093 <span class="comment">// Shortcut to per-event-name delivery queues.</span> <a name="l00094"></a>00094 <a class="code" href="classcsHash.html" title="A generic hash table class, which grows dynamically and whose buckets are unsorted...">csHash<csEventTree *,csEventID></a> EventHash; <a name="l00095"></a>00095 <span class="comment">// Array of allocated event outlets.</span> <a name="l00096"></a>00096 <a class="code" href="classcsArray.html" title="A templated array class.">csArray<csEventOutlet*></a> EventOutlets; <a name="l00097"></a>00097 <span class="comment">// Array of allocated event cords.</span> <a name="l00098"></a>00098 <a class="code" href="classcsHash.html" title="A generic hash table class, which grows dynamically and whose buckets are unsorted...">csHash<csEventCord *, csEventID></a> EventCords; <a name="l00099"></a>00099 <span class="comment">// Pool of event objects</span> <a name="l00100"></a>00100 <a class="code" href="classcsPoolEvent.html" title="This class is a system event designed for the pool system.">csPoolEvent</a>* EventPool; <a name="l00102"></a>00102 <a class="code" href="classcsRefArray.html" title="An array of smart pointers.">csRefArray<iEventHandler></a> handlers; <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="comment">// Enlarge the queue size.</span> <a name="l00105"></a>00105 <span class="keywordtype">void</span> Resize (<span class="keywordtype">size_t</span> iLength); <a name="l00106"></a>00106 <span class="comment">// Lock the queue for modifications: NESTED CALLS TO LOCK/UNLOCK NOT ALLOWED!</span> <a name="l00107"></a>00107 <span class="keyword">inline</span> <span class="keywordtype">void</span> Lock () { <a class="code" href="namespaceCS_1_1Threading.html#a77233dd556d212f73dba0999f0cb596" title="Basic non-recursive mutex.">Mutex</a>.Lock(); } <a name="l00108"></a>00108 <span class="comment">// Unlock the queue</span> <a name="l00109"></a>00109 <span class="keyword">inline</span> <span class="keywordtype">void</span> Unlock () { <a class="code" href="namespaceCS_1_1Threading.html#a77233dd556d212f73dba0999f0cb596" title="Basic non-recursive mutex.">Mutex</a>.Unlock (); } <a name="l00110"></a>00110 <span class="comment">// Send broadcast pseudo-events (bypassing event queue).</span> <a name="l00111"></a>00111 <span class="keywordtype">void</span> Notify (<span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> &name); <a name="l00112"></a>00112 <a name="l00113"></a>00113 <span class="comment">/*</span> <a name="l00114"></a>00114 <span class="comment"> * Start a loop. The purpose of this function is to protect</span> <a name="l00115"></a>00115 <span class="comment"> * against modifications to the Listeners array while this array</span> <a name="l00116"></a>00116 <span class="comment"> * is being processed.</span> <a name="l00117"></a>00117 <span class="comment"> */</span> <a name="l00118"></a>00118 <span class="keywordtype">void</span> StartLoop (); <a name="l00119"></a>00119 <span class="comment">// End a loop.</span> <a name="l00120"></a>00120 <span class="keywordtype">void</span> EndLoop (); <a name="l00121"></a>00121 <a name="l00122"></a>00122 <span class="keyword">public</span>: <a name="l00123"></a>00123 <a name="l00125"></a>00125 <a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a> (<a class="code" href="structiObjectRegistry.html" title="This interface serves as a registry of other objects.">iObjectRegistry</a>*, <span class="keywordtype">size_t</span> iLength = <a class="code" href="cseventq_8h.html#054ca799eab350a68e6008ee6a06678c">DEF_EVENT_QUEUE_LENGTH</a>); <a name="l00127"></a>00127 <span class="keyword">virtual</span> ~<a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a> (); <a name="l00128"></a>00128 <a name="l00130"></a>00130 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Process (); <a name="l00132"></a>00132 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Dispatch (<a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a>&); <a name="l00133"></a>00133 <a name="l00135"></a>00135 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> RegisterListener (<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a>*); <a name="l00137"></a><a class="code" href="classcsEventQueue.html#9db4f87e4d83b200a9657cc1825cbf99">00137</a> <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> RegisterListener (<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a> *handler, <a name="l00138"></a>00138 <span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> &event) <a name="l00139"></a>00139 { <a name="l00140"></a>00140 <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> <span class="keywordtype">id</span> = RegisterListener(handler); <a name="l00141"></a>00141 <span class="keywordflow">if</span> (<span class="keywordtype">id</span>!=<a class="code" href="group__event__handling.html#gea5ee8f1eba9a0173e3a0f343b9d0603">CS_HANDLER_INVALID</a>) <a name="l00142"></a>00142 { <a name="l00143"></a>00143 <span class="keywordflow">if</span> (Subscribe(handler, event)) <a name="l00144"></a>00144 <span class="keywordflow">return</span> id; <a name="l00145"></a>00145 <span class="keywordflow">else</span> <a name="l00146"></a>00146 RemoveListener(handler); <span class="comment">/* fall through */</span> <a name="l00147"></a>00147 } <a name="l00148"></a>00148 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gea5ee8f1eba9a0173e3a0f343b9d0603">CS_HANDLER_INVALID</a>; <a name="l00149"></a>00149 } <a name="l00151"></a><a class="code" href="classcsEventQueue.html#ae4f8fb9207549d9f425d590afac44b5">00151</a> <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> RegisterListener (<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a> *handler, <a name="l00152"></a>00152 <span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> events[]) <a name="l00153"></a>00153 { <a name="l00154"></a>00154 <a class="code" href="group__event__handling.html#gd62f963e20f1180634a9557b392d987d">csHandlerID</a> <span class="keywordtype">id</span> = RegisterListener(handler); <a name="l00155"></a>00155 <span class="keywordflow">if</span> (<span class="keywordtype">id</span>!=<a class="code" href="group__event__handling.html#gea5ee8f1eba9a0173e3a0f343b9d0603">CS_HANDLER_INVALID</a>) <a name="l00156"></a>00156 { <a name="l00157"></a>00157 <span class="keywordflow">if</span> (Subscribe(handler, events)) <a name="l00158"></a>00158 <span class="keywordflow">return</span> id; <a name="l00159"></a>00159 <span class="keywordflow">else</span> <a name="l00160"></a>00160 RemoveListener(handler); <span class="comment">/* fall through */</span> <a name="l00161"></a>00161 } <a name="l00162"></a>00162 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gea5ee8f1eba9a0173e3a0f343b9d0603">CS_HANDLER_INVALID</a>; <a name="l00163"></a>00163 } <a name="l00169"></a>00169 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Subscribe (<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a>*, <span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> &); <a name="l00176"></a>00176 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Subscribe (<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a>*, <span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a>[]); <a name="l00182"></a>00182 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Unsubscribe (<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a>*, <span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> &); <a name="l00187"></a>00187 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Unsubscribe (<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a>*, <span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a>[]); <a name="l00194"></a>00194 <span class="keyword">virtual</span> <span class="keywordtype">void</span> RemoveListener (<a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a>*); <a name="l00199"></a>00199 <span class="keyword">virtual</span> <span class="keywordtype">void</span> RemoveAllListeners (); <a name="l00200"></a>00200 <a name="l00202"></a>00202 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iEventOutlet></a> CreateEventOutlet (<a class="code" href="structiEventPlug.html" title="Event plug interface, also referred as &quot;event source&quot;.">iEventPlug</a>*); <a name="l00204"></a>00204 <span class="keyword">virtual</span> <a class="code" href="structiEventOutlet.html" title="The iEventOutlet is the interface to an object that is provided by an event queue...">iEventOutlet</a>* GetEventOutlet (); <a name="l00206"></a>00206 <span class="keyword">virtual</span> <a class="code" href="structiEventCord.html" title="The iEventCord is an interface provided by an event queue to any event handlers wanting...">iEventCord</a>* GetEventCord (<span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> &); <a name="l00207"></a>00207 <a name="l00209"></a>00209 <a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a> CountPool (); <a name="l00210"></a>00210 <span class="keyword">protected</span>: <a name="l00211"></a>00211 <span class="keyword">virtual</span> <a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a> *CreateRawEvent (); <a name="l00212"></a>00212 <span class="keyword">public</span>: <a name="l00214"></a>00214 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iEvent></a> CreateEvent (); <a name="l00215"></a>00215 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iEvent></a> CreateEvent (<span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> &name, <span class="keywordtype">bool</span> broadcast); <a name="l00216"></a>00216 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iEvent></a> CreateEvent (<span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> &name); <a name="l00217"></a>00217 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iEvent></a> CreateEvent (<span class="keyword">const</span> <span class="keywordtype">char</span> *name); <a name="l00218"></a>00218 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iEvent></a> CreateBroadcastEvent (<span class="keyword">const</span> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> &name); <a name="l00219"></a>00219 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iEvent></a> CreateBroadcastEvent (<span class="keyword">const</span> <span class="keywordtype">char</span> *name); <a name="l00221"></a>00221 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Post (<a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a>*); <a name="l00223"></a>00223 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iEvent></a> Get (); <a name="l00225"></a>00225 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Clear (); <a name="l00227"></a><a class="code" href="classcsEventQueue.html#0639070198fefb1d84008279598e715a">00227</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> IsEmpty () { <span class="keywordflow">return</span> evqHead == evqTail; } <a name="l00228"></a>00228 <a name="l00229"></a><a class="code" href="classcsEventQueue.html#99cad3eb2e7d9483d2667f8ce5ddc464">00229</a> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> Frame; <a name="l00230"></a><a class="code" href="classcsEventQueue.html#622267fe05a51cd2d15f47e4623e5d0d">00230</a> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> PreProcess; <a name="l00231"></a><a class="code" href="classcsEventQueue.html#e86832c0c6efd23913ba13eba844851f">00231</a> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> ProcessEvent; <a name="l00232"></a><a class="code" href="classcsEventQueue.html#a43d979338fb5e2d9352a11531023a79">00232</a> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> PostProcess; <a name="l00233"></a><a class="code" href="classcsEventQueue.html#6a714a4f3c3934053d713ed25cbe1b60">00233</a> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> FinalProcess; <a name="l00234"></a>00234 <a name="l00247"></a><a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html">00247</a> <span class="keyword">struct </span><a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html" title="As a transitional measure, the csevPreProcess, csevProcess, csevPostProcess and csevFinalProcess...">iTypedFrameEventDispatcher</a> : <span class="keyword">public</span> <a class="code" href="structiEventHandler.html" title="This interface describes an entity that can receive events.">iEventHandler</a> <a name="l00248"></a>00248 { <a name="l00249"></a>00249 <span class="keyword">protected</span>: <a name="l00250"></a><a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html#c157b4a4db25cca99f8ce65eadc8d942">00250</a> <a class="code" href="classcsWeakRef.html" title="A weak reference.">csWeakRef<csEventQueue></a> parent; <a name="l00251"></a><a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html#006c379fab448740ef84ef62a19d3c1f">00251</a> <a class="code" href="group__event__handling.html#g51e1762faeeefdadf693499fc93db757" title="A csEventID is a handle for a string representing an event&#39;s hierarchical name...">csEventID</a> sendEvent; <a name="l00252"></a>00252 <span class="keyword">public</span>: <a name="l00253"></a><a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html#8043cea711c6fe0e6cf52747e1080f66">00253</a> <a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html" title="As a transitional measure, the csevPreProcess, csevProcess, csevPostProcess and csevFinalProcess...">iTypedFrameEventDispatcher</a> () <a name="l00254"></a>00254 { <a name="l00255"></a>00255 } <a name="l00256"></a><a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html#37c3cdd006072492b3cda1c6aa289718">00256</a> <span class="keyword">virtual</span> ~<a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html" title="As a transitional measure, the csevPreProcess, csevProcess, csevPostProcess and csevFinalProcess...">iTypedFrameEventDispatcher</a> () <a name="l00257"></a>00257 { <a name="l00258"></a>00258 } <a name="l00259"></a>00259 <a class="code" href="group__event__handling.html#g3b8588d425823594019243398b3d4447" title="Macro to declare instance constraints which are the same as the generics.">CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS</a> <a name="l00260"></a><a class="code" href="structcsEventQueue_1_1iTypedFrameEventDispatcher.html#437d9e499da5d56cae005fe99a24ed47">00260</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> HandleEvent (<a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a>&) <a name="l00261"></a>00261 { <a name="l00262"></a>00262 parent->Notify (sendEvent); <a name="l00263"></a>00263 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00264"></a>00264 } <a name="l00265"></a>00265 }; <a name="l00266"></a>00266 <a name="l00267"></a><a class="code" href="classcsEventQueue_1_1PreProcessFrameEventDispatcher.html">00267</a> <span class="keyword">class </span><a class="code" href="classcsEventQueue_1_1PreProcessFrameEventDispatcher.html">PreProcessFrameEventDispatcher</a> <a name="l00268"></a>00268 : <span class="keyword">public</span> <a class="code" href="classscfImplementation2.html">scfImplementation2</a><PreProcessFrameEventDispatcher, <a name="l00269"></a>00269 csEventQueue::iTypedFrameEventDispatcher, <a name="l00270"></a>00270 scfFakeInterface<iEventHandler> > <a name="l00271"></a>00271 { <a name="l00272"></a>00272 <span class="keyword">public</span>: <a name="l00273"></a><a class="code" href="classcsEventQueue_1_1PreProcessFrameEventDispatcher.html#673028d253403690d9cbde87e111d9b3">00273</a> <a class="code" href="classcsEventQueue_1_1PreProcessFrameEventDispatcher.html">PreProcessFrameEventDispatcher</a> (<a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a>* parent) <a name="l00274"></a>00274 : <a class="code" href="classscfImplementation2.html">scfImplementationType</a> (this) <a name="l00275"></a>00275 { <a name="l00276"></a>00276 iTypedFrameEventDispatcher::parent = parent; <a name="l00277"></a>00277 sendEvent = parent-><a class="code" href="classcsEventQueue.html#622267fe05a51cd2d15f47e4623e5d0d">PreProcess</a>; <a name="l00278"></a>00278 } <a name="l00279"></a>00279 <a class="code" href="csutil_2eventhandlers_8h.html#4ada3b18ed11fdfb128f8a272177fe5d" title="Use this macro to declare your event handler as wanting to handle the csevFrame event...">CS_EVENTHANDLER_PHASE_LOGIC</a>(<span class="stringliteral">"crystalspace.frame.preprocess"</span>) <a name="l00280"></a>00280 }; <a name="l00281"></a>00281 <a name="l00282"></a><a class="code" href="classcsEventQueue_1_1ProcessFrameEventDispatcher.html">00282</a> <span class="keyword">class </span><a class="code" href="classcsEventQueue_1_1ProcessFrameEventDispatcher.html">ProcessFrameEventDispatcher</a> <a name="l00283"></a>00283 : <span class="keyword">public</span> <a class="code" href="classscfImplementation2.html">scfImplementation2</a><ProcessFrameEventDispatcher, <a name="l00284"></a>00284 csEventQueue::iTypedFrameEventDispatcher, <a name="l00285"></a>00285 scfFakeInterface<iEventHandler> > <a name="l00286"></a>00286 { <a name="l00287"></a>00287 <span class="keyword">public</span>: <a name="l00288"></a><a class="code" href="classcsEventQueue_1_1ProcessFrameEventDispatcher.html#7530fba0b1effb8f2fc82fc4a6470f8d">00288</a> <a class="code" href="classcsEventQueue_1_1ProcessFrameEventDispatcher.html">ProcessFrameEventDispatcher</a> (<a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a>* parent) <a name="l00289"></a>00289 : <a class="code" href="classscfImplementation2.html">scfImplementationType</a> (this) <a name="l00290"></a>00290 { <a name="l00291"></a>00291 iTypedFrameEventDispatcher::parent = parent; <a name="l00292"></a>00292 sendEvent = parent-><a class="code" href="classcsEventQueue.html#e86832c0c6efd23913ba13eba844851f">ProcessEvent</a>; <a name="l00293"></a>00293 } <a name="l00294"></a>00294 <a class="code" href="csutil_2eventhandlers_8h.html#fe3929bf12ab372791dfa4f926761d08" title="Use this macro to declare your event handler as wanting to handle the csevFrame event...">CS_EVENTHANDLER_PHASE_3D</a>(<span class="stringliteral">"crystalspace.frame.process"</span>) <a name="l00295"></a>00295 }; <a name="l00296"></a>00296 <a name="l00297"></a><a class="code" href="classcsEventQueue_1_1PostProcessFrameEventDispatcher.html">00297</a> <span class="keyword">class </span><a class="code" href="classcsEventQueue_1_1PostProcessFrameEventDispatcher.html">PostProcessFrameEventDispatcher</a> <a name="l00298"></a>00298 : <span class="keyword">public</span> <a class="code" href="classscfImplementation2.html">scfImplementation2</a><PostProcessFrameEventDispatcher, <a name="l00299"></a>00299 csEventQueue::iTypedFrameEventDispatcher, <a name="l00300"></a>00300 scfFakeInterface<iEventHandler> > <a name="l00301"></a>00301 { <a name="l00302"></a>00302 <span class="keyword">public</span>: <a name="l00303"></a><a class="code" href="classcsEventQueue_1_1PostProcessFrameEventDispatcher.html#a8dfae14b620063b00af9b72c931cd04">00303</a> <a class="code" href="classcsEventQueue_1_1PostProcessFrameEventDispatcher.html">PostProcessFrameEventDispatcher</a> (<a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a>* parent) <a name="l00304"></a>00304 : <a class="code" href="classscfImplementation2.html">scfImplementationType</a> (this) <a name="l00305"></a>00305 { <a name="l00306"></a>00306 iTypedFrameEventDispatcher::parent = parent; <a name="l00307"></a>00307 sendEvent = parent-><a class="code" href="classcsEventQueue.html#a43d979338fb5e2d9352a11531023a79">PostProcess</a>; <a name="l00308"></a>00308 } <a name="l00309"></a>00309 <a class="code" href="csutil_2eventhandlers_8h.html#754fd78231a571e0e56e2630b0a4736f" title="Use this macro to declare your event handler as wanting to handle the csevFrame event...">CS_EVENTHANDLER_PHASE_2D</a>(<span class="stringliteral">"crystalspace.frame.postprocess"</span>) <a name="l00310"></a>00310 }; <a name="l00311"></a>00311 <a name="l00312"></a><a class="code" href="classcsEventQueue_1_1FinalProcessFrameEventDispatcher.html">00312</a> <span class="keyword">class </span><a class="code" href="classcsEventQueue_1_1FinalProcessFrameEventDispatcher.html">FinalProcessFrameEventDispatcher</a> <a name="l00313"></a>00313 : <span class="keyword">public</span> <a class="code" href="classscfImplementation2.html">scfImplementation2</a><FinalProcessFrameEventDispatcher, <a name="l00314"></a>00314 csEventQueue::iTypedFrameEventDispatcher, <a name="l00315"></a>00315 scfFakeInterface<iEventHandler> > <a name="l00316"></a>00316 { <a name="l00317"></a>00317 <span class="keyword">public</span>: <a name="l00318"></a><a class="code" href="classcsEventQueue_1_1FinalProcessFrameEventDispatcher.html#b6ca776efc069eda6c22a31c1a831f8a">00318</a> <a class="code" href="classcsEventQueue_1_1FinalProcessFrameEventDispatcher.html">FinalProcessFrameEventDispatcher</a> (<a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a>* parent) <a name="l00319"></a>00319 : <a class="code" href="classscfImplementation2.html">scfImplementationType</a> (this) <a name="l00320"></a>00320 { <a name="l00321"></a>00321 iTypedFrameEventDispatcher::parent = parent; <a name="l00322"></a>00322 sendEvent = parent-><a class="code" href="classcsEventQueue.html#6a714a4f3c3934053d713ed25cbe1b60">FinalProcess</a>; <a name="l00323"></a>00323 } <a name="l00324"></a>00324 <a class="code" href="csutil_2eventhandlers_8h.html#412901a6fddc603080b4ae1259e47401" title="Use this macro to declare your event handler as wanting to handle the csevFrame event...">CS_EVENTHANDLER_PHASE_FRAME</a>(<span class="stringliteral">"crystalspace.frame.finalprocess"</span>) <a name="l00325"></a>00325 }; <a name="l00326"></a>00326 }; <a name="l00327"></a>00327 <a name="l00328"></a>00328 <span class="preprocessor">#endif // __CS_CSEVENTQ_H__</span> </pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by <a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 </small></address> </div></body> </html>