<!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/csevent.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/csevent.h</h1><a href="csevent_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 class interface</span> <a name="l00003"></a>00003 <span class="comment"> Written by Andrew Zabolotny <bit@eltech.ru>, Jonathan Tarbox, </span> <a name="l00004"></a>00004 <span class="comment"> Frank Richter, Adam D. Bradley <artdodge@cs.bu.edu></span> <a name="l00005"></a>00005 <span class="comment"></span> <a name="l00006"></a>00006 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00007"></a>00007 <span class="comment"> modify it under the terms of the GNU Library General Public</span> <a name="l00008"></a>00008 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00009"></a>00009 <span class="comment"> version 2 of the License, or (at your option) any later version.</span> <a name="l00010"></a>00010 <span class="comment"></span> <a name="l00011"></a>00011 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00012"></a>00012 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00013"></a>00013 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00014"></a>00014 <span class="comment"> Library General Public License for more details.</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment"> You should have received a copy of the GNU Library General Public</span> <a name="l00017"></a>00017 <span class="comment"> License along with this library; if not, write to the Free</span> <a name="l00018"></a>00018 <span class="comment"> Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00019"></a>00019 <span class="comment">*/</span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="preprocessor">#ifndef __CS_CSEVENT_H__</span> <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define __CS_CSEVENT_H__</span> <a name="l00023"></a>00023 <span class="preprocessor"></span> <a name="l00024"></a>00024 <span class="preprocessor">#include "csextern.h"</span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="hash_8h.html" title="A generic hash table.">csutil/hash.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="csutil_2strset_8h.html" title="String-to-ID hash table.">csutil/strset.h</a>"</span> <a name="l00028"></a>00028 <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="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="weakref_8h.html" title="Weak Reference.">csutil/weakref.h</a>"</span> <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="iutil_2event_8h.html" title="Event system related interfaces.">iutil/event.h</a>"</span> <a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="hashr_8h.html" title="Reversible hash.">hashr.h</a>"</span> <a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="csendian_8h.html" title="Helpers for dealing with endian conversions.">csendian.h</a>"</span> <a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="weakref_8h.html" title="Weak Reference.">weakref.h</a>"</span> <a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="cseventq_8h.html" title="Event Queue interface.">cseventq.h</a>"</span> <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="csutil_2strset_8h.html" title="String-to-ID hash table.">strset.h</a>"</span> <a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="csutil_2eventnames_8h.html" title="Event naming and name relations.">eventnames.h</a>"</span> <a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="keyword">class </span><a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a>; <a name="l00040"></a>00040 <a name="l00045"></a>00045 <span class="keyword">class </span><a class="code" href="classcsEventAttributeIterator.html">csEventAttributeIterator</a>; <a name="l00046"></a>00046 <span class="keyword">class </span><a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a>; <a name="l00047"></a>00047 <a name="l00054"></a><a class="code" href="classcsEvent.html">00054</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a> : <span class="keyword">public</span> <a class="code" href="classscfImplementation1.html">scfImplementation1</a><csEvent, iEvent> <a name="l00055"></a>00055 { <a name="l00056"></a>00056 <span class="keyword">private</span>: <a name="l00057"></a>00057 <span class="keyword">struct </span>attribute <a name="l00058"></a>00058 { <a name="l00059"></a>00059 <span class="keyword">union</span> <a name="l00060"></a>00060 { <a name="l00061"></a>00061 <a class="code" href="group__util.html#gecfc3c54bd29ad5964e1c1c3ccbf89df" title="signed 64-bit integer">int64</a> intVal; <a name="l00062"></a>00062 <span class="keywordtype">double</span> doubleVal; <a name="l00063"></a>00063 <span class="keywordtype">char</span>* bufferVal; <a name="l00064"></a>00064 <a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a>* ibaseVal; <a name="l00065"></a>00065 }; <a name="l00066"></a>00066 <a class="code" href="group__event__handling.html#ge12006d83c6b873a567c93fbb4670fe1" title="Various attribute data types supported by the event system (iEvent).">csEventAttributeType</a> type; <a name="l00067"></a>00067 <span class="keywordtype">size_t</span> dataSize; <a name="l00068"></a>00068 attribute (<a class="code" href="group__event__handling.html#ge12006d83c6b873a567c93fbb4670fe1" title="Various attribute data types supported by the event system (iEvent).">csEventAttributeType</a> t) { type = t; } <a name="l00069"></a>00069 attribute (<span class="keyword">const</span> attribute &o) <a name="l00070"></a>00070 { <a name="l00071"></a>00071 type = o.type; <a name="l00072"></a>00072 intVal = o.intVal; <a name="l00073"></a>00073 dataSize = o.dataSize; <a name="l00074"></a>00074 <span class="keywordflow">if</span> ((o.type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe11fc3af31574953caa153c1ece5d71dbc" title="An iEvent is contained.">csEventAttrEvent</a>) || (o.type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe109479cd1e4e9b9f8adae0674168da45c" title="An iBase interface is contained.">csEventAttriBase</a>)) <a name="l00075"></a>00075 ibaseVal->IncRef(); <a name="l00076"></a>00076 <span class="keywordflow">if</span> (type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1003e9819bd6fac75033c669b393c8208" title="A string or raw data buffer is contained.">csEventAttrDatabuffer</a>) <a name="l00077"></a>00077 { <a name="l00078"></a>00078 bufferVal = <span class="keyword">new</span> <span class="keywordtype">char</span>[dataSize]; <a name="l00079"></a>00079 memcpy(bufferVal, o.bufferVal,dataSize); <a name="l00080"></a>00080 } <a name="l00081"></a>00081 } <a name="l00082"></a>00082 ~attribute () <a name="l00083"></a>00083 { <a name="l00084"></a>00084 <span class="keywordflow">if</span> (type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1003e9819bd6fac75033c669b393c8208" title="A string or raw data buffer is contained.">csEventAttrDatabuffer</a>) <a name="l00085"></a>00085 <span class="keyword">delete</span>[] bufferVal; <a name="l00086"></a>00086 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe11fc3af31574953caa153c1ece5d71dbc" title="An iEvent is contained.">csEventAttrEvent</a>) || (type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe109479cd1e4e9b9f8adae0674168da45c" title="An iBase interface is contained.">csEventAttriBase</a>)) <a name="l00087"></a>00087 ibaseVal->DecRef(); <a name="l00088"></a>00088 } <a name="l00089"></a>00089 }; <a name="l00090"></a>00090 <a class="code" href="classcsHash.html" title="A generic hash table class, which grows dynamically and whose buckets are unsorted...">csHash<attribute*, csStringID></a> attributes; <a name="l00091"></a><a class="code" href="classcsEvent.html#ff9ae46b7659747360e242efc68a4542">00091</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsEventAttributeIterator.html">csEventAttributeIterator</a>; <a name="l00092"></a>00092 <a name="l00093"></a>00093 <span class="keywordtype">size_t</span> count; <a name="l00094"></a>00094 <a name="l00095"></a>00095 <span class="keywordtype">bool</span> CheckForLoops(<a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a> *current, <a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a> *e); <a name="l00096"></a>00096 <a name="l00097"></a>00097 <span class="keyword">template</span> <<span class="keyword">class</span> T> <a name="l00098"></a>00098 <span class="keywordtype">bool</span> InternalAddInt (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, T value) <a name="l00099"></a>00099 { <a name="l00100"></a>00100 <span class="keywordflow">if</span> (attributes.In (GetKeyID (name))) <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00101"></a>00101 attribute* <span class="keywordtype">object</span> = <span class="keyword">new</span> attribute (<a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1ef76fbe8edf3545b08ed274af6a0d1af" title="A signed integer is contained.">csEventAttrInt</a>); <a name="l00102"></a>00102 <span class="keywordtype">object</span>->intVal = (<a class="code" href="group__util.html#gecfc3c54bd29ad5964e1c1c3ccbf89df" title="signed 64-bit integer">int64</a>)value; <a name="l00103"></a>00103 attributes.Put (GetKeyID (name), <span class="keywordtype">object</span>); <a name="l00104"></a>00104 count++; <a name="l00105"></a>00105 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00106"></a>00106 } <a name="l00107"></a>00107 <a name="l00108"></a>00108 <span class="keyword">template</span> <<span class="keyword">class</span> T> <a name="l00109"></a>00109 <span class="keywordtype">bool</span> InternalAddUInt (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, T value) <a name="l00110"></a>00110 { <a name="l00111"></a>00111 <span class="keywordflow">if</span> (attributes.In (GetKeyID (name))) <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00112"></a>00112 attribute* <span class="keywordtype">object</span> = <span class="keyword">new</span> attribute (<a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1c352461ab0721150688d55a0f4a0d66c" title="An unsigned integer is contained.">csEventAttrUInt</a>); <a name="l00113"></a>00113 <span class="keywordtype">object</span>->intVal = (<a class="code" href="group__util.html#gecfc3c54bd29ad5964e1c1c3ccbf89df" title="signed 64-bit integer">int64</a>)value; <a name="l00114"></a>00114 attributes.Put (GetKeyID (name), <span class="keywordtype">object</span>); <a name="l00115"></a>00115 count++; <a name="l00116"></a>00116 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00117"></a>00117 } <a name="l00118"></a>00118 <a name="l00119"></a>00119 <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> InternalReportMismatch (attribute* attr)<span class="keyword"> const</span> <a name="l00120"></a>00120 <span class="keyword"> </span>{ <a name="l00121"></a>00121 <span class="keywordflow">switch</span> (attr->type) <a name="l00122"></a>00122 { <a name="l00123"></a>00123 <span class="keywordflow">case</span> <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1ef76fbe8edf3545b08ed274af6a0d1af" title="A signed integer is contained.">csEventAttrInt</a>: <a name="l00124"></a>00124 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfeeb8401e087145e0016b2aea66304616c9" title="The contained value can not be converted to the requested type.">csEventErrMismatchInt</a>; <a name="l00125"></a>00125 <span class="keywordflow">case</span> <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1c352461ab0721150688d55a0f4a0d66c" title="An unsigned integer is contained.">csEventAttrUInt</a>: <a name="l00126"></a>00126 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee14a14bf360f614feae10992fd3848410" title="The contained value can not be converted to the requested type.">csEventErrMismatchUInt</a>; <a name="l00127"></a>00127 <span class="keywordflow">case</span> <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe11888f1bbcb1bed125ea1419968477bd1" title="A floating point number is contained.">csEventAttrFloat</a>: <a name="l00128"></a>00128 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee1257d91de710425f78275d570b00de01" title="The contained value can not be converted to the requested type.">csEventErrMismatchFloat</a>; <a name="l00129"></a>00129 <span class="keywordflow">case</span> <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1003e9819bd6fac75033c669b393c8208" title="A string or raw data buffer is contained.">csEventAttrDatabuffer</a>: <a name="l00130"></a>00130 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfeecfaac92f875d2a7d7a31ebf250ce8957" title="The contained value can not be converted to the requested type.">csEventErrMismatchBuffer</a>; <a name="l00131"></a>00131 <span class="keywordflow">case</span> <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe11fc3af31574953caa153c1ece5d71dbc" title="An iEvent is contained.">csEventAttrEvent</a>: <a name="l00132"></a>00132 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee7779c7ec74d22749d47feb52acb1d5c0" title="The contained value can not be converted to the requested type.">csEventErrMismatchEvent</a>; <a name="l00133"></a>00133 <span class="keywordflow">case</span> <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe109479cd1e4e9b9f8adae0674168da45c" title="An iBase interface is contained.">csEventAttriBase</a>: <a name="l00134"></a>00134 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee7a8727a0c9e11768bd220ab88fc3b786" title="The contained value can not be converted to the requested type.">csEventErrMismatchIBase</a>; <a name="l00135"></a>00135 <span class="keywordflow">default</span>: <a name="l00136"></a>00136 <span class="keywordflow">break</span>; <a name="l00137"></a>00137 } <a name="l00138"></a>00138 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfeef044510e671f067cf0f7af7624d84540" title="Unknown error.">csEventErrUhOhUnknown</a>; <a name="l00139"></a>00139 } <a name="l00140"></a>00140 <a name="l00141"></a>00141 <span class="keyword">template</span> <<span class="keyword">class</span> T> <a name="l00142"></a>00142 <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> InternalRetrieveInt (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, T& value)<span class="keyword"> const</span> <a name="l00143"></a>00143 <span class="keyword"> </span>{ <a name="l00144"></a>00144 attribute* <span class="keywordtype">object</span> = attributes.Get (GetKeyID (name), 0); <a name="l00145"></a>00145 <span class="keywordflow">if</span> (!<span class="keywordtype">object</span>) <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfeefb70c5a04108a9a922ceb823a72d8be0" title="The requested attribute was not found.">csEventErrNotFound</a>; <a name="l00146"></a>00146 <span class="keywordflow">if</span> ((object->type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1ef76fbe8edf3545b08ed274af6a0d1af" title="A signed integer is contained.">csEventAttrInt</a>) || (object->type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1c352461ab0721150688d55a0f4a0d66c" title="An unsigned integer is contained.">csEventAttrUInt</a>)) <a name="l00147"></a>00147 { <a name="l00148"></a>00148 value = (T)object->intVal; <a name="l00149"></a>00149 <span class="keyword">const</span> T rangeMin = (T)(1 << (<span class="keyword">sizeof</span>(T) * 8 - 1)); <a name="l00150"></a>00150 <span class="keyword">const</span> T rangeMax = ~rangeMin; <a name="l00151"></a>00151 <span class="keywordflow">if</span> ((object->intVal < rangeMin) || (<span class="keywordtype">object</span>->intVal > rangeMax)) <a name="l00152"></a>00152 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee96b2f249af61bd36e39b606d54f83497" title="The attribute value could be converted to the requested type, however, data was lost...">csEventErrLossy</a>; <a name="l00153"></a>00153 <span class="keywordflow">else</span> <a name="l00154"></a>00154 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee9c1b73fa7f11036be9168c2dd7628b54" title="No error.">csEventErrNone</a>; <a name="l00155"></a>00155 } <a name="l00156"></a>00156 <span class="keywordflow">else</span> <a name="l00157"></a>00157 { <a name="l00158"></a>00158 <span class="keywordflow">return</span> InternalReportMismatch (<span class="keywordtype">object</span>); <a name="l00159"></a>00159 } <a name="l00160"></a>00160 } <a name="l00161"></a>00161 <a name="l00162"></a>00162 <span class="keyword">template</span> <<span class="keyword">class</span> T> <a name="l00163"></a>00163 <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> InternalRetrieveUint (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, T& value)<span class="keyword"> const</span> <a name="l00164"></a>00164 <span class="keyword"> </span>{ <a name="l00165"></a>00165 attribute* <span class="keywordtype">object</span> = attributes.Get (GetKeyID (name), 0); <a name="l00166"></a>00166 <span class="keywordflow">if</span> (!<span class="keywordtype">object</span>) <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfeefb70c5a04108a9a922ceb823a72d8be0" title="The requested attribute was not found.">csEventErrNotFound</a>; <a name="l00167"></a>00167 <span class="keywordflow">if</span> ((object->type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1ef76fbe8edf3545b08ed274af6a0d1af" title="A signed integer is contained.">csEventAttrInt</a>) || (object->type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1c352461ab0721150688d55a0f4a0d66c" title="An unsigned integer is contained.">csEventAttrUInt</a>)) <a name="l00168"></a>00168 { <a name="l00169"></a>00169 value = (T)object->intVal; <a name="l00170"></a>00170 <span class="keyword">const</span> T rangeMax = (T)~0; <a name="l00171"></a>00171 <span class="keywordflow">if</span> ((<a class="code" href="group__util.html#g058a7c8f752204f23318dc1dcab45b1c" title="unsigned 64-bit integer">uint64</a>)<span class="keywordtype">object</span>->intVal > rangeMax) <a name="l00172"></a>00172 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee96b2f249af61bd36e39b606d54f83497" title="The attribute value could be converted to the requested type, however, data was lost...">csEventErrLossy</a>; <a name="l00173"></a>00173 <span class="keywordflow">else</span> <a name="l00174"></a>00174 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee9c1b73fa7f11036be9168c2dd7628b54" title="No error.">csEventErrNone</a>; <a name="l00175"></a>00175 } <a name="l00176"></a>00176 <span class="keywordflow">else</span> <a name="l00177"></a>00177 { <a name="l00178"></a>00178 <span class="keywordflow">return</span> InternalReportMismatch (<span class="keywordtype">object</span>); <a name="l00179"></a>00179 } <a name="l00180"></a>00180 } <a name="l00181"></a>00181 <a name="l00182"></a>00182 <span class="keyword">static</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* GetTypeName (<a class="code" href="group__event__handling.html#ge12006d83c6b873a567c93fbb4670fe1" title="Various attribute data types supported by the event system (iEvent).">csEventAttributeType</a> t); <a name="l00183"></a>00183 <span class="keyword">static</span> <a class="code" href="group__util.html#gbe4f44c93bfeee85c507a999dccf21dd" title="An identifier for a string.">csStringID</a> GetKeyID (<span class="keyword">const</span> <span class="keywordtype">char</span>* key); <a name="l00184"></a>00184 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetKeyName (<a class="code" href="group__util.html#gbe4f44c93bfeee85c507a999dccf21dd" title="An identifier for a string.">csStringID</a> <span class="keywordtype">id</span>); <a name="l00185"></a>00185 <a name="l00186"></a>00186 <span class="keyword">protected</span>: <a name="l00187"></a>00187 <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEvent></a> CreateEvent(); <a name="l00188"></a>00188 <a name="l00189"></a>00189 <span class="keyword">public</span>: <a name="l00191"></a>00191 <a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a> (); <a name="l00192"></a>00192 <a name="l00197"></a>00197 <a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a> (<a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a> <span class="keyword">const</span>&); <a name="l00198"></a>00198 <a name="l00202"></a>00202 <a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a> (<a class="code" href="group__util.html#g28e82998c4c2d1197a1d412bba7da793" title="A time value measured in milliseconds (1/1000 of a second).">csTicks</a> iTime, <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> iName, <span class="keywordtype">bool</span> iBroadcast); <a name="l00203"></a>00203 <a name="l00205"></a>00205 <span class="keyword">virtual</span> ~<a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a> (); <a name="l00206"></a>00206 <a name="l00208"></a>00208 <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> GetName(); <a name="l00209"></a>00209 <a name="l00211"></a><a class="code" href="csevent_8h.html#9f1de86eec14af4b809265d414fe6ac3">00211</a> <span class="preprocessor">#define CS_CSEVENT_ADDINT(type) \</span> <a name="l00212"></a>00212 <span class="preprocessor"> virtual bool Add (const char* name, type value) \</span> <a name="l00213"></a>00213 <span class="preprocessor"> { return InternalAddInt (name, value); }</span> <a name="l00214"></a>00214 <span class="preprocessor"></span> <a class="code" href="csevent_8h.html#9f1de86eec14af4b809265d414fe6ac3" title="Add a named parameter and typed value.">CS_CSEVENT_ADDINT</a>(<a class="code" href="group__util.html#ge47c588f3ab8c61121c1c7ab7edc47cd" title="signed 8-bit integer (-128..127)">int8</a>) <a name="l00215"></a>00215 <a class="code" href="csevent_8h.html#9f1de86eec14af4b809265d414fe6ac3" title="Add a named parameter and typed value.">CS_CSEVENT_ADDINT</a>(<a class="code" href="group__util.html#g4355d16fcf9f644c9ac84293f0b1801f" title="signed 16-bit integer (-32 768..32 767)">int16</a>) <a name="l00216"></a>00216 <a class="code" href="csevent_8h.html#9f1de86eec14af4b809265d414fe6ac3" title="Add a named parameter and typed value.">CS_CSEVENT_ADDINT</a>(<a class="code" href="group__util.html#g56f1a81c92849566ae864511088eb7e8" title="signed 32-bit integer (-2 147 483 648..2 147 483 647)">int32</a>) <a name="l00217"></a>00217 <a class="code" href="csevent_8h.html#9f1de86eec14af4b809265d414fe6ac3" title="Add a named parameter and typed value.">CS_CSEVENT_ADDINT</a>(<a class="code" href="group__util.html#gecfc3c54bd29ad5964e1c1c3ccbf89df" title="signed 64-bit integer">int64</a>) <a name="l00218"></a>00218 <span class="preprocessor">#undef CS_CSEVENT_ADDINT</span> <a name="l00219"></a><a class="code" href="csevent_8h.html#2f085db7cfa6fb05c9529081945b09c4">00219</a> <span class="preprocessor"></span><span class="preprocessor">#define CS_CSEVENT_ADDUINT(type) \</span> <a name="l00220"></a>00220 <span class="preprocessor"> virtual bool Add (const char* name, type value) \</span> <a name="l00221"></a>00221 <span class="preprocessor"> { return InternalAddUInt (name, value); }</span> <a name="l00222"></a>00222 <span class="preprocessor"></span> <a class="code" href="csevent_8h.html#2f085db7cfa6fb05c9529081945b09c4">CS_CSEVENT_ADDUINT</a>(<a class="code" href="group__util.html#gdde6aaee8457bee49c2a92621fe22b79" title="unsigned 8-bit integer (0..255)">uint8</a>) <a name="l00223"></a>00223 <a class="code" href="csevent_8h.html#2f085db7cfa6fb05c9529081945b09c4">CS_CSEVENT_ADDUINT</a>(<a class="code" href="group__util.html#g05f6b0ae8f6a6e135b0e290c25fe0e4e" title="unsigned 16-bit integer (0..65 535)">uint16</a>) <a name="l00224"></a>00224 <a class="code" href="csevent_8h.html#2f085db7cfa6fb05c9529081945b09c4">CS_CSEVENT_ADDUINT</a>(<a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a>) <a name="l00225"></a>00225 <a class="code" href="csevent_8h.html#2f085db7cfa6fb05c9529081945b09c4">CS_CSEVENT_ADDUINT</a>(<a class="code" href="group__util.html#g058a7c8f752204f23318dc1dcab45b1c" title="unsigned 64-bit integer">uint64</a>) <a name="l00226"></a>00226 <span class="preprocessor">#undef CS_CSEVENT_ADDUINT</span> <a name="l00227"></a>00227 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Add (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">float</span> v); <a name="l00228"></a>00228 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Add (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">double</span> v); <a name="l00229"></a>00229 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Add (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *v); <a name="l00230"></a>00230 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Add (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">void</span> *v, <span class="keywordtype">size_t</span> size); <a name="l00231"></a>00231 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Add (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">bool</span> v); <a name="l00232"></a>00232 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Add (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <a class="code" href="structiEvent.html" title="This interface describes any system event.">iEvent</a>* v); <a name="l00233"></a>00233 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Add (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a>* v); <a name="l00234"></a>00234 <a name="l00236"></a><a class="code" href="csevent_8h.html#7b617507691f31082e526bc1e22cc484">00236</a> <span class="preprocessor">#define CS_CSEVENT_FINDINT(T) \</span> <a name="l00237"></a>00237 <span class="preprocessor"> virtual csEventError Retrieve (const char* name, T& value) const \</span> <a name="l00238"></a>00238 <span class="preprocessor"> { return InternalRetrieveInt (name, value); }</span> <a name="l00239"></a>00239 <span class="preprocessor"></span> <a class="code" href="csevent_8h.html#7b617507691f31082e526bc1e22cc484" title="Find a named event for a given type.">CS_CSEVENT_FINDINT</a>(<a class="code" href="group__util.html#ge47c588f3ab8c61121c1c7ab7edc47cd" title="signed 8-bit integer (-128..127)">int8</a>) <a name="l00240"></a>00240 <a class="code" href="csevent_8h.html#7b617507691f31082e526bc1e22cc484" title="Find a named event for a given type.">CS_CSEVENT_FINDINT</a>(<a class="code" href="group__util.html#g4355d16fcf9f644c9ac84293f0b1801f" title="signed 16-bit integer (-32 768..32 767)">int16</a>) <a name="l00241"></a>00241 <a class="code" href="csevent_8h.html#7b617507691f31082e526bc1e22cc484" title="Find a named event for a given type.">CS_CSEVENT_FINDINT</a>(<a class="code" href="group__util.html#g56f1a81c92849566ae864511088eb7e8" title="signed 32-bit integer (-2 147 483 648..2 147 483 647)">int32</a>) <a name="l00242"></a>00242 <span class="preprocessor">#undef CS_CSEVENT_FINDINT</span> <a name="l00243"></a><a class="code" href="classcsEvent.html#e1675a238f9e349d6ad5a6018597f100">00243</a> <span class="preprocessor"></span> <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="group__util.html#gecfc3c54bd29ad5964e1c1c3ccbf89df" title="signed 64-bit integer">int64</a>& value)<span class="keyword"> const</span> <a name="l00244"></a>00244 <span class="keyword"> </span>{ <a name="l00245"></a>00245 attribute* <span class="keywordtype">object</span> = attributes.Get (GetKeyID (name), 0); <a name="l00246"></a>00246 <span class="keywordflow">if</span> (!<span class="keywordtype">object</span>) <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfeefb70c5a04108a9a922ceb823a72d8be0" title="The requested attribute was not found.">csEventErrNotFound</a>; <a name="l00247"></a>00247 <span class="keywordflow">if</span> ((object->type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1ef76fbe8edf3545b08ed274af6a0d1af" title="A signed integer is contained.">csEventAttrInt</a>) || (object->type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1c352461ab0721150688d55a0f4a0d66c" title="An unsigned integer is contained.">csEventAttrUInt</a>)) <a name="l00248"></a>00248 { <a name="l00249"></a>00249 value = <span class="keywordtype">object</span>->intVal; <a name="l00250"></a>00250 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee9c1b73fa7f11036be9168c2dd7628b54" title="No error.">csEventErrNone</a>; <a name="l00251"></a>00251 } <a name="l00252"></a>00252 <span class="keywordflow">else</span> <a name="l00253"></a>00253 { <a name="l00254"></a>00254 <span class="keywordflow">return</span> InternalReportMismatch (<span class="keywordtype">object</span>); <a name="l00255"></a>00255 } <a name="l00256"></a>00256 } <a name="l00257"></a>00257 <a name="l00258"></a><a class="code" href="csevent_8h.html#487c84571f4a55a8bc6b411ee422d1cf">00258</a> <span class="preprocessor">#define CS_CSEVENT_FINDUINT(T) \</span> <a name="l00259"></a>00259 <span class="preprocessor"> virtual csEventError Retrieve (const char* name, T& value) const \</span> <a name="l00260"></a>00260 <span class="preprocessor"> { return InternalRetrieveUint (name, value); }</span> <a name="l00261"></a>00261 <span class="preprocessor"></span> <a class="code" href="csevent_8h.html#487c84571f4a55a8bc6b411ee422d1cf">CS_CSEVENT_FINDUINT</a>(<a class="code" href="group__util.html#gdde6aaee8457bee49c2a92621fe22b79" title="unsigned 8-bit integer (0..255)">uint8</a>) <a name="l00262"></a>00262 <a class="code" href="csevent_8h.html#487c84571f4a55a8bc6b411ee422d1cf">CS_CSEVENT_FINDUINT</a>(<a class="code" href="group__util.html#g05f6b0ae8f6a6e135b0e290c25fe0e4e" title="unsigned 16-bit integer (0..65 535)">uint16</a>) <a name="l00263"></a>00263 <a class="code" href="csevent_8h.html#487c84571f4a55a8bc6b411ee422d1cf">CS_CSEVENT_FINDUINT</a>(<a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a>) <a name="l00264"></a>00264 <span class="preprocessor">#undef CS_CSEVENT_FINDUINT</span> <a name="l00265"></a><a class="code" href="classcsEvent.html#87d9fc40e174778ecc428bc153e1339b">00265</a> <span class="preprocessor"></span> <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="group__util.html#g058a7c8f752204f23318dc1dcab45b1c" title="unsigned 64-bit integer">uint64</a>& value)<span class="keyword"> const</span> <a name="l00266"></a>00266 <span class="keyword"> </span>{ <a name="l00267"></a>00267 attribute* <span class="keywordtype">object</span> = attributes.Get (GetKeyID (name), 0); <a name="l00268"></a>00268 <span class="keywordflow">if</span> (!<span class="keywordtype">object</span>) <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfeefb70c5a04108a9a922ceb823a72d8be0" title="The requested attribute was not found.">csEventErrNotFound</a>; <a name="l00269"></a>00269 <span class="keywordflow">if</span> ((object->type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1ef76fbe8edf3545b08ed274af6a0d1af" title="A signed integer is contained.">csEventAttrInt</a>) || (object->type == <a class="code" href="group__event__handling.html#gge12006d83c6b873a567c93fbb4670fe1c352461ab0721150688d55a0f4a0d66c" title="An unsigned integer is contained.">csEventAttrUInt</a>)) <a name="l00270"></a>00270 { <a name="l00271"></a>00271 value = (<a class="code" href="group__util.html#g058a7c8f752204f23318dc1dcab45b1c" title="unsigned 64-bit integer">uint64</a>)object->intVal; <a name="l00272"></a>00272 <span class="keywordflow">return</span> <a class="code" href="group__event__handling.html#gge069ae995b63f57fb1732075224dcfee9c1b73fa7f11036be9168c2dd7628b54" title="No error.">csEventErrNone</a>; <a name="l00273"></a>00273 } <a name="l00274"></a>00274 <span class="keywordflow">else</span> <a name="l00275"></a>00275 { <a name="l00276"></a>00276 <span class="keywordflow">return</span> InternalReportMismatch (<span class="keywordtype">object</span>); <a name="l00277"></a>00277 } <a name="l00278"></a>00278 } <a name="l00279"></a>00279 <a name="l00280"></a>00280 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">float</span> &v) <span class="keyword">const</span>; <a name="l00281"></a>00281 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">double</span> &v) <span class="keyword">const</span>; <a name="l00282"></a>00282 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *&v) <span class="keyword">const</span>; <a name="l00283"></a>00283 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">void</span> *&v, <a name="l00284"></a>00284 <span class="keywordtype">size_t</span> &size) <span class="keyword">const</span>; <a name="l00285"></a>00285 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">bool</span> &v) <span class="keyword">const</span>; <a name="l00286"></a>00286 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEvent></a> &v) <span class="keyword">const</span>; <a name="l00287"></a>00287 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge069ae995b63f57fb1732075224dcfee" title="Error codes for event attribute retrieval.">csEventError</a> Retrieve (<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iBase></a> &v) <span class="keyword">const</span>; <a name="l00288"></a>00288 <a name="l00289"></a>00289 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> AttributeExists (<span class="keyword">const</span> <span class="keywordtype">char</span>* name); <a name="l00290"></a>00290 <span class="keyword">virtual</span> <a class="code" href="group__event__handling.html#ge12006d83c6b873a567c93fbb4670fe1" title="Various attribute data types supported by the event system (iEvent).">csEventAttributeType</a> GetAttributeType (<span class="keyword">const</span> <span class="keywordtype">char</span>* name); <a name="l00291"></a>00291 <a name="l00292"></a>00292 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Remove (<span class="keyword">const</span> <span class="keywordtype">char</span> *name); <a name="l00293"></a>00293 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> RemoveAll (); <a name="l00294"></a>00294 <a name="l00295"></a>00295 <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEventAttributeIterator></a> GetAttributeIterator(); <a name="l00296"></a>00296 <a name="l00297"></a>00297 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Print (<span class="keywordtype">int</span> level = 0); <a name="l00298"></a>00298 <a name="l00299"></a>00299 }; <a name="l00300"></a>00300 <a name="l00308"></a><a class="code" href="classcsPoolEvent.html">00308</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsPoolEvent.html" title="This class is a system event designed for the pool system.">csPoolEvent</a> : <span class="keyword">public</span> <a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a> <a name="l00309"></a>00309 { <a name="l00310"></a>00310 <span class="keyword">typedef</span> <a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a> <a class="code" href="classcsEvent.html" title="This class represents a system event.">superclass</a>; <a name="l00311"></a><a class="code" href="classcsPoolEvent.html#2b401383a14a671bdea4caa78bb86ff8">00311</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a>; <a name="l00312"></a><a class="code" href="classcsPoolEvent.html#d60b5dcbafd43b1308b10c057dd4e357">00312</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classcsEvent.html" title="This class represents a system event.">csEvent</a>; <a name="l00313"></a>00313 <a name="l00314"></a>00314 <span class="keyword">private</span>: <a name="l00315"></a>00315 <span class="comment">// As per the XML pool, keep a reference to the pool container obejct</span> <a name="l00316"></a>00316 <span class="comment">// and this also allows our overridden DecRef() to place the event back</span> <a name="l00317"></a>00317 <span class="comment">// into the pool when users are done with it.</span> <a name="l00318"></a>00318 <a class="code" href="classcsWeakRef.html" title="A weak reference.">csWeakRef<csEventQueue></a> pool; <a name="l00319"></a>00319 <a name="l00320"></a>00320 <span class="comment">// The next event in the pool, or null if the event is in use.</span> <a name="l00321"></a>00321 <a class="code" href="classcsPoolEvent.html" title="This class is a system event designed for the pool system.">csPoolEvent</a> *next; <a name="l00322"></a>00322 <a name="l00323"></a>00323 <span class="comment">// The 'real' DecRef() call that deletes the event, should in theory only be</span> <a name="l00324"></a>00324 <span class="comment">// called from csEventQueue.</span> <a name="l00325"></a>00325 <span class="keywordtype">void</span> Free () { <a class="code" href="classscfImplementation.html#9b996efbd8891c74a46f2c6705b56f89" title="Decrement the reference count.">csEvent::DecRef</a>(); } <a name="l00326"></a>00326 <a name="l00327"></a>00327 <span class="keyword">protected</span>: <a name="l00328"></a>00328 <span class="keyword">virtual</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef<iEvent></a> CreateEvent(); <a name="l00329"></a>00329 <a name="l00330"></a>00330 <span class="keyword">public</span>: <a name="l00332"></a>00332 <a class="code" href="classcsPoolEvent.html" title="This class is a system event designed for the pool system.">csPoolEvent</a> (<a class="code" href="classcsEventQueue.html" title="This class represents a general event queue.">csEventQueue</a> *q); <a name="l00333"></a>00333 <a name="l00335"></a>00335 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classscfImplementation.html#9b996efbd8891c74a46f2c6705b56f89" title="Decrement the reference count.">DecRef</a> (); <a name="l00336"></a>00336 }; <a name="l00337"></a>00337 <a name="l00341"></a><a class="code" href="classcsEventAttributeIterator.html">00341</a> <span class="keyword">class </span><a class="code" href="classcsEventAttributeIterator.html">csEventAttributeIterator</a> : <a name="l00342"></a>00342 <span class="keyword">public</span> <a class="code" href="classscfImplementation1.html">scfImplementation1</a><csEventAttributeIterator, iEventAttributeIterator> <a name="l00343"></a>00343 { <a name="l00344"></a>00344 <a class="code" href="classcsHash.html" title="A generic hash table class, which grows dynamically and whose buckets are unsorted...">csHash<csEvent::attribute*, csStringID>::GlobalIterator</a> iterator; <a name="l00345"></a>00345 <span class="keyword">public</span>: <a name="l00346"></a>00346 <a name="l00347"></a><a class="code" href="classcsEventAttributeIterator.html#f814df88babbb770173ba098779b0e0b">00347</a> <a class="code" href="classcsEventAttributeIterator.html#f814df88babbb770173ba098779b0e0b">csEventAttributeIterator</a> ( <a name="l00348"></a>00348 <a class="code" href="classcsHash.html" title="A generic hash table class, which grows dynamically and whose buckets are unsorted...">csHash<csEvent::attribute*, csStringID>::GlobalIterator</a>& iter) <a name="l00349"></a>00349 : <a class="code" href="classscfImplementation1.html">scfImplementationType</a> (this), iterator(iter) <a name="l00350"></a>00350 { <a name="l00351"></a>00351 } <a name="l00352"></a>00352 <a name="l00353"></a><a class="code" href="classcsEventAttributeIterator.html#52f31b4f9e8e7486d6f034d326e2d665">00353</a> <span class="keyword">virtual</span> <a class="code" href="classcsEventAttributeIterator.html#52f31b4f9e8e7486d6f034d326e2d665">~csEventAttributeIterator</a>() <a name="l00354"></a>00354 { <a name="l00355"></a>00355 } <a name="l00356"></a>00356 <a name="l00357"></a><a class="code" href="classcsEventAttributeIterator.html#b2c6b2b3143e6e4d0512b36a499bc769">00357</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsEventAttributeIterator.html#b2c6b2b3143e6e4d0512b36a499bc769" title="Whether a next attribute is available.">HasNext</a>() <a name="l00358"></a>00358 { <a name="l00359"></a>00359 <span class="keywordflow">return</span> iterator.HasNext(); <a name="l00360"></a>00360 } <a name="l00361"></a>00361 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classcsEventAttributeIterator.html#0fe7611875b25eb5d573638dfb6123cd" title="Return the name of the next attribute.">Next</a>(); <a name="l00362"></a><a class="code" href="classcsEventAttributeIterator.html#287884681f2706b1294093c07e76f11e">00362</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classcsEventAttributeIterator.html#287884681f2706b1294093c07e76f11e" title="Reset the iterator to the start.">Reset</a>() <a name="l00363"></a>00363 { <a name="l00364"></a>00364 iterator.Reset(); <a name="l00365"></a>00365 } <a name="l00366"></a>00366 }; <a name="l00367"></a>00367 <a name="l00368"></a>00368 <span class="preprocessor">#endif // __CS_CSEVENT_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>