map_exception.h

Go to the documentation of this file.
00001 #ifndef MAP_EXCEPTION_HPP
00002 #define MAP_EXCEPTION_HPP
00003 /* ============================================================================
00004 'map_exception.h' defines the exceptions thrown by this library.
00005 
00006 Written by   Michael R. Greason, ADNET, 27 December 2006.
00007 Broken out of 'skymap.h'.  MRG, ADNET, 23 January 2007.
00008 ============================================================================ */
00009 /* ============================================================================
00010 The MapException class defines exceptions thrown by the skymap-related classes.
00011 ============================================================================ */
00012 class MapException
00013 {
00014         public:
00015 // The possible exception codes.
00016                 enum ErrCode {
00017                         None,                   // No error.
00018                         Memory,                 // Memory allocation error.
00019                         Bounds,                 // Array out of bounds error.
00020                         Undefined,              // Requested element undefined.
00021                         InvalidType,    // Invalid map type requested.
00022                         FITSError,              // A FITS I/O error.
00023                         Other                   // Other error.
00024                 };
00025         protected:
00026                 ErrCode code_;
00027                 int     status_;
00028                 char   *comment_;
00029     public:
00030                 MapException (ErrCode code, int status = 0, const char *comm = 0);
00031                 virtual ~MapException (void);
00032                 
00033                 virtual const char* Message (void) const;
00034                 virtual const char* Comment (void) const { return comment_; }
00035 };
00036 #endif

Generated on Fri Feb 6 15:32:42 2009 for Skyviewer by  doxygen 1.4.7