summaryrefslogtreecommitdiff
path: root/ace/MEM_Addr.i
blob: 2dd130fca7b4bfcafef39d0e6ba63b11bcdd8e09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* -*- C++ -*- */
// $Id$

// MEM_Addr.i

// Default dtor.
ACE_INLINE
ACE_MEM_Addr::~ACE_MEM_Addr (void)
{
}

// Set the port number.

ACE_INLINE void
ACE_MEM_Addr::set_port_number (u_short port_number,
                                int encode)
{
  ACE_TRACE ("ACE_MEM_Addr::set_port_number");

  this->external_.set_port_number (port_number, encode);
  this->internal_.set_port_number (port_number, encode);
}

ACE_INLINE int
ACE_MEM_Addr::set (u_short port_number, int encode)
{
  ACE_TRACE ("ACE_INET_Addr::set");
  this->set_port_number (port_number, encode);
  return 0;
}

ACE_INLINE int
ACE_MEM_Addr::set (const ASYS_TCHAR port_number[])
{
  ACE_TRACE ("ACE_MEM_Addr::set");
  return this->string_to_addr (port_number);
}

// Return the port number.

ACE_INLINE u_short
ACE_MEM_Addr::get_port_number (void) const
{
  ACE_TRACE ("ACE_MEM_Addr::get_port_number");
  return this->internal_.get_port_number ();
}

// Return the dotted Internet address.

ACE_INLINE const char *
ACE_MEM_Addr::get_host_addr (void) const
{
  ACE_TRACE ("ACE_MEM_Addr::get_host_addr");
  return this->internal_.get_host_addr ();
}

// Return the 4-byte IP address, converting it into host byte order.

ACE_INLINE ACE_UINT32
ACE_MEM_Addr::get_ip_address (void) const
{
  ACE_TRACE ("ACE_MEM_Addr::get_ip_address");
  return this->external_.get_ip_address ();
}

ACE_INLINE const ACE_INET_Addr &
ACE_MEM_Addr::get_local_addr (void) const
{
  return this->internal_;
}

ACE_INLINE const ACE_INET_Addr &
ACE_MEM_Addr::get_remote_addr (void) const
{
  return this->external_;
}

// Compare two addresses for equality.

ACE_INLINE int
ACE_MEM_Addr::operator == (const ACE_MEM_Addr &sap) const
{
  ACE_TRACE ("ACE_MEM_Addr::operator ==");

  return this->external_ == sap.external_ &&
    this->internal_ == sap.internal_;
}

ACE_INLINE int
ACE_MEM_Addr::operator == (const ACE_INET_Addr &sap) const
{
  ACE_TRACE ("ACE_MEM_Addr::operator ==");

  return this->external_ == sap;
}

// Compare two addresses for inequality.

ACE_INLINE int
ACE_MEM_Addr::operator != (const ACE_MEM_Addr &sap) const
{
  ACE_TRACE ("ACE_MEM_Addr::operator !=");
  return !((*this) == sap);
}

ACE_INLINE int
ACE_MEM_Addr::operator != (const ACE_INET_Addr &sap) const
{
  ACE_TRACE ("ACE_MEM_Addr::operator !=");
  return !((*this) == sap);
}

ACE_INLINE u_long
ACE_MEM_Addr::hash (void) const
{
  return this->external_.hash ();
}