merge implicit conversion tree
This commit is contained in:
commit
0db07e14d6
15 files changed
+97
-40
No files matched your search
@@ -95,6 +95,14 @@ Eui48Address::IsMatchingType (const Address &address)
|
||||
{
|
||||
return address.CheckCompatible (GetType (), 6);
|
||||
}
|
||||
Eui48Address::operator Address ()
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
Eui48Address::Eui48Address (const Address &address)
|
||||
{
|
||||
*this = ConvertFrom (address);
|
||||
}
|
||||
Address
|
||||
Eui48Address::ConvertTo (void) const
|
||||
{
|
||||
|
||||
+25
-16
@@ -55,28 +55,37 @@ public:
|
||||
* Copy the internal address to the input buffer.
|
||||
*/
|
||||
void CopyTo (uint8_t buffer[6]) const;
|
||||
|
||||
/**
|
||||
* \returns a new Address instance
|
||||
*
|
||||
* Convert an instance of this class to a polymorphic Address instance.
|
||||
*/
|
||||
operator Address ();
|
||||
/**
|
||||
* \param address a polymorphic address
|
||||
* \returns a new Eui48Address from the polymorphic address
|
||||
*
|
||||
* This function performs a type check and asserts if the
|
||||
* type of the input address is not compatible with an
|
||||
* Eui48Address.
|
||||
*/
|
||||
static Eui48Address ConvertFrom (const Address &address);
|
||||
/**
|
||||
* \returns true if the address matches, false otherwise.
|
||||
*/
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
* Allocate a new Eui48Address.
|
||||
*/
|
||||
static Eui48Address Allocate (void);
|
||||
private:
|
||||
/**
|
||||
* \returns a new Address instance
|
||||
*
|
||||
* Convert an instance of this class to a polymorphic Address instance.
|
||||
*/
|
||||
Address ConvertTo (void) const;
|
||||
/**
|
||||
* \returns true if the address matches, false otherwise.
|
||||
*/
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
* \param address a polymorphic address
|
||||
*
|
||||
* Convert a polymorphic address to an Eui48Address instance.
|
||||
* The conversion performs a type check.
|
||||
*/
|
||||
static Eui48Address ConvertFrom (const Address &address);
|
||||
/**
|
||||
* Allocate a new Eui48Address.
|
||||
*/
|
||||
static Eui48Address Allocate (void);
|
||||
private:
|
||||
static uint8_t GetType (void);
|
||||
uint8_t m_address[6];
|
||||
};
|
||||
|
||||
@@ -95,6 +95,14 @@ Eui64Address::IsMatchingType (const Address &address)
|
||||
{
|
||||
return address.CheckCompatible (GetType (), 8);
|
||||
}
|
||||
Eui48Address::operator Address ()
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
Eui48Address::Eui48Address (const Address &address)
|
||||
{
|
||||
*this = ConvertFrom (address);
|
||||
}
|
||||
Address
|
||||
Eui64Address::ConvertTo (void) const
|
||||
{
|
||||
|
||||
@@ -60,12 +60,22 @@ public:
|
||||
*
|
||||
* Convert an instance of this class to a polymorphic Address instance.
|
||||
*/
|
||||
Address ConvertTo (void) const;
|
||||
operator Address ();
|
||||
/**
|
||||
* \param address a polymorphic address
|
||||
* \returns a new Eui48Address from the polymorphic address
|
||||
*
|
||||
* This function performs a type check and asserts if the
|
||||
* type of the input address is not compatible with an
|
||||
* Eui48Address.
|
||||
*/
|
||||
static Eui48Address ConvertFrom (const Address &address);
|
||||
/**
|
||||
* \returns true if the address matches, false otherwise.
|
||||
*/
|
||||
static bool IsMatchingType (const Address &address);
|
||||
/**
|
||||
<<<<<<< /auto/fugue/u/fugue/home/mlacage/code/ns-3-dev/src/node/eui64-address.h
|
||||
* \param address a polymorphic address
|
||||
*
|
||||
* Convert a polymorphic address to an Eui64Address instance.
|
||||
@@ -74,9 +84,18 @@ public:
|
||||
static Eui64Address ConvertFrom (const Address &address);
|
||||
/**
|
||||
* Allocate a new Eui64Address.
|
||||
=======
|
||||
* Allocate a new Eui48Address.
|
||||
>>>>>>> /tmp/eui48-address.h~other.OBFjbL
|
||||
*/
|
||||
static Eui64Address Allocate (void);
|
||||
private:
|
||||
/**
|
||||
* \returns a new Address instance
|
||||
*
|
||||
* Convert an instance of this class to a polymorphic Address instance.
|
||||
*/
|
||||
Address ConvertTo (void) const;
|
||||
static uint8_t GetType (void);
|
||||
uint8_t m_address[8];
|
||||
};
|
||||
|
||||
@@ -51,6 +51,11 @@ InetSocketAddress::IsMatchingType (const Address &address)
|
||||
return address.CheckCompatible (GetType (), 6);
|
||||
}
|
||||
|
||||
InetSocketAddress::operator Address () const
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
|
||||
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
|
||||
*
|
||||
* Returns an InetSocketAddress which corresponds to the input
|
||||
* Address
|
||||
*/
|
||||
static InetSocketAddress ConvertFrom (const Address &address);
|
||||
private:
|
||||
Address ConvertTo (void) const;
|
||||
|
||||
static uint8_t GetType (void);
|
||||
Ipv4Address m_ipv4;
|
||||
uint16_t m_port;
|
||||
|
||||
@@ -222,6 +222,11 @@ Ipv4Address::IsMatchingType (const Address &address)
|
||||
{
|
||||
return address.CheckCompatible (GetType (), 4);
|
||||
}
|
||||
Ipv4Address::operator Address ()
|
||||
{
|
||||
return ConvertTo ();
|
||||
}
|
||||
|
||||
Address
|
||||
Ipv4Address::ConvertTo (void) const
|
||||
{
|
||||
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
Ipv4Address CombineMask (Ipv4Mask const &mask) const;
|
||||
|
||||
static bool IsMatchingType (const Address &address);
|
||||
Address ConvertTo (void) const;
|
||||
operator Address ();
|
||||
static Ipv4Address ConvertFrom (const Address &address);
|
||||
|
||||
static Ipv4Address GetZero (void);
|
||||
@@ -129,6 +129,7 @@ public:
|
||||
static Ipv4Address GetBroadcast (void);
|
||||
static Ipv4Address GetLoopback (void);
|
||||
private:
|
||||
Address ConvertTo (void) const;
|
||||
static uint8_t GetType (void);
|
||||
uint32_t m_address;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user