activemq-cpp-3.6.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
InetAddress.h
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#ifndef _DECAF_NET_INETADDRESS_H_
19
#define _DECAF_NET_INETADDRESS_H_
20
21
#include <
decaf/util/Config.h
>
22
23
#include <
decaf/lang/ArrayPointer.h
>
24
25
namespace
decaf {
26
namespace
net {
27
33
class
DECAF_API
InetAddress
{
34
protected
:
35
36
static
const
unsigned
char
loopbackBytes[4];
37
static
const
unsigned
char
anyBytes[4];
38
39
protected
:
40
41
mutable
std::string
hostname
;
42
mutable
bool
reached
;
43
mutable
decaf::lang::ArrayPointer<unsigned char>
addressBytes
;
44
45
protected
:
46
47
InetAddress
();
48
InetAddress
(
const
unsigned
char
* ipAddress,
int
numBytes);
49
InetAddress
(
const
std::string& hostname,
const
unsigned
char
* ipAddress,
int
numBytes);
50
51
public
:
52
53
virtual
~
InetAddress
();
54
61
virtual
decaf::lang::ArrayPointer<unsigned char>
getAddress()
const
;
62
68
virtual
std::string getHostAddress()
const
;
69
80
virtual
std::string getHostName()
const
;
81
89
virtual
std::string toString()
const
;
90
97
virtual
InetAddress
* clone()
const
;
98
99
public
:
100
// Address Property Tests, override in the subclasses for correct results
101
107
virtual
bool
isAnyLocalAddress
()
const
{
108
return
false
;
109
}
110
116
virtual
bool
isLoopbackAddress
()
const
{
117
return
false
;
118
}
119
125
virtual
bool
isMulticastAddress
()
const
{
126
return
false
;
127
}
128
134
virtual
bool
isLinkLocalAddress
()
const
{
135
return
false
;
136
}
137
143
virtual
bool
isSiteLocalAddress
()
const
{
144
return
false
;
145
}
146
152
virtual
bool
isMCGlobal
()
const
{
153
return
false
;
154
}
155
161
virtual
bool
isMCNodeLocal
()
const
{
162
return
false
;
163
}
164
170
virtual
bool
isMCLinkLocal
()
const
{
171
return
false
;
172
}
173
179
virtual
bool
isMCSiteLocal
()
const
{
180
return
false
;
181
}
182
188
virtual
bool
isMCOrgLocal
()
const
{
189
return
false
;
190
}
191
192
public
:
193
// Static Create methods.
194
204
static
InetAddress
getByAddress(
const
unsigned
char
* bytes,
int
numBytes);
205
217
static
InetAddress
getByAddress(
const
std::string& hostname,
const
unsigned
char
* bytes,
int
numBytes);
218
227
static
InetAddress
getLocalHost();
228
229
protected
:
230
242
static
unsigned
int
bytesToInt(
const
unsigned
char
* bytes,
int
start);
243
244
static
InetAddress
getAnyAddress();
245
246
static
InetAddress
getLoopbackAddress();
247
248
};
249
250
}}
251
252
#endif
/* _DECAF_NET_INETADDRESS_H_ */
src
main
decaf
net
InetAddress.h
Generated on Mon Mar 4 2013 10:25:46 for activemq-cpp-3.6.0 by
1.8.1.2