lgrExceptions.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 
00008 
00009 #ifndef lgrExceptions_H_
00010 #define lgrExceptions_H_
00011 
00012 #include "lgrUtil.h"
00013 
00014 #include <vlutil/vlFilename.h>
00015 #include <vlutil/vlExceptions.h>
00016 
00017 #define typedefLoggerException(Name,Value) \
00018    const int Name##Number = (Value);\
00019    typedef DtTemplatedException<Name##Number> Name;
00020 
00021 namespace MAKLogger
00022 {
00023 
00024    const int LoggerExceptionBase = 40000;
00025 
00026    const int ThreadExceptionBase = LoggerExceptionBase + 0;
00027    typedefLoggerException(DtThreadAlreadyRunning,(ThreadExceptionBase + 1))
00028    typedefLoggerException(DtThreadNotStarted,    (ThreadExceptionBase + 2))
00029    typedefLoggerException(DtThreadCreationError, (ThreadExceptionBase + 3))
00030    typedefLoggerException(DtThreadWouldDeadlock, (ThreadExceptionBase + 4))
00031 
00032    const int LoggerConfigExceptionBase = LoggerExceptionBase + 10;
00033    typedefLoggerException(DtInvalidConfigurationFile,(LoggerConfigExceptionBase + 1))
00034 
00035    const int CommandExceptionBase = LoggerExceptionBase + 20;
00036    typedefLoggerException(DtInvalidLgrCommand,   (CommandExceptionBase + 1 ))
00037    typedefLoggerException(DtUnhandledLgrCommand, (CommandExceptionBase + 2 ))
00038    typedefLoggerException(DtCorruptLgrCommand,   (CommandExceptionBase + 3 ))
00039 
00040    const int SystemExceptionBase = LoggerExceptionBase + 30;
00041    typedefLoggerException(DtDriverNotAvailable, (SystemExceptionBase + 1))
00042 
00043    const int EditExceptionBase = LoggerExceptionBase + 40;
00044    typedefLoggerException(DtInvalidLoggerState, (EditExceptionBase + 1))
00045 
00046    const int PluginExceptionBase = LoggerExceptionBase + 50;
00047    typedefLoggerException(DtAbstractInterfaceUndefined,(PluginExceptionBase + 1))
00048    typedefLoggerException(DtLibraryDoesNotExist,       (PluginExceptionBase + 2))
00049    typedefLoggerException(DtLibraryFileIsInvalid,      (PluginExceptionBase + 3))
00050 
00051    const int FileExceptionBase = LoggerExceptionBase + 70;
00052    typedefLoggerException(DtInvalidLoggerFile,  (FileExceptionBase + 1))
00053    typedefLoggerException(DtFileOpenError,      (FileExceptionBase + 2))
00054    typedefLoggerException(DtFileReadError,      (FileExceptionBase + 3))
00055    typedefLoggerException(DtFileWriteError,     (FileExceptionBase + 4))
00056    typedefLoggerException(DtUnknownFileVersion, (FileExceptionBase + 5))
00057    typedefLoggerException(DtUnableToDeleteFile, (FileExceptionBase + 6))
00058    typedefLoggerException(DtUnableToMoveFile,   (FileExceptionBase + 7))
00059    typedefLoggerException(DtUnableToCopyFile,   (FileExceptionBase + 8))
00060    typedefLoggerException(DtInvalidPacketType,  (FileExceptionBase + 8))
00061 
00062    const int DataExceptionBase = LoggerExceptionBase + 85;
00063    typedefLoggerException(DtSerializeError,   (LoggerExceptionBase + 1))
00064    typedefLoggerException(DtUnserializeError, (LoggerExceptionBase + 2))
00065 
00066    const int HLAExceptionBase = LoggerExceptionBase + 100;
00067    typedefLoggerException(DtInvalidPacketOperation,  (HLAExceptionBase + 1))
00068    typedefLoggerException(DtNotHLAProtocol,          (HLAExceptionBase + 2))
00069    typedefLoggerException(DtInvalidFom,              (HLAExceptionBase + 3))
00070    typedefLoggerException(DtInvalidExconn,           (HLAExceptionBase + 4))
00071    typedefLoggerException(DtUnableToCreatePublisher, (HLAExceptionBase + 5))
00072    typedefLoggerException(DtInvalidHandle,           (HLAExceptionBase + 6))
00073 
00074 
00075    const int GUIExceptionBase = LoggerExceptionBase + 120;
00076    typedefLoggerException(DtIncorrectGuiType, (GUIExceptionBase + 1))
00077 
00079    DT_DLL_LGRUTIL DtString DtSerializeException(const DtException& exception, bool fullTrace = false);
00080 
00083    DT_DLL_LGRUTIL void DtSerializeException(DtString& output,const DtException&, bool fullTrace);
00084 
00085 }
00086 
00087 #define DtLgrTHROW(exceptionClass,errorMsg) \
00088 {\
00089    DtFilename tempLocalFile(__FILE__);\
00090    tempLocalFile.stripPath();\
00091    DtString msg = DtString(#exceptionClass": ") + errorMsg;\
00092    throw exceptionClass(msg.c_str(), __DtFUNC__,tempLocalFile.c_str(), __LINE__, 0);\
00093 }
00094 
00095 #define DtCATCH_AND_IGNORE catch(...){}
00096 
00097 
00098 #endif

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)