]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Comparing method isLess() was added.
authorstv <stv@opencascade.com>
Tue, 29 Aug 2006 11:45:02 +0000 (11:45 +0000)
committerstv <stv@opencascade.com>
Tue, 29 Aug 2006 11:45:02 +0000 (11:45 +0000)
src/LightApp/LightApp_DataOwner.cxx
src/LightApp/LightApp_DataOwner.h

index dea72f88c94120a8c6813d8c640264d45f8ab860..979140ad7ee78a26f323d9efaef3a94d35f91554 100644 (file)
 #include <iostream>
 
 /*!Constructor. Initialize by \a theEntry.*/
-LightApp_DataOwner
-::LightApp_DataOwner( const QString& theEntry ): 
-  myEntry( theEntry )
+LightApp_DataOwner::LightApp_DataOwner( const QString& theEntry )
+: myEntry( theEntry )
+{
+}
+
+LightApp_DataOwner::LightApp_DataOwner( const LightApp_DataObject* obj )
+: myEntry( obj ? obj->entry() : QString::null )
 {
 }
 
 #ifndef DISABLE_SALOMEOBJECT
 /*!Constructor. Initialize by \a SALOME_InteractiveObject.*/
-LightApp_DataOwner
-::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ):
-  myEntry(!theIO.IsNull()? theIO->getEntry(): ""),
-  myIO(theIO)
+LightApp_DataOwner::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO )
+: myEntry( !theIO.IsNull() ? theIO->getEntry() : "" ),
+myIO( theIO )
 {
 }
 #endif
 
 /*!Destructor. Do nothing.*/
-LightApp_DataOwner
-::~LightApp_DataOwner()
+LightApp_DataOwner::~LightApp_DataOwner()
 {
 }
 
 /*!Checks: Is current data owner equal \a obj.*/
-bool
-LightApp_DataOwner
-::isEqual( const SUIT_DataOwner& obj ) const
+bool LightApp_DataOwner::isEqual( const SUIT_DataOwner& obj ) const
 {
   const LightApp_DataOwner* other = dynamic_cast<const LightApp_DataOwner*>( &obj );
-
   return other && entry() == other->entry();
 }
 
-bool LightApp_DataOwner::operator<( const SUIT_DataOwner& obj ) const
+bool LightApp_DataOwner::isLess( const SUIT_DataOwner& obj ) const
 {
   const LightApp_DataOwner* other = dynamic_cast<const LightApp_DataOwner*>( &obj );
-  return entry() < other->entry();
+  return other && entry() < other->entry();
 }
 
 /*!Gets entry.*/
index 7fd43eedceb14560da1c81f0194f6efd13f5ef07..f2e9a848b62cfc73d575d0e4937bd90c08de7bb7 100644 (file)
 #define LIGHTAPP_DATAOWNER_H
 
 #include "LightApp.h"
-#include "SUIT_DataOwner.h"
+#include <SUIT_DataOwner.h>
 
 #ifndef DISABLE_SALOMEOBJECT
   #include "SALOME_InteractiveObject.hxx"
 #endif
 
+class LightApp_DataObject;
+
 /*!
   This class provide data owner objects.
 */
@@ -36,11 +38,12 @@ public:
 #ifndef DISABLE_SALOMEOBJECT
     LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO );
 #endif
+    LightApp_DataOwner( const LightApp_DataObject* );
     LightApp_DataOwner( const QString& );
     virtual ~LightApp_DataOwner();
 
     virtual bool isEqual( const SUIT_DataOwner& ) const;
-    virtual bool operator<( const SUIT_DataOwner& ) const;
+    virtual bool isLess( const SUIT_DataOwner& ) const;
 
 #ifndef DISABLE_SALOMEOBJECT
     const Handle(SALOME_InteractiveObject)& IO() const;