InetSocketAddress: replace explicit conversion to implicit conversion
This commit is contained in:
1 parent
9c0efed0fa
commit
90d2314ab2
6 files changed
+28
-14
No files matched your search
@@ -51,6 +51,16 @@ InetSocketAddress::IsMatchingType (const Address &address)
|
||||
return address.CheckCompatible (GetType (), 6);
|
||||
}
|
||||
|
||||
InetSocketAddress::operator Address () const
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
|
||||
InetSocketAddress::InetSocketAddress (const Address &address)
|
||||
{
|
||||
*this = ConvertFrom (address);
|
||||
}
|
||||
|
||||
Address
|
||||
InetSocketAddress::ConvertTo (void) const
|
||||
{
|
||||
|
||||
@@ -73,14 +73,18 @@ public:
|
||||
* \returns an Address instance which represents this
|
||||
* InetSocketAddress instance.
|
||||
*/
|
||||
Address ConvertTo (void) const;
|
||||
operator Address () const;
|
||||
|
||||
/**
|
||||
* \param address the Address instance to convert from.
|
||||
* \returns an InetSocketAddress which corresponds to the input
|
||||
*
|
||||
* Construct an InetSocketAddress which corresponds to the input
|
||||
* Address
|
||||
*/
|
||||
static InetSocketAddress ConvertFrom (const Address &address);
|
||||
InetSocketAddress (const Address &address);
|
||||
private:
|
||||
Address ConvertTo (void) const;
|
||||
static InetSocketAddress ConvertFrom (const Address &address);
|
||||
static uint8_t GetType (void);
|
||||
Ipv4Address m_ipv4;
|
||||
uint16_t m_port;
|
||||
|
||||
Reference in new issue
Block a user