reSIProcate/stack  9694
Public Member Functions
resip::Tuple::AnyInterfaceCompare Class Reference

A "less than" comparator for Tuple, for use in map containers etc. More...

#include <Tuple.hxx>

List of all members.

Public Member Functions

bool operator() (const Tuple &x, const Tuple &y) const

Detailed Description

A "less than" comparator for Tuple, for use in map containers etc.

Comparison is based on transport type, and if those are equal, it is based on port number.

Definition at line 192 of file Tuple.hxx.


Member Function Documentation

bool Tuple::AnyInterfaceCompare::operator() ( const Tuple x,
const Tuple y 
) const

Definition at line 813 of file Tuple.cxx.

References resip::Tuple::m_anonv4, resip::Tuple::mSockaddr, and resip::Tuple::mTransportType.

{
   if (lhs.mTransportType < rhs.mTransportType)
   {
      return true;
   }
   else if (lhs.mTransportType > rhs.mTransportType)
   {
      return false;
   }
   else if (lhs.mSockaddr.sa_family == AF_INET && rhs.mSockaddr.sa_family == AF_INET)
   {
      if (lhs.m_anonv4.sin_port < rhs.m_anonv4.sin_port)
      {
         return true;
      }
      else
      {
         return false;
      }
   }
#ifdef USE_IPV6
   else if (lhs.mSockaddr.sa_family == AF_INET6 &&
            rhs.mSockaddr.sa_family == AF_INET6)
   {
      if (lhs.m_anonv6.sin6_port < rhs.m_anonv6.sin6_port)
      {
         return true;
      }
      else
      {
         return false;
      }
   }
   else if (lhs.mSockaddr.sa_family == AF_INET6 &&
            rhs.mSockaddr.sa_family == AF_INET)
   {
      return true;
   }
   else if (lhs.mSockaddr.sa_family == AF_INET &&
            rhs.mSockaddr.sa_family == AF_INET6)
   {
      return false;
   }
#endif
   else
   {
      return false;
   }
};

The documentation for this class was generated from the following files: