00001 /* 00002 * Network member header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_NETWORK_MEMBER_H__ 00009 #define __SP_NETWORK_MEMBER_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 00014 #ifdef SP_COMPILE_WITH_NETWORKSYSTEM 00015 00016 00017 #include "Base/spBaseObject.hpp" 00018 #include "Framework/Network/spNetworkAddress.hpp" 00019 00020 00021 namespace sp 00022 { 00023 namespace network 00024 { 00025 00026 00028 enum ENetworkMembers 00029 { 00030 NETWORK_CLIENT, 00031 NETWORK_SERVER, 00032 }; 00033 00034 00039 class SP_EXPORT NetworkMember : public BaseObject 00040 { 00041 00042 public: 00043 00044 virtual ~NetworkMember(); 00045 00046 /* Inline functions */ 00047 00048 inline NetworkAddress getAddress() const 00049 { 00050 return Address_; 00051 } 00052 00053 inline bool isServer() const 00054 { 00055 return Type_ == NETWORK_SERVER; 00056 } 00057 00058 protected: 00059 00060 NetworkMember(const ENetworkMembers Type, const NetworkAddress &Address); 00061 00062 private: 00063 00064 friend class NetworkSystemUDP; 00065 00066 /* Members */ 00067 00068 ENetworkMembers Type_; 00069 NetworkAddress Address_; 00070 00071 }; 00072 00073 00074 } // /namespace network 00075 00076 } // /namespace sp 00077 00078 00079 #endif 00080 00081 #endif 00082 00083 00084 00085 // ================================================================================