XmlRpcThreadedServer.h

Go to the documentation of this file.
00001 
00002 #ifndef _XMLRPCTHREADEDSERVER_H_
00003 #define _XMLRPCTHREADEDSERVER_H_
00004 //
00005 // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
00006 //
00007 
00013 #if defined(_MSC_VER)
00014 # pragma warning(disable:4786)    // identifier was truncated in debug info
00015 #endif
00016 
00017 #ifndef MAKEDEPEND
00018 # include <map>
00019 # include <vector>
00020 #endif
00021 
00022 
00023 #include "XmlRpcMutex.h"
00024 #include "XmlRpcServer.h"
00025 #include "XmlRpcThread.h"
00026 
00027 
00028 namespace XmlRpc {
00029 
00031   class XmlRpcThreadedServer : public XmlRpcServer {
00032   public:
00033 
00035     XmlRpcThreadedServer(int nWorkers = 6) : _workers(nWorkers) {}
00036 
00037 
00039 
00040   protected:
00041 
00045     class Worker : XmlRpcRunnable {
00046     public:
00048       Worker() { _thread.setRunnable(this); _thread.start(); }
00049 
00051       void run();
00052 
00053     protected:
00054 
00056       XmlRpcThread _thread;
00057 
00058     };
00059 
00060 
00062     std::vector<Worker> _workers;
00063 
00064 
00066     XmlRpcMutex _mutex;
00067 
00068 
00069   };  // class XmlRpcThreadedServer
00070 
00071 }
00072 
00073 #endif  // _XMLRPCTHREADEDSERVER_H_
Generated on Wed May 26 16:21:15 2010 for OverSim by  doxygen 1.6.3