00001 /* 00002 $Id: netobject_channel_generic.h,v 1.3 2001/03/15 12:14:47 mbn Exp $ 00003 00004 ------------------------------------------------------------------------ 00005 ClanLib, the platform independent game SDK. 00006 00007 This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE 00008 version 2. See COPYING for details. 00009 00010 For a total list of contributers see CREDITS. 00011 00012 ------------------------------------------------------------------------ 00013 */ 00014 00015 #ifndef header_netobject_channel_generic 00016 #define header_netobject_channel_generic 00017 00018 #include <map> 00019 #include <string> 00020 #include <queue> 00021 #include "API/Core/System/keep_alive.h" 00022 #include "API/Network/netobject.h" 00023 00024 class CL_NetObjectChannel_Generic : public CL_KeepAlive 00025 { 00026 public: 00027 CL_NetObjectChannel_Generic(class CL_NetSession *netgame, int channel, CL_NetObjectChannel *owner); 00028 ~CL_NetObjectChannel_Generic(); 00029 00030 int add_ref(); 00031 int release_ref(); 00032 00033 void begin_sync(const CL_NetGroup *group); 00034 void end_sync(const CL_NetGroup *group); 00035 bool wait_sync(int timeout = -1); 00036 00037 void send(int obj_id, int msg_type, const std::string &message); 00038 void talkback(int obj_id, int talkback_type, const std::string &message); 00039 00040 public: 00041 virtual void keep_alive(); 00042 00043 int ref; 00044 int id_counter; 00045 int channel; 00046 00047 CL_NetSession *netgame; 00048 CL_NetObjectChannel *owner; 00049 00050 CL_Signal_v3<const class CL_NetObject &, int, const std::string &> sig_create_object; 00051 00052 std::map<int, CL_NetObject_Generic *> objects; 00053 std::queue<bool> received_sync; 00054 }; 00055 00056 #endif
1.2.6 written by Dimitri van Heesch,
© 1997-2001