Back to index

salome-gui  6.5.0
SUIT_DataObjectKey.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef SUIT_DATAOBJECTKEY_H
00024 #define SUIT_DATAOBJECTKEY_H
00025 
00026 #if _MSC_VER > 1000
00027 #pragma once
00028 #endif // _MSC_VER > 1000
00029 
00030 #include "SUIT.h"
00031 
00032 class SUIT_EXPORT SUIT_DataObjectKey
00033 {
00034 public:
00035   SUIT_DataObjectKey();
00036   virtual ~SUIT_DataObjectKey();
00037 
00038   virtual bool isLess( const SUIT_DataObjectKey* ) const = 0;
00039   virtual bool isEqual( const SUIT_DataObjectKey* ) const = 0;
00040 
00041 private:
00042   int     refCounter;
00043 
00044   friend class SUIT_DataObjectKeyHandle;
00045 };
00046 
00047 class SUIT_EXPORT SUIT_DataObjectKeyHandle
00048 {
00049 public:
00050   SUIT_DataObjectKeyHandle();
00051   SUIT_DataObjectKeyHandle( SUIT_DataObjectKey* );
00052   SUIT_DataObjectKeyHandle( const SUIT_DataObjectKeyHandle& );
00053   ~SUIT_DataObjectKeyHandle();
00054 
00055   void                      nullify();
00056   bool                      isNull() const;
00057   bool                      operator <( const SUIT_DataObjectKeyHandle& ) const;
00058   bool                      operator ==( const SUIT_DataObjectKeyHandle& ) const;
00059   SUIT_DataObjectKeyHandle& operator =( const SUIT_DataObjectKeyHandle& );
00060 
00061 private:
00062   void                      beginScope();
00063   void                      endScope();
00064 
00065 private:
00066   SUIT_DataObjectKey*       myKey;
00067 };
00068 
00069 #endif