RoadError.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (c) 2008-2015 C.B. Barber. All rights reserved.
4 ** $Id: //main/2015/qhull/src/libqhullcpp/RoadError.h#3 $$Change: 2066 $
5 ** $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #ifndef ROADERROR_H
10 #define ROADERROR_H
11 
12 extern "C" {
13  #include "libqhull_r/user_r.h" /* for QHULL_CRTDBG */
14 }
16 
17 #include <iostream>
18 #include <sstream>
19 #include <stdexcept>
20 #include <string>
21 
22 using std::endl;
23 
24 namespace orgQhull {
25 
26 #
27  class RoadError;
31 
32 class RoadError : public std::exception {
33 
34 private:
35 #
36  int error_code;
37  RoadLogEvent log_event;
38  mutable std::string error_message;
39 
40 #
41  static const char * ROADtag;
42  static std::ostringstream global_log;
43 
45 public:
46 #
47 
48 #
49  RoadError();
50  RoadError(const RoadError &other);
51  RoadError(int code, const std::string &message);
52  RoadError(int code, const char *fmt);
53  RoadError(int code, const char *fmt, int d);
54  RoadError(int code, const char *fmt, int d, int d2);
55  RoadError(int code, const char *fmt, int d, int d2, float f);
56  RoadError(int code, const char *fmt, int d, int d2, float f, const char *s);
57  RoadError(int code, const char *fmt, int d, int d2, float f, const void *x);
58  RoadError(int code, const char *fmt, int d, int d2, float f, int i);
59  RoadError(int code, const char *fmt, int d, int d2, float f, long long i);
60  RoadError(int code, const char *fmt, int d, int d2, float f, double e);
61 
62  RoadError & operator=(const RoadError &other);
63  ~RoadError() throw() {};
64 
65 #
66 
67  static void clearGlobalLog() { global_log.seekp(0); }
68  static bool emptyGlobalLog() { return global_log.tellp()<=0; }
69  static const char *stringGlobalLog() { return global_log.str().c_str(); }
70 
71 #
72  virtual const char *what() const throw();
73 
74 #
75  bool isValid() const { return log_event.isValid(); }
76  int errorCode() const { return error_code; };
77  // FIXUP QH11021 should RoadError provide errorMessage(). Currently what()
78  RoadLogEvent roadLogEvent() const { return log_event; };
79 
80 #
81  void logErrorLastResort() const;
82 };//class RoadError
83 
84 }//namespace orgQhull
85 
86 #
87 
88 inline std::ostream & operator<<(std::ostream &os, const orgQhull::RoadError &e) { return os << e.what(); }
89 
90 #endif // ROADERROR_H
orgQhull::RoadError::what
virtual const char * what() const
Definition: RoadError.cpp:137
orgQhull::RoadError::clearGlobalLog
static void clearGlobalLog()
Definition: RoadError.h:67
obb.fmt
fmt
Definition: obb.py:145
orgQhull
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
orgQhull::RoadError
Definition: RoadError.h:32
orgQhull::RoadLogEvent
Definition: RoadLogEvent.h:28
orgQhull::RoadError::global_log
static std::ostringstream global_log
Not reentrant – only used by RoadError::logErrorLastResort()
Definition: RoadError.h:42
orgQhull::RoadError::RoadError
RoadError()
Definition: RoadError.cpp:40
operator<<
std::ostream & operator<<(std::ostream &os, const orgQhull::RoadError &e)
Definition: RoadError.h:88
orgQhull::RoadError::log_event
RoadLogEvent log_event
Non-zero code (not logged), maybe returned as program status.
Definition: RoadError.h:37
orgQhull::RoadError::operator=
RoadError & operator=(const RoadError &other)
Definition: RoadError.cpp:127
orgQhull::RoadError::~RoadError
~RoadError()
Definition: RoadError.h:63
user_r.h
RoadLogEvent.h
orgQhull::RoadError::emptyGlobalLog
static bool emptyGlobalLog()
Definition: RoadError.h:68
orgQhull::RoadError::errorCode
int errorCode() const
Definition: RoadError.h:76
orgQhull::RoadError::stringGlobalLog
static const char * stringGlobalLog()
Definition: RoadError.h:69
orgQhull::RoadError::roadLogEvent
RoadLogEvent roadLogEvent() const
Definition: RoadError.h:78
orgQhull::RoadError::error_code
int error_code
Definition: RoadError.h:36


hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:15