File indexing completed on 2024-11-15 09:44:16
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ROADERROR_H
0010 #define ROADERROR_H
0011
0012 #include "libqhull_r/user_r.h" /* for QHULL_CRTDBG */
0013 #include "libqhullcpp/RoadLogEvent.h"
0014
0015 #include <iostream>
0016 #include <sstream>
0017 #include <stdexcept>
0018 #include <string>
0019
0020 using std::endl;
0021
0022 namespace orgQhull {
0023
0024 #
0025
0026
0027
0028 class RoadError;
0029
0030 class RoadError : public std::exception {
0031
0032 private:
0033 #
0034 int error_code;
0035 RoadLogEvent log_event;
0036 mutable std::string error_message;
0037
0038 #
0039 static const char * ROADtag;
0040 static std::ostringstream global_log;
0041
0042
0043 public:
0044 #
0045
0046 #
0047 RoadError();
0048 RoadError(const RoadError &other);
0049 RoadError(int code, const std::string &message);
0050 RoadError(int code, const char *fmt);
0051 RoadError(int code, const char *fmt, int d);
0052 RoadError(int code, const char *fmt, int d, int d2);
0053 RoadError(int code, const char *fmt, int d, int d2, float f);
0054 RoadError(int code, const char *fmt, int d, int d2, float f, const char *s);
0055 RoadError(int code, const char *fmt, int d, int d2, float f, const void *x);
0056 RoadError(int code, const char *fmt, int d, int d2, float f, int i);
0057 RoadError(int code, const char *fmt, int d, int d2, float f, long long i);
0058 RoadError(int code, const char *fmt, int d, int d2, float f, double e);
0059
0060 RoadError & operator=(const RoadError &other);
0061 ~RoadError() throw() {}
0062
0063 #
0064
0065 static void clearGlobalLog() { global_log.seekp(0); }
0066 static bool emptyGlobalLog() { return global_log.tellp()<=0; }
0067 static std::string stringGlobalLog() { return global_log.str(); }
0068
0069 #
0070 virtual const char *what() const throw();
0071
0072 #
0073 bool isValid() const { return log_event.isValid(); }
0074 int errorCode() const { return error_code; }
0075
0076 RoadLogEvent roadLogEvent() const { return log_event; }
0077
0078 #
0079 void logErrorLastResort() const;
0080 };
0081
0082 }
0083
0084 #
0085
0086 inline std::ostream & operator<<(std::ostream &os, const orgQhull::RoadError &e) { return os << e.what(); }
0087
0088 #endif