00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CNETWORKADDRESS_H
00016 #define CNETWORKADDRESS_H
00017
00018 #include "CString.h"
00019 #include "BasicTypes.h"
00020 #include "IArchNetwork.h"
00021
00023
00026 class CNetworkAddress {
00027 public:
00031 CNetworkAddress();
00032
00037 CNetworkAddress(int port);
00038
00049 CNetworkAddress(const CString& hostname, int port);
00050
00051 CNetworkAddress(const CNetworkAddress&);
00052
00053 ~CNetworkAddress();
00054
00055 CNetworkAddress& operator=(const CNetworkAddress&);
00056
00058
00059
00061
00067 void resolve();
00068
00070
00071
00072
00074
00077 bool operator==(const CNetworkAddress& address) const;
00078
00080
00083 bool operator!=(const CNetworkAddress& address) const;
00084
00086
00089 bool isValid() const;
00090
00092
00096 const CArchNetAddress& getAddress() const;
00097
00099
00103 int getPort() const;
00104
00106
00109 CString getHostname() const;
00110
00112
00113 private:
00114 void checkPort();
00115
00116 private:
00117 CArchNetAddress m_address;
00118 CString m_hostname;
00119 int m_port;
00120 };
00121
00122 #endif