00001 /* -*- C++ -*- */ 00002 #ifndef MPS_Transport_Fastmsg_Server_H 00003 #define MPS_Transport_Fastmsg_Server_H 00004 00005 #include <mps/mps.h> 00006 #include <fastmsg/Scheduler.h> 00007 #include <fastmsg/MailboxThread.h> 00008 00009 class FastmsgServer: public MailboxRequestThread { 00010 private: 00011 MPS::Server *server; 00012 00013 public: 00014 FastmsgServer(MPS::Server *s, Scheduler &sched) 00015 : MailboxRequestThread(sched), 00016 server(s) 00017 {} 00018 00019 virtual void threadMain(); 00020 }; 00021 00022 class FastmsgServerFactory: public ThreadFactory { 00023 private: 00024 MPS::Server *server; 00025 00026 public: 00027 FastmsgServerFactory(MPS::Server *s) 00028 : server(s) 00029 {} 00030 00031 virtual ref<Thread> createThread(Scheduler &sched) { 00032 return new FastmsgServer(server, sched); 00033 } 00034 }; 00035 00036 #endif