inetwork/netman.h
00001 00002 /* 00003 (C) 2002 Mat Sutcliffe <oktal@gmx.co.uk> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_INETWORK_NETMAN_H__ 00021 #define __CS_INETWORK_NETMAN_H__ 00022 00023 #include "csutil/scf.h" 00024 #include "csutil/ref.h" 00025 00026 struct iNetworkEndPoint; 00027 struct iNetworkConnection; 00028 struct iNetworkListener; 00029 00030 struct iNetworkSocket2; 00031 00032 class csDataStream; 00033 00034 SCF_VERSION (iNetworkPacket, 0, 1, 0); 00035 00045 struct iNetworkPacket : public iBase 00046 { 00055 virtual bool Read (csDataStream &data, iNetworkConnection *socket) = 0; 00056 00060 virtual char* Write (size_t &length) = 0; 00061 00065 virtual csPtr<iNetworkPacket> New () = 0; 00066 00071 virtual bool FilterSocket (iNetworkConnection *) = 0; 00072 }; 00073 00074 SCF_VERSION (iNetworkPacket2, 0, 0, 1); 00075 00085 struct iNetworkPacket2 : public iBase 00086 { 00095 virtual bool Read (csDataStream &data, iNetworkSocket2 *socket) = 0; 00096 00100 virtual char* Write (size_t &length) = 0; 00101 00105 virtual csPtr<iNetworkPacket2> New () = 0; 00106 00111 virtual bool FilterSocket (iNetworkSocket2 *) = 0; 00112 }; 00113 00114 SCF_VERSION (iNetworkManager, 0, 0, 1); 00115 00125 struct iNetworkManager : public iBase 00126 { 00128 virtual void RegisterConnection 00129 (iNetworkConnection *, iNetworkPacket *) = 0; 00130 00132 virtual void RegisterListener 00133 (iNetworkListener *, iNetworkPacket *) = 0; 00134 00136 virtual bool UnregisterEndPoint (iNetworkEndPoint *) = 0; 00137 00139 virtual bool Send (iNetworkConnection *, iNetworkPacket *) = 0; 00140 00143 virtual bool SendToAll (iNetworkPacket *) = 0; 00144 00146 virtual void RegisterConnectedSocket 00147 (iNetworkSocket2 *, iNetworkPacket2 *) = 0; 00148 00150 virtual bool UnregisterConnectedSocket (iNetworkSocket2 *) = 0; 00151 00153 virtual void RegisterListeningSocket 00154 (iNetworkSocket2 *, iNetworkPacket2 *) = 0; 00155 00157 virtual bool UnregisterListeningSocket (iNetworkSocket2 *) = 0; 00158 00160 virtual bool Send (iNetworkSocket2 *, iNetworkPacket2 *) = 0; 00161 00164 virtual bool SendToAll (iNetworkPacket2 *) = 0; 00165 }; 00166 00167 #endif // __CS_INETWORK_NETMAN_H__ 00168
Generated for Crystal Space by doxygen 1.2.18