#include <orsa_error.h>
Collaboration diagram for Debug:
Public Member Functions | |
virtual | ~Debug () |
virtual void | set (const char *msg, const char *file, const int line) |
void | trace (const char *fmt,...) |
Static Public Member Functions | |
static void | construct () |
static void | setDefaultOutput (bool) |
static Debug * | obj () |
Protected Member Functions | |
Debug () | |
virtual void | vtrace (const char *fmt, std::va_list list) |
Protected Attributes | |
bool | doTrace |
bool | doDefaultOutput |
Static Protected Attributes | |
static Debug * | m_instance = 0 |
Definition at line 32 of file orsa_error.h.
~Debug | ( | ) | [virtual] |
Definition at line 42 of file orsa_error.cc.
References Debug::m_instance.
00043 { 00044 m_instance = 0; 00045 }
Debug | ( | ) | [protected] |
Definition at line 38 of file orsa_error.cc.
00038 : 00039 doTrace(false), 00040 doDefaultOutput(false) 00041 { } Debug::~Debug()
void construct | ( | ) | [static] |
Definition at line 34 of file orsa_error.cc.
References Debug::m_instance.
00035 { 00036 if (!m_instance) m_instance = new Debug; 00037 }
void set | ( | const char * | msg, | |
const char * | file, | |||
const int | line | |||
) | [virtual] |
Definition at line 54 of file orsa_error.cc.
References Debug::doTrace.
00054 { 00055 fprintf(stderr, "ORSA[%s:%i] %s ", file, line, msg); 00056 doTrace = true; 00057 }
void trace | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 58 of file orsa_error.cc.
References Debug::doTrace, and Debug::vtrace().
00058 { 00059 va_list ap; 00060 va_start(ap, fmt); 00061 if (doTrace) vtrace(fmt, ap); 00062 doTrace = false; 00063 }
Here is the call graph for this function:
void setDefaultOutput | ( | bool | ) | [static] |
Definition at line 51 of file orsa_error.cc.
References Debug::doDefaultOutput, and Debug::obj().
00051 { 00052 obj()->doDefaultOutput = d; 00053 }
Here is the call graph for this function:
Debug * obj | ( | ) | [static] |
Definition at line 47 of file orsa_error.cc.
References Debug::m_instance.
Referenced by Debug::setDefaultOutput().
00047 { 00048 assert(m_instance != 0); 00049 return m_instance; 00050 }
virtual void vtrace | ( | const char * | fmt, | |
std::va_list | list | |||
) | [protected, virtual] |
Referenced by Debug::trace().
Debug * m_instance = 0 [static, protected] |
Definition at line 43 of file orsa_error.h.
Referenced by Debug::construct(), Debug::obj(), and Debug::~Debug().
bool doTrace [protected] |
bool doDefaultOutput [protected] |