00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACE_MEM_ADDR_H
00015 #define ACE_MEM_ADDR_H
00016 #include "ace/pre.h"
00017
00018 #include "ace/ACE_export.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif
00023
00024 #if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)
00025
00026 #include "ace/INET_Addr.h"
00027
00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00029
00030
00031
00032
00033
00034
00035
00036 class ACE_Export ACE_MEM_Addr : public ACE_Addr
00037 {
00038 public:
00039
00040
00041 ACE_MEM_Addr (void);
00042
00043
00044 ACE_MEM_Addr (const ACE_MEM_Addr &);
00045
00046
00047 ACE_MEM_Addr (u_short port_number);
00048
00049
00050 explicit ACE_MEM_Addr (const ACE_TCHAR port_name[]);
00051
00052
00053 ~ACE_MEM_Addr (void);
00054
00055
00056
00057
00058 int initialize_local (u_short port);
00059
00060
00061 int same_host (const ACE_INET_Addr& sap);
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 int set (u_short port_number,
00072 int encode = 1);
00073
00074
00075
00076 int set (const ACE_TCHAR port_name[]);
00077
00078
00079 virtual void *get_addr (void) const;
00080
00081
00082 virtual void set_addr (void *, int len);
00083
00084
00085
00086 virtual int addr_to_string (ACE_TCHAR buffer[],
00087 size_t size,
00088 int ipaddr_format = 1) const;
00089
00090
00091 virtual int string_to_addr (const ACE_TCHAR address[]);
00092
00093
00094 void set_port_number (u_short,
00095 int encode = 1);
00096
00097
00098 u_short get_port_number (void) const;
00099
00100
00101 int get_host_name (ACE_TCHAR hostname[],
00102 size_t hostnamelen) const;
00103
00104
00105
00106
00107
00108
00109 const char *get_host_name (void) const;
00110
00111
00112 const char *get_host_addr (void) const;
00113
00114
00115
00116 ACE_UINT32 get_ip_address (void) const;
00117
00118 const ACE_INET_Addr &get_remote_addr (void) const;
00119 const ACE_INET_Addr &get_local_addr (void) const;
00120
00121
00122
00123 bool operator == (const ACE_MEM_Addr &SAP) const;
00124 bool operator == (const ACE_INET_Addr &SAP) const;
00125
00126
00127 bool operator != (const ACE_MEM_Addr &SAP) const;
00128 bool operator != (const ACE_INET_Addr &SAP) const;
00129
00130
00131 virtual u_long hash (void) const;
00132
00133
00134 void dump (void) const;
00135
00136
00137 ACE_ALLOC_HOOK_DECLARE;
00138
00139 private:
00140
00141 ACE_INET_Addr external_;
00142
00143
00144 ACE_INET_Addr internal_;
00145 };
00146
00147 ACE_END_VERSIONED_NAMESPACE_DECL
00148
00149 #if defined (__ACE_INLINE__)
00150 #include "ace/MEM_Addr.inl"
00151 #endif
00152
00153 #endif
00154
00155 #include "ace/post.h"
00156 #endif