TAO::Less_Than_ObjectKey Class Reference

Compares the length and then the contents of ObjectKeys. More...

#include <ObjectKey_Table.h>

List of all members.

Public Member Functions

bool operator() (const TAO::ObjectKey &lhs, const TAO::ObjectKey &rhs) const


Detailed Description

Compares the length and then the contents of ObjectKeys.

Should have been a specialization of the functor ACE_Less_Than<sequence<CORBA::Octet>>. But that will not work so easily across bunch of stuff. Hence let us put up with this for the time being.

Definition at line 50 of file ObjectKey_Table.h.


Member Function Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL bool TAO::Less_Than_ObjectKey::operator() ( const TAO::ObjectKey &  lhs,
const TAO::ObjectKey &  rhs 
) const

Definition at line 15 of file ObjectKey_Table.cpp.

References ACE_OS::memcmp().

00017 {
00018   const CORBA::ULong rlen = rhs.length ();
00019   const CORBA::ULong llen = lhs.length ();
00020   if (llen < rlen)
00021     {
00022       return 1;
00023     }
00024   else if (llen > rlen)
00025     {
00026       return 0;
00027     }
00028 
00029   const CORBA::Octet * rhs_buff = rhs.get_buffer ();
00030   const CORBA::Octet * lhs_buff = lhs.get_buffer ();
00031   const bool result = (ACE_OS::memcmp (lhs_buff, rhs_buff, rlen) < 0);
00032 
00033   return result;
00034 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:39:14 2010 for TAO by  doxygen 1.4.7