00001 #ifndef bbslsrv2_h 00002 #define bbslsrv2_h 00003 00004 #include <InterViews/resource.h> 00005 #include <pvm3.h> 00006 00007 class PvmMessageList; 00008 class PvmPendingList; 00009 class PvmWorkList; 00010 class PvmReadyList; 00011 class PvmLookingToDoList; 00012 class PvmResultList; 00013 00014 extern "C" { 00015 void bbs_handle(); 00016 } 00017 00018 class BBSDirectServer { 00019 public: 00020 BBSDirectServer(); 00021 virtual ~BBSDirectServer(); 00022 00023 void post(const char* key); 00024 boolean look(const char* key); 00025 boolean look_take(const char* key); 00026 boolean take_pending(const char* key, int* cid); 00027 void put_pending(const char* key, int cid); 00028 static BBSDirectServer* server_; 00029 static void handle(); // all remote requests 00030 static void handle1(); 00031 void start(); 00032 void done(); 00033 00034 void post_todo(int parentid, int cid); 00035 void context(int ncid, int* cids); 00036 boolean send_context(int cid); // sends if not sent already 00037 void post_result(int id); 00038 int look_take_todo(); 00039 int look_take_result(int parentid); 00040 private: 00041 void add_looking_todo(int cid); 00042 private: 00043 PvmMessageList* messages_; 00044 PvmPendingList* pending_; 00045 PvmWorkList* work_; 00046 PvmLookingToDoList* looking_todo_; 00047 PvmReadyList* todo_; 00048 PvmResultList* results_; 00049 PvmLookingToDoList* send_context_; 00050 int next_id_; 00051 int context_buf_; 00052 int remaining_context_cnt_; 00053 }; 00054 00055 #endif