{
}
-/*! operator== : compares two owners*/
+/*! Operator == compares two owners*/
bool operator==( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 )
{
if ( !p1.isNull() && !p2.isNull() )
return p1.isNull() && p2.isNull();
}
+
+/*! Operator < allows to order suit data owners for map */
+bool operator<( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 )
+{
+ if ( p1.isNull() && p2.isNull() )
+ return false;
+ else if ( p1.isNull() )
+ return true;
+ else if ( p2.isNull() )
+ return false;
+
+ return p1->isLess( *p2 );
+}
+
/*!
\class SUIT_DataOwnerPtrList
implements value list with unique items (uniqueness is
*/
SUIT_DataOwnerPtrList::iterator SUIT_DataOwnerPtrList::append( const SUIT_DataOwnerPtr& x )
{
- if( mySkipEqual && myMap.contains( x ) ) //contains uses SUIT_DataOwnerPtr::operator==
+ if ( mySkipEqual && myMap.contains( x ) ) //contains uses SUIT_DataOwnerPtr::operator==
return myMap[ x ];
iterator it = QValueList<SUIT_DataOwnerPtr>::append( x );
- if( mySkipEqual )
+ if ( mySkipEqual )
myMap.insert( x, it );
return it;
myMap.remove(x);
return QValueList<SUIT_DataOwnerPtr>::remove( x );
}
-
-/*!
- Operator < allows to order suit data owners for map
-*/
-bool operator<( const SUIT_DataOwnerPtr& p1, const SUIT_DataOwnerPtr& p2 )
-{
- return p1.get()<p2.get();
-}
virtual ~SUIT_DataOwner();//!< destructor
//! compare function
virtual bool isEqual( const SUIT_DataOwner& ) const = 0;
+ virtual bool isLess( const SUIT_DataOwner& ) const = 0;
};
/*! \typedef SUIT_DataOwnerPtr