Odamex
Setting the Standard in Multiplayer Doom
odalaunch/src/query_thread.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*-
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: query_thread.h 1788 2010-08-24 04:42:57Z russellrice $
00005 //
00006 // Copyright (C) 2006-2010 by The Odamex Team.
00007 //
00008 // This program is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU General Public License
00010 // as published by the Free Software Foundation; either version 2
00011 // of the License, or (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // DESCRIPTION:
00019 //      Multi-Threaded Server Queries
00020 //      AUTHOR: Michael Wood (mwoodj at huntsvegas dot org)
00021 //
00022 //-----------------------------------------------------------------------------
00023 
00024 #ifndef QUERY_THREAD_H_INCLUDED
00025 #define QUERY_THREAD_H_INCLUDED
00026 
00027 #include <wx/thread.h>
00028 #include <wx/event.h>
00029 
00030 #include "net_packet.h"
00031 
00032 DECLARE_EVENT_TYPE(wxEVT_THREAD_WORKER_SIGNAL, -1);
00033 
00034 #define NUM_THREADS 10
00035 
00036 class QueryThread : public wxThread
00037 {
00038     public:
00039 
00040         QueryThread();
00041         QueryThread(wxEvtHandler *EventHandler, Server *QueryServer, wxInt32 ServerIndex, wxUint32 ServerTimeout) : wxThread(wxTHREAD_JOINABLE),
00042             m_EventHandler(EventHandler), m_QueryServer(QueryServer), m_ServerIndex(ServerIndex), m_ServerTimeout(ServerTimeout) {}
00043 
00044         virtual void *Entry();
00045 
00046     private:
00047         wxEvtHandler  *m_EventHandler;
00048         Server        *m_QueryServer;
00049         wxInt32       m_ServerIndex;
00050         wxUint32      m_ServerTimeout;
00051 
00052 };
00053 
00054 #endif // QUERY_THREAD_H_INCLUDED
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends