H:/gfcppsancout/product/include/gfcpp/Exception.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_EXCEPTION_H__
00002 #define __GEMFIRE_EXCEPTION_H__
00003 /*=========================================================================
00004  * (c) Copyright 2002-2007, GemStone Systems, Inc. All Rights Reserved.
00005  * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
00006  *========================================================================
00007  */
00008 
00013 #include "gfcpp_globals.hpp"
00014 #include "gf_types.hpp"
00015 #include <string.h>
00016 #include <string>
00017 
00018 namespace gemfire {
00019 
00020   #define GF_EX_MSG_LIMIT 1024
00021 
00026   class CPPCACHE_EXPORT Exception {
00027 
00031 public:
00032 
00039     Exception( const char * msg1, const char * msg2= NULL, bool forceTrace = false );
00040 
00045     Exception( const Exception& other );
00046 
00050     virtual ~Exception();
00051    
00056     virtual const char *  getMessage() const;
00060     virtual void showMessage() const;
00061 
00065     virtual void printStackTrace() const;
00066 
00067 #ifndef _SOLARIS
00068 
00071     virtual size_t getStackTrace( char* buffer, size_t maxLength ) const;
00072 #endif
00073 
00075     virtual const char* getName( ) const;
00076 
00077     static bool g_exceptionStackTraceEnabled;
00078 
00079 protected:
00080 
00081     private:
00082 
00083     char m_message[GF_EX_MSG_LIMIT]; //error messages
00084     StackTracePtr m_stack;
00085 
00086     Exception& operator=( const Exception& other );
00087 };
00088 };// namespace gemfire
00089 
00090 #endif //ifndef __GEMFIRE_EXCEPTION_H__

GemFire C++ Cache API Documentation