00001 #ifndef DISTBOSS_READER_RPC_H
00002 #define DISTBOSS_READER_RPC_H
00003
00004 #include "DistBossUtil/PthrReaderBufPool.h"
00005 #include "DistBossServer/RpcInterface.h"
00006 #include "dis.hxx"
00007 #include <string>
00008 #include <map>
00009 #include <vector>
00010 #include <semaphore.h>
00011
00012 template<class Reader>
00013 class ReaderRpc : virtual public DimRpc, virtual public RpcInterface
00014 {
00015 public :
00016
00017 ReaderRpc(const std::string& svrName, const std::vector<std::string>& fnames, int evtMax);
00018 virtual ~ReaderRpc();
00019
00020 int wait_to_end();
00021
00022
00023 private :
00024
00025 void rpcHandler();
00026
00027 ReaderRpc();
00028
00029
00030 private :
00031
00032 int m_evtDone;
00033 int m_evtMax;
00034
00035 int m_stopFlag;
00036
00037 int m_inCode;
00038 int m_outCode;
00039 const uint32_t* m_pEvt;
00040
00041 PthrReaderBufPool<Reader>* m_freader;
00042
00043 sem_t m_sem;
00044
00045 std::string m_svrName;
00046
00047 std::map<int, AutoEnlargeBuffer*> m_evtBak;
00048 };
00049
00050 #include "DistBossServer/template/ReaderRpc.cc"
00051
00052 #endif