Blender  V3.3
error_stack.cpp
Go to the documentation of this file.
1 
4 /*****************************************************************************
5  * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
6  *
7  * \version
8  * ORO_Geometry V0.2
9  *
10  * \par History
11  * - $log$
12  *
13  * \par Release
14  * $Name: $
15  ****************************************************************************/
16 
17 
18 #include "error_stack.h"
19 #include <stack>
20 #include <vector>
21 #include <string>
22 #include <cstring>
23 
24 namespace KDL {
25 
26 // Trace of the call stack of the I/O routines to help user
27 // interprete error messages from I/O
28 typedef std::stack<std::string> ErrorStack;
29 
31 // should be in Thread Local Storage if this gets multithreaded one day...
32 
33 
34 void IOTrace(const std::string& description) {
35  errorstack.push(description);
36 }
37 
38 
39 void IOTracePop() {
40  errorstack.pop();
41 }
42 
43 void IOTraceOutput(std::ostream& os) {
44  while (!errorstack.empty()) {
45  os << errorstack.top().c_str() << std::endl;
46  errorstack.pop();
47  }
48 }
49 
50 
51 void IOTracePopStr(char* buffer,int size) {
52  if (errorstack.empty()) {
53  *buffer = 0;
54  return;
55  }
56  strncpy(buffer,errorstack.top().c_str(),size);
57  errorstack.pop();
58 }
59 
60 }
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
ccl_global float * buffer
Definition: chain.cpp:27
std::stack< std::string > ErrorStack
Definition: error_stack.cpp:28
ErrorStack errorstack
Definition: error_stack.cpp:30
void IOTracePopStr(char *buffer, int size)
Definition: error_stack.cpp:51
void IOTraceOutput(std::ostream &os)
outputs the IO-stack to a stream to provide a better errormessage.
Definition: error_stack.cpp:43
void IOTracePop()
pops a description of the IO-stack
Definition: error_stack.cpp:39
void IOTrace(const std::string &description)
Definition: error_stack.cpp:34