Added a less than operator that will compare the internal opaque pointer values so SBBroadcaster objects can be contained in ordered containers or sorted.

llvm-svn: 120967
This commit is contained in:
Greg Clayton 2010-12-05 23:14:19 +00:00
parent 70fbbf534b
commit f7d6a2a6a8
2 changed files with 16 additions and 0 deletions

View File

@ -58,12 +58,22 @@ public:
RemoveListener (const lldb::SBListener &listener, uint32_t event_mask = UINT32_MAX);
#ifndef SWIG
// This comparison is checking if the internal opaque pointer value
// is equal to that in "rhs".
bool
operator == (const lldb::SBBroadcaster &rhs) const;
// This comparison is checking if the internal opaque pointer value
// is not equal to that in "rhs".
bool
operator != (const lldb::SBBroadcaster &rhs) const;
// This comparison is checking if the internal opaque pointer value
// is less than that in "rhs" so SBBroadcaster objects can be contained
// in ordered containers.
bool
operator < (const lldb::SBBroadcaster &rhs) const;
#endif
protected:

View File

@ -189,3 +189,9 @@ SBBroadcaster::operator != (const SBBroadcaster &rhs) const
{
return m_opaque_ptr != rhs.m_opaque_ptr;
}
bool
SBBroadcaster::operator < (const SBBroadcaster &rhs) const
{
return m_opaque_ptr < rhs.m_opaque_ptr;
}