SocketSet.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 //
00003 //  REGCOM: Regimental Command
00004 //  Copyright (C) 2008 Randi J. Relander
00005 //    <rjrelander@users.sourceforge.net>
00006 //
00007 //  This program is free software; you can redistribute it and/or
00008 //  modify it under the terms of the GNU General Public License
00009 //  as published by the Free Software Foundation; either version 3
00010 //  of the License, or (at your option) any later version.
00011 //  
00012 //  This program is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU General Public License for more details.
00016 //  
00017 //  You should have received a copy of the GNU General Public
00018 //  License along with this program.  If not, see 
00019 //  <http://www.gnu.org/licenses/>.
00020 //  
00021 //**********************************************************************
00022 
00023 #ifndef REGCOM_COMMON_NETWORK_SOCKET_SET_H
00024 #define REGCOM_COMMON_NETWORK_SOCKET_SET_H
00025 
00026 // LIBRARY INCLUDES
00027 #include "SDL_net.h"
00028 
00029 // PROJET INCLUDES
00030 #include "regcom/common/ErrorCode.h"
00031 
00032 // NAMESPACES
00033 namespace regcom {
00034 namespace network {
00035 
00036 // FORWARD REFERENCES
00037 class TcpSocket;
00038 
00040 //  CLASS: SocketSet
00047 class SocketSet
00048 {
00049 public:
00050 
00051     // PUBLIC METHODS
00052 
00054     SocketSet();
00055 
00057     virtual ~SocketSet();
00058 
00060     common::ErrorCodeType Init(int maxSockets);
00061 
00063     common::ErrorCodeType Add(TcpSocket& rSocket);
00064 
00066     common::ErrorCodeType Remove(TcpSocket& rSocket);
00067 
00068 private:
00069 
00070     // MEMBER VARIABLES
00071 
00073     SDLNet_SocketSet m_SocketSet;
00074 };
00075 
00076 } // namespace network
00077 } // namespace regcom
00078 
00079 #endif