PCMException.cpp

Go to the documentation of this file.
00001 
00002 //
00003 // This source file is a part of ParCompMark
00004 // Parallel Compositing Benchmark Framework
00005 //
00006 // for latest info see http://parcompmark.sourceforge.net
00007 
00008 //
00009 // Copyright (C) 2006 IT2 ParCompMark Dev. Team
00010 // 
00011 // This program is free software; you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public License
00013 // as published by the Free Software Foundation; either version 2
00014 // of the License, or (at your option) any later version.
00015 // 
00016 // This program is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 // GNU General Public License for more details.
00020 // 
00021 // You should have received a copy of the GNU General Public License
00022 // along with this program; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00024 
00025 //
00026 // Inner includes
00027 //
00028 
00029 #include "../include/PCMException.h"
00030 
00031 namespace ParCompMark
00032 {
00033 
00034   //
00035   // Class variables
00036   //
00037 
00038   Exception *Exception::mLastException = 0;
00039 
00040   //
00041   // Class methods
00042   //
00043 
00044    std::string Exception::translateType(const Exception::ExceptionType & type)
00045   {
00046 
00047         switch (type)
00048         {
00049          case INTERNAL_ERROR:
00050                 return std::string("Unknown internal error");
00051                 break;
00052                 case NULL_POINTER_ERROR:return std::string("Nullpointer error");
00053                 break;
00054                 case INVALID_NAME_ERROR:return std::string("Invalid name error");
00055                 break;
00056                 case INVALID_ENUM_ERROR:return std::string("Invalid enumerated value error");
00057                 break;
00058                 case INVALID_VALUE_ERROR:return std::string("Invalid value error");
00059                 break;
00060                 case INVALID_OBJECT_ERROR:return std::string("Invalid object error");
00061                 break;
00062                 case INVALID_CLASS_ERROR:return std::string("Invalid class error (not proper derived class)");
00063                 break;
00064                 case INVALID_OPERATION_ERROR:return std::string("Invalid operation error");
00065                 break;
00066                 case OPERATION_NOT_SUPPORTED_ERROR:return std::string("Operation is not supported on this platform");
00067                 break;
00068                 case OUT_OF_MEMORY_ERROR:return std::string("Out of memory error");
00069                 break;
00070                 case FILE_IO_ERROR:return std::string("File I/O error");
00071                 break;
00072                 case FILE_FORMAT_ERROR:return std::string("Invalid file format error");
00073                 break;
00074                 case USER_BREAK_ERROR:return std::string("The user stopped the application");
00075                 break;
00076                 case SCRIPT_ERROR:return std::string("Error in a script file.");
00077                 break;
00078                 case XLIB_ERROR:return std::string("Xlib error.");
00079                 break;
00080         }
00081 
00082         return std::string("Unknown exception");
00083 
00084   }
00085 
00086  /*----------------------------------------------------------------------*/
00087 
00088 }