| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeErrorLog.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright  2001-2004 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00026 #ifndef  __TERRALIB_INTERNAL_ERRORLOG_H
    00027 #define  __TERRALIB_INTERNAL_ERRORLOG_H
    00028
    00029 #include "TeSingleton.h"
    00030
    00031 #include <string>
    00032 #include <stack>
    00033 #include <map>
    00034 using namespace std;
    00035
    00036 class TeAsciiFile;
    00037
    00038 enum TeErrorType
    00039 {
    00040
    00041            // Generic message inserted to log file
    00042            LOG_MESSAGE,
    00043
    00044            // Errors associated to files
    00045            EMPTY_FILE_NAME,
    00046            CANNOT_OPEN_FILE,
    00047     CANNOT_READ_FILE,
    00048     CANNOT_WRITE_FILE,
    00049     CANNOT_CLOSE_FILE,
    00050     END_OF_FILE_REACHED,
    00051
    00052            // Errors associated with projection
    00053     DATUM_ERROR,
    00054     PROJECTION_NOT_AVAILABLE,
    00055
    00056 // Error codes for MIF files
    00057     NOT_MIF_FILE,
    00058     MIF_REGION_CLOSE,
    00059     MIF_CONVERSION_ERROR,
    00060     NOT_CSV,
    00061     NOT_ENOUGH_ROWS,
    00062     NOT_POLYGON_FILE,
    00063     PLINE_ERROR,
    00064     NO_DTM_QUOTE_VALUE,
    00065
    00066 // Error Codes for shapefiles
    00067     POLYSHAPE_IS_NOT_RING,
    00068     UNHANDLED_SHP_TYPE,
    00069
    00070 // Error Codes for DBF files
    00071
    00072     UNABLE_TO_OPEN_DBF_FILE,
    00073     NO_DATA_IN_DBF_FILE,
    00074     ATTRIBUTE_INDEX_MISMATCH,
    00075
    00076            // Error codes for E00 Files
    00077     NOT_E00_FILE,
    00078
    00079            // Error codes for algorithms
    00080     CENTROID_NOT_FOUND,
    00081     REGIONS_WITH_HOLES,
    00082     LINE_IS_NOT_RING,
    00083
    00084            // Error codes for tables
    00085
    00086     ROW_MISMATCH,
    00087     NO_SUCH_ATTRIBUTE,
    00088
    00089            // Error codes for Raster stuff
    00090     UNKNOWN_DECODER_TECHNOLOGY_TYPE,
    00091     UNKNOWN_RASTER_FORMAT,
    00092
    00093            // Layer stuff
    00094            GEOMETRY_REPRESENTATION_MISMATCH,
    00095
    00096   // TeFactory related errors
    00097   FACTORY_PRODUCT_INSTATIATION_ERROR,
    00098
    00099            // Other
    00100            UNKNOWN_ERROR_TYPE
    00101 };
    00102
    00103 typedef map<TeErrorType, string> TeErrorTypeMap;
    00104
    00105 typedef map<TeErrorType, int> TeErrorLogMap;
    00106
    00108
    00116 class TL_DLL TeErrorLog: public TeSingleton<TeErrorLog>
    00117 {
    00118 public:
    00119            TeErrorLog();
    00120
    00121            ~TeErrorLog();
    00122
    00123            string message(const TeErrorType code);
    00124
    00125            virtual void insert ( TeErrorType code, const string& msg = "" );
    00126
    00127            virtual void startSession ( const string& errLogFileName = "terralib.err");
    00128
    00129            virtual int endSession ();
    00130
    00131 private:
    00132
    00133     TeAsciiFile* logFile_;
    00134
    00135            TeErrorLogMap errorLog_;
    00136
    00137            TeErrorTypeMap  errorMessage_;
    00138 };
    00139
    00140 #endif
    00141
    00142

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines