00001 #ifndef BspProxyImpl_HPP 00002 #define BspProxyImpl_HPP 00003 00004 #include <string> 00005 #include <vector> 00006 #include <pthread.h> 00007 00008 extern "C" { 00009 #include <lua.h> 00010 } 00011 00012 using namespace std; 00013 00014 #include "utils/c++/Config.hpp" 00015 #include "BspCentral.hpp" 00016 00017 class BspCentral; 00018 00019 00031 class BspProxyImpl{ 00032 00033 private: 00034 00035 //Fields-------------------------------------------------------------------------- 00036 00037 00038 struct lua_State * serverSideState; 00040 string orbPath; 00041 string bspIdlPath; 00042 string myIor; 00044 BspCentral * bspCentral; 00047 static BspProxyImpl * singleInstance; 00050 //Methods-------------------------------------------------------------------------- 00051 00059 BspProxyImpl(BspCentral * bspCentral_, const Config & config); 00060 00066 static int registerRemoteIorWrapper(struct lua_State * state); 00067 00073 static int takeYourPidWrapper(struct lua_State * state); 00074 00079 static void * serverSideSetupWrapper(void * ptr); 00080 00084 void serverSideSetup(); 00085 00090 static int bspPutWrapper(struct lua_State * state); 00091 00096 static int bspSynchWrapper(struct lua_State * state); 00097 00102 static int bspSynchDoneWrapper(struct lua_State * state); 00103 00108 static int bspGetWrapper(struct lua_State * state); 00109 00114 static int bspGetRequestWrapper(struct lua_State * state); 00115 00120 static int bspGetReplyWrapper(struct lua_State * state); 00121 00122 00123 public: 00124 00128 const string & getIor() { return myIor; } 00129 00138 static BspProxyImpl & init(BspCentral * bspCentral_, const Config & config); 00139 00143 static BspProxyImpl & getInstance(); 00144 00145 }; 00146 00147 00148 00149 #endif//BspProxyImpl_HPP