From 2e7dc00d7799308b34855a176a019cb81463f7d2 Mon Sep 17 00:00:00 2001 From: abd Date: Mon, 11 Sep 2006 11:21:45 +0000 Subject: [PATCH] Implementation of method IsLess() for subOwners --- src/LightApp/LightApp_DataSubOwner.cxx | 10 ++++++++++ src/LightApp/LightApp_DataSubOwner.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/LightApp/LightApp_DataSubOwner.cxx b/src/LightApp/LightApp_DataSubOwner.cxx index aaf1d3613..80c7d13a3 100644 --- a/src/LightApp/LightApp_DataSubOwner.cxx +++ b/src/LightApp/LightApp_DataSubOwner.cxx @@ -46,6 +46,16 @@ bool LightApp_DataSubOwner::isEqual( const SUIT_DataOwner& obj ) const return false; } +/*!Checks: Is current data sub owner less \a obj.*/ +bool LightApp_DataSubOwner::isLess( const SUIT_DataOwner& obj ) const +{ + const LightApp_DataSubOwner* other = dynamic_cast( &obj ); + if(other && entry() == other->entry()){ + return index() < other->index(); + } + return other && entry() < other->entry(); +} + /*!Gets index.*/ int LightApp_DataSubOwner::index() const { diff --git a/src/LightApp/LightApp_DataSubOwner.h b/src/LightApp/LightApp_DataSubOwner.h index 0bd219c42..9b21d18a8 100644 --- a/src/LightApp/LightApp_DataSubOwner.h +++ b/src/LightApp/LightApp_DataSubOwner.h @@ -33,6 +33,7 @@ public: virtual ~LightApp_DataSubOwner(); virtual bool isEqual( const SUIT_DataOwner& ) const; + virtual bool isLess( const SUIT_DataOwner& obj ) const; int index() const; private: -- 2.39.2