0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CommAddress.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3
9  * of the License.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
28 #include "Common/Compat.h"
29 
30 #include "CommAddress.h"
31 
32 using namespace Hypertable;
33 
35  if (m_type == PROXY)
36  return proxy;
37  else if (m_type == INET)
38  return InetAddr::format(inet);
39  return "[NULL]";
40 }
String proxy
Proxy name.
Definition: CommAddress.h:175
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
IPv4:port address type.
Definition: CommAddress.h:60
Declarations for CommAddress.
Compatibility Macros for C/C++.
String to_str() const
Returns string representation of address.
Definition: CommAddress.cc:34
String format(int sep= ':') const
Returns a string with a dotted notation ("127.0.0.1:8080") including the port.
Definition: InetAddr.h:132
Hypertable definitions
InetAddr inet
IPv4:port address.
Definition: CommAddress.h:176
int32_t m_type
Address type.
Definition: CommAddress.h:179