00001 // ***************************************************************************** 00002 // ***************************************************************************** 00003 // oaCommonPlugInError.h 00004 // 00005 // This file contains the definition of the oaPlugInError class, which is used 00006 // to throw plugin-related exceptions. 00007 // 00008 // ***************************************************************************** 00009 // Except as specified in the OpenAccess terms of use of Cadence or Silicon 00010 // Integration Initiative, this material may not be copied, modified, 00011 // re-published, uploaded, executed, or distributed in any way, in any medium, 00012 // in whole or in part, without prior written permission from Cadence. 00013 // 00014 // Copyright 2002-2005 Cadence Design Systems, Inc. 00015 // All Rights Reserved. 00016 // 00017 // $Author: icftcm $ 00018 // $Revision: #1 $ 00019 // $Date: 2010/08/09 $ 00020 // $State: Exp $ 00021 // ***************************************************************************** 00022 // ***************************************************************************** 00023 00024 00025 00026 #if !defined(oaCommonError_P) 00027 #define oaCommonError_P 00028 00029 #ifdef NDEBUG 00030 #define oaCommonAssert(exp) ((void)0) 00031 #else 00032 #define oaCommonAssert(exp) \ 00033 {\ 00034 if (!(exp)) {\ 00035 throw oaPlugInError (IBase::cFail, #exp);\ 00036 }\ 00037 } 00038 #endif 00039 00040 00041 // ***************************************************************************** 00042 // Nested includes 00043 // ***************************************************************************** 00044 #include "oaCommonIBase.h" 00045 #include <string> 00046 00047 00048 00049 // ***************************************************************************** 00050 // Declare and define types in the oaCommon namespace 00051 // ***************************************************************************** 00052 BEGIN_OA_COMMON_NAMESPACE 00053 00054 00055 00056 // ***************************************************************************** 00057 // oaPlugInError 00058 // ***************************************************************************** 00059 class OA_COMMON_DLL_API oaPlugInError : public IPlugInException { 00060 public: 00061 oaPlugInError(IBase::Status statusIn, 00062 const char *msgIn = NULL); 00063 00064 virtual oa::oaUInt4 getStatus() const; 00065 virtual oa::oaUInt4 getMsgId() const; 00066 virtual const char *getMsg() const; 00067 00068 private: 00069 const char *getStandardMsg() const; 00070 00071 IBase::Status status; 00072 std::string msg; 00073 }; 00074 00075 00076 00077 END_OA_COMMON_NAMESPACE 00078 00079 #endif
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.