Back to index

salome-kernel  6.5.0
CalciumException.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  File   : CalciumException.hxx
00021 //  Author : Eric Fayolle (EDF)
00022 //  Module : KERNEL
00023 // Modified by : $LastChangedBy$
00024 // Date        : $LastChangedDate: 2007-02-06 17:20:28 +0100 (mar, 06 fév 2007) $
00025 // Id          : $Id: CalciumException.hxx,v 1.3.2.1.10.3.12.1 2012-04-12 14:05:06 vsr Exp $
00026 //
00027 #ifndef CALCIUM_EXCEPTION_HXX
00028 #define CALCIUM_EXCEPTION_HXX
00029 
00030 #if defined(__CONST_H) || defined(__CALCIUM_H)
00031 #error "The header CalciumException.hxx must be included before calcium.h"
00032 #endif
00033 
00034 #include "DSC_Exception.hxx"
00035 #include "CalciumTypes.hxx"
00036 #include <string>
00037 
00038 struct CalciumException  : public DSC_Exception {
00039 
00040   CalciumException( const CalciumTypes::InfoType info,
00041                     const std::string &     text, 
00042                     const char        *fileName, 
00043                     const unsigned int lineNumber,
00044                     const char        *funcName):
00045     DSC_Exception(text,fileName,lineNumber,funcName),
00046     _info(info),_exceptionName("CalciumException")
00047   {};
00048 
00049 
00050   CalciumException( const CalciumTypes::InfoType info,
00051                        const std::string & text ):
00052     DSC_Exception(text),_info(info),_exceptionName("CalciumException")
00053   {};
00054 
00055   CalciumException(CalciumTypes::InfoType info, const DSC_Exception & ex ):
00056     DSC_Exception(ex),_info(info),_exceptionName("CalciumException") 
00057   {};
00058  
00059   virtual ~CalciumException() throw() {};
00060   CalciumTypes::InfoType getInfo() const { return _info;}
00061   void setInfo(CalciumTypes::InfoType info) {_info=info;}
00062   virtual const std::string & getExceptionName() const {return _exceptionName;};
00063 
00064 protected:
00065   CalciumTypes::InfoType _info;
00066   std::string   _exceptionName;
00067 };
00068 
00069 
00070 #endif /* CALCIUM_EXCEPTION_HXX */