Salome HOME
Parent object parameter added to constructor.
[modules/gui.git] / src / SUIT / SUIT_DataObjectKey.h
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 #ifndef SUIT_DATAOBJECTKEY_H
20 #define SUIT_DATAOBJECTKEY_H
21
22 #if _MSC_VER > 1000
23 #pragma once
24 #endif // _MSC_VER > 1000
25
26 #include "SUIT.h"
27
28 class SUIT_EXPORT SUIT_DataObjectKey
29 {
30 public:
31   SUIT_DataObjectKey();
32   ~SUIT_DataObjectKey();
33
34   virtual bool isLess( const SUIT_DataObjectKey* ) const = 0;
35   virtual bool isEqual( const SUIT_DataObjectKey* ) const = 0;
36
37 private:
38   int     refCounter;
39
40   friend class SUIT_DataObjectKeyHandle;
41 };
42
43 class SUIT_EXPORT SUIT_DataObjectKeyHandle
44 {
45 public:
46   SUIT_DataObjectKeyHandle();
47   SUIT_DataObjectKeyHandle( SUIT_DataObjectKey* );
48   SUIT_DataObjectKeyHandle( const SUIT_DataObjectKeyHandle& );
49   ~SUIT_DataObjectKeyHandle();
50
51   void                      nullify();
52   bool                      isNull() const;
53   bool                      operator <( const SUIT_DataObjectKeyHandle& ) const;
54   bool                      operator ==( const SUIT_DataObjectKeyHandle& ) const;
55   SUIT_DataObjectKeyHandle& operator =( const SUIT_DataObjectKeyHandle& );
56
57 private:
58   void                      beginScope();
59   void                      endScope();
60
61 private:
62   SUIT_DataObjectKey*       myKey;
63 };
64
65 #endif