RoadError.cpp
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.cpp#2 $$Change: 2066 $
5 ** $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #
10 #
11 
12 #include "libqhullcpp/RoadError.h"
13 
14 #include <string>
15 #include <sstream>
16 #include <iostream>
17 
18 using std::cerr;
19 using std::cout;
20 using std::string;
21 
22 #ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4
23 #endif
24 
25 namespace orgQhull {
26 
27 #
28 
29 const char * RoadError::
32 ROADtag= "QH";
33 
34 std::ostringstream RoadError::
36 
37 #
38 
41 : error_code(0)
42 , log_event()
43 , error_message()
44 { }
45 
47 RoadError(const RoadError &other)
48 : error_code(other.error_code)
49 , log_event(other.log_event)
51 {
52 }//copy construct
53 
55 RoadError(int code, const std::string &message)
56 : error_code(code)
57 , log_event(message.c_str())
59 {
60  log_event.cstr_1= error_message.c_str(); // overwrites initial value
61 }
62 
64 RoadError(int code, const char *fmt)
65 : error_code(code)
66 , log_event(fmt)
67 , error_message()
68 { }
69 
71 RoadError(int code, const char *fmt, int d)
72 : error_code(code)
73 , log_event(fmt, d)
74 , error_message()
75 { }
76 
78 RoadError(int code, const char *fmt, int d, int d2)
79 : error_code(code)
80 , log_event(fmt, d, d2)
81 , error_message()
82 { }
83 
85 RoadError(int code, const char *fmt, int d, int d2, float f)
86 : error_code(code)
87 , log_event(fmt, d, d2, f)
88 , error_message()
89 { }
90 
92 RoadError(int code, const char *fmt, int d, int d2, float f, const char *s)
93 : error_code(code)
94 , log_event(fmt, d, d2, f, s)
95 , error_message(log_event.toString(ROADtag, code)) // char * may go out of scope
96 { }
97 
99 RoadError(int code, const char *fmt, int d, int d2, float f, const void *x)
100 : error_code(code)
101 , log_event(fmt, d, d2, f, x)
102 , error_message()
103 { }
104 
106 RoadError(int code, const char *fmt, int d, int d2, float f, int i)
107 : error_code(code)
108 , log_event(fmt, d, d2, f, i)
109 , error_message()
110 { }
111 
113 RoadError(int code, const char *fmt, int d, int d2, float f, long long i)
114 : error_code(code)
115 , log_event(fmt, d, d2, f, i)
116 , error_message()
117 { }
118 
120 RoadError(int code, const char *fmt, int d, int d2, float f, double e)
121 : error_code(code)
122 , log_event(fmt, d, d2, f, e)
123 , error_message()
124 { }
125 
127 operator=(const RoadError &other)
128 {
129  error_code= other.error_code;
131  log_event= other.log_event;
132  return *this;
133 }//operator=
134 
135 #
136 const char * RoadError::
137 what() const throw()
138 {
139  if(error_message.empty()){
141  }
142  return error_message.c_str();
143 }//what
144 
145 #
146 
147 void RoadError::
152 {
153  global_log << what() << endl;
154 }//logError
155 
156 
157 }//namespace orgQhull
158 
QhullRidge – Qhull&#39;s ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
const char * cstr_1
One additional argument (for logging)
Definition: RoadLogEvent.h:31
virtual const char * what() const
Definition: RoadError.cpp:137
RoadLogEvent log_event
Non-zero code (not logged), maybe returned as program status.
Definition: RoadError.h:37
std::string toString(const char *tag, int code) const
void logErrorLastResort() const
Definition: RoadError.cpp:151
static std::ostringstream global_log
Not reentrant – only used by RoadError::logErrorLastResort()
Definition: RoadError.h:42
static const char * ROADtag
Definition: RoadError.h:41
std::string error_message
Format string w/ arguments.
Definition: RoadError.h:38
fmt
Definition: obb.py:126
char * toString(const std::string &s)
Definition: RoadTest.h:94
RoadError & operator=(const RoadError &other)
Definition: RoadError.cpp:127


hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:02