add implicit conversion to Ipv4Address

This commit is contained in:
Mathieu Lacage
2007-07-30 14:20:10 +02:00
parent 2e723a700d
commit 497b9deadc
2 changed files with 13 additions and 2 deletions

View File

@@ -211,6 +211,15 @@ Ipv4Address::IsMatchingType (const Address &address)
{
return address.CheckCompatible (GetType (), 4);
}
Ipv4Address::operator Address ()
{
return ConvertTo ();
}
Ipv4Address::Ipv4Address (const Address &address)
{
*this = ConvertFrom (address);
}
Address
Ipv4Address::ConvertTo (void) const
{

View File

@@ -105,14 +105,16 @@ public:
Ipv4Address CombineMask (Ipv4Mask const &mask) const;
static bool IsMatchingType (const Address &address);
Address ConvertTo (void) const;
static Ipv4Address ConvertFrom (const Address &address);
operator Address ();
Ipv4Address (const Address &address);
static Ipv4Address GetZero (void);
static Ipv4Address GetAny (void);
static Ipv4Address GetBroadcast (void);
static Ipv4Address GetLoopback (void);
private:
Address ConvertTo (void) const;
static Ipv4Address ConvertFrom (const Address &address);
static uint8_t GetType (void);
uint32_t m_address;
};