📄 wg__message__server_8h-source.html
字号:
<!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>wg_message_server.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> </center><hr><h1>wg_message_server.h</h1><div class="fragment"><pre>00001 <span class="comment">// wg_message_server.h</span>00002 <span class="comment">//</span>00003 <span class="comment">// CMessageServer interface</span>00004 <span class="comment">//</span>00005 <span class="comment">//</span>00006 <span class="comment">// Copyright (c) 2002 Rob Wiskow</span>00007 <span class="comment">// rob-dev@boxedchaos.com</span>00008 <span class="comment">//</span>00009 <span class="comment">// This library is free software; you can redistribute it and/or</span>00010 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>00011 <span class="comment">// License as published by the Free Software Foundation; either</span>00012 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>00013 <span class="comment">//</span>00014 <span class="comment">// This library is distributed in the hope that it will be useful,</span>00015 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>00016 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>00017 <span class="comment">// Lesser General Public License for more details.</span>00018 <span class="comment">//</span>00019 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>00020 <span class="comment">// License along with this library; if not, write to the Free Software</span>00021 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>00022 <span class="comment">//</span>00023 00024 00025 <span class="preprocessor">#ifndef _WG_MESSAGE_SERVER_H_</span>00026 <span class="preprocessor"></span><span class="preprocessor">#define _WG_MESSAGE_SERVER_H_</span>00027 <span class="preprocessor"></span>00028 <span class="preprocessor">#include "wg_message.h"</span>00029 <span class="preprocessor">#include <deque></span>00030 <span class="preprocessor">#include <map></span>00031 <span class="preprocessor">#include "SDL.h"</span>00032 <span class="preprocessor">#include "SDL_thread.h"</span>00033 00034 00035 <span class="keyword">namespace </span>wGui00036 {00037 00038 <span class="keyword">class </span>CMessageClient;00039 00041 <span class="keyword">typedef</span> std::pair<CMessageClient*, bool> t_MessageClientActivePair;00042 00044 <span class="keyword">typedef</span> std::multimap<unsigned char, t_MessageClientActivePair, std::greater<unsigned char> > t_MessageClientPriorityMap;00045 00047 <span class="keyword">typedef</span> std::map<wGui::CMessage::EMessageType, t_MessageClientPriorityMap> t_MessageClientMap;00048 00049 00051 00055 <a name="l00056"></a><a class="code" href="classwGui_1_1CMessageServer.html">00056</a> <span class="keyword">class </span><a class="code" href="classwGui_1_1CMessageServer.html">CMessageServer</a>00057 {00058 <span class="keyword">protected</span>:00060 <a class="code" href="classwGui_1_1CMessageServer.html#b0">CMessageServer</a>(<span class="keywordtype">void</span>);00061 00063 <span class="keyword">virtual</span> <a class="code" href="classwGui_1_1CMessageServer.html#b1">~CMessageServer</a>(<span class="keywordtype">void</span>);00064 00065 00066 <span class="keyword">public</span>:<a name="l00068"></a><a class="code" href="classwGui_1_1CMessageServer.html#s5">00068</a> <span class="keyword">enum</span> <a class="code" href="classwGui_1_1CMessageServer.html#s5">EClientPriority</a>00069 {00070 <a class="code" href="classwGui_1_1CMessageServer.html#s5s0">PRIORITY_LAST</a> = 0, 00071 <a class="code" href="classwGui_1_1CMessageServer.html#s5s1">PRIORITY_LOW</a> = 50, 00072 <a class="code" href="classwGui_1_1CMessageServer.html#s5s2">PRIORITY_NORMAL</a> = 100, 00073 <a class="code" href="classwGui_1_1CMessageServer.html#s5s3">PRIORITY_HIGH</a> = 150, 00074 <a class="code" href="classwGui_1_1CMessageServer.html#s5s4">PRIORITY_FIRST</a> = 255 00075 };00076 00078 <span class="keyword">static</span> <a class="code" href="classwGui_1_1CMessageServer.html#b0">CMessageServer</a>& <a class="code" href="classwGui_1_1CMessageServer.html#d0">Instance</a>(<span class="keywordtype">void</span>);00079 00084 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CMessageServer.html#a0">RegisterMessageClient</a>(CMessageClient* pClient, CMessage::EMessageType eMessageType, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> Priority = <a class="code" href="classwGui_1_1CMessageServer.html#s5s2">PRIORITY_NORMAL</a>);00085 00089 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CMessageServer.html#a1">DeregisterMessageClient</a>(CMessageClient* pClient, CMessage::EMessageType eMessageType);00090 00093 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CMessageServer.html#a1">DeregisterMessageClient</a>(CMessageClient* pClient);00094 00096 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CMessageServer.html#a3">DeliverMessage</a>(<span class="keywordtype">void</span>);00097 00100 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CMessageServer.html#a4">QueueMessage</a>(CMessage* pMessage);00101 <a name="l00103"></a><a class="code" href="classwGui_1_1CMessageServer.html#a5">00103</a> <span class="keywordtype">bool</span> <a class="code" href="classwGui_1_1CMessageServer.html#a5">MessageAvailable</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> <a class="code" href="classwGui_1_1CMessageServer.html#n0">m_MessageQueue</a>.size() > 0; }00104 00105 00106 <span class="keyword">protected</span>:00107 <span class="keyword">static</span> <a class="code" href="classwGui_1_1CMessageServer.html#b0">CMessageServer</a>* <a class="code" href="classwGui_1_1CMessageServer.html#q0">m_pInstance</a>; <a name="l00108"></a><a class="code" href="classwGui_1_1CMessageServer.html#n0">00108</a> std::deque<CMessage*> <a class="code" href="classwGui_1_1CMessageServer.html#n0">m_MessageQueue</a>; <a name="l00109"></a><a class="code" href="classwGui_1_1CMessageServer.html#n1">00109</a> t_MessageClientMap <a class="code" href="classwGui_1_1CMessageServer.html#n1">m_MessageClients</a>; <a name="l00110"></a><a class="code" href="classwGui_1_1CMessageServer.html#n2">00110</a> SDL_sem* <a class="code" href="classwGui_1_1CMessageServer.html#n2">m_pSemaphore</a>; 00111 };00112 00113 }00114 00115 <span class="preprocessor">#endif // _WG_MESSAGE_SERVER_H_</span>00116 <span class="preprocessor"></span>00117 </pre></div><hr><address style="align: right;"><small>Generated on Sat Oct 25 12:43:23 2003 for wGui by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -