added equality operators to compare with pointers

This commit is contained in:
darkeye 2002-02-20 11:51:27 +00:00
parent ab8efd2d31
commit 63e7805dd7
1 changed files with 30 additions and 1 deletions

View File

@ -192,7 +192,7 @@ class Ref
* @exception Exception * @exception Exception
*/ */
inline void inline void
set ( T* newobj ) throw ( Exception ) set ( T * newobj ) throw ( Exception )
{ {
// If equal do nothing // If equal do nothing
if ( newobj == object ) { if ( newobj == object ) {
@ -232,6 +232,19 @@ class Ref
return object; return object;
} }
/**
* Equality operator.
*
* @param other the pointer to compare this with.
* @return true is this Ref refers to the same object as other,
* false otherwise.
*/
inline bool
operator== ( const T * other ) const throw ()
{
return object == other;
}
/** /**
* Equality operator. * Equality operator.
* *
@ -245,6 +258,19 @@ class Ref
return object == other.object; return object == other.object;
} }
/**
* Unequality operator.
*
* @param other the pointer to compare this with.
* @return false is this Ref refers to a different object then other,
* true otherwise.
*/
inline bool
operator!= ( const T * other ) const throw ()
{
return object != other;
}
/** /**
* Unequality operator. * Unequality operator.
* *
@ -274,6 +300,9 @@ class Ref
$Source$ $Source$
$Log$ $Log$
Revision 1.4 2002/02/20 11:51:27 darkeye
added equality operators to compare with pointers
Revision 1.3 2000/11/11 14:55:31 darkeye Revision 1.3 2000/11/11 14:55:31 darkeye
minor bugfix minor bugfix