Blender V4.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
24namespace KDL {
25
26// Trace of the call stack of the I/O routines to help user
27// interprete error messages from I/O
28typedef std::stack<std::string> ErrorStack;
29
31// should be in Thread Local Storage if this gets multithreaded one day...
32
33
34void IOTrace(const std::string& description) {
35 errorstack.push(description);
36}
37
38
39void IOTracePop() {
40 errorstack.pop();
41}
42
43void IOTraceOutput(std::ostream& os) {
44 while (!errorstack.empty()) {
45 os << errorstack.top().c_str() << std::endl;
46 errorstack.pop();
47 }
48}
49
50
51void 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}
Definition chain.cpp:27
std::stack< std::string > ErrorStack
ErrorStack errorstack
void IOTracePopStr(char *buffer, int size)
void IOTraceOutput(std::ostream &os)
outputs the IO-stack to a stream to provide a better errormessage.
void IOTracePop()
pops a description of the IO-stack
void IOTrace(const std::string &description)