Salome HOME
Copyrights update
[modules/gui.git] / src / LightApp / LightApp_DataOwner.cxx
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 #include "LightApp_DataOwner.h"
20
21 #include "LightApp_DataObject.h"
22
23 #ifndef WNT
24 #include <typeinfo>
25 #define _typeinfo std::type_info
26 #else
27 #include <typeinfo.h>
28 #define _typeinfo type_info
29 #endif
30
31 #include <iostream>
32
33 /*!Constructor. Initialize by \a theEntry.*/
34 LightApp_DataOwner
35 ::LightApp_DataOwner( const QString& theEntry ): 
36   myEntry( theEntry )
37 {
38 }
39
40 /*!Constructor. Initialize by \a SALOME_InteractiveObject.*/
41 LightApp_DataOwner
42 ::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ):
43   myEntry(!theIO.IsNull()? theIO->getEntry(): ""),
44   myIO(theIO)
45 {
46 }
47
48 /*!Destructor. Do nothing.*/
49 LightApp_DataOwner
50 ::~LightApp_DataOwner()
51 {
52 }
53
54 /*!Checks: Is current data owner equal \a obj.*/
55 bool
56 LightApp_DataOwner
57 ::isEqual( const SUIT_DataOwner& obj ) const
58 {
59   const LightApp_DataOwner* other = dynamic_cast<const LightApp_DataOwner*>( &obj );
60
61   return other && entry() == other->entry();
62 }
63
64 /*!Gets entry.*/
65 QString
66 LightApp_DataOwner
67 ::entry() const
68 {
69   return myEntry;
70 }
71
72 /*!Gets SALOME_InteractiveObject.*/
73 const Handle(SALOME_InteractiveObject)&
74 LightApp_DataOwner
75 ::IO() const
76 {
77   return myIO;
78 }