00001 // rdException.h 00002 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00003 // Copyright 2003 Realistic Dynamics, Inc. 00004 // All rights reserved. 00005 // 00006 // Please do not read, copy, distribute, or use without permission. 00007 // Contact: Frank C. Anderson, fca@RealisticDynamics.com 00008 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00009 #ifndef __rdException_h__ 00010 #define __rdException_h__ 00011 00012 00013 // INCLUDES 00014 #include "rdTools.h" 00015 00016 // DEFINES 00017 #define rdException_MESSAGE_LENGTH 512 00018 00019 //============================================================================= 00020 //============================================================================= 00027 class RDTOOLS_API rdException { 00028 00029 //============================================================================= 00030 // DATA 00031 //============================================================================= 00032 public: 00033 static const int MESSAGE_LENGTH; 00034 protected: 00036 char _msg[rdException_MESSAGE_LENGTH]; 00038 const char *_file; 00040 int _line; 00041 00042 //============================================================================= 00043 // METHODS 00044 //============================================================================= 00045 public: 00046 // CONSTRUCTORS 00047 rdException(const char *aMsg=NULL,const char *aFile=NULL,int aLine=-1); 00048 private: 00049 void setNull(); 00050 00051 public: 00052 // SET AND GET 00053 void setMessage(const char *aMsg); 00054 const char* getMessage(); 00055 00056 // PRINT 00057 void print(FILE *aFP); 00058 00059 //============================================================================= 00060 }; // END CLASS rdException 00061 //============================================================================= 00062 //============================================================================= 00063 00064 #endif // __rdException_h__
1.3