Debug Class Reference

#include <orsa_error.h>

Collaboration diagram for Debug:

Collaboration graph
[legend]
List of all members.

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 Debugobj ()

Protected Member Functions

 Debug ()
virtual void vtrace (const char *fmt, std::va_list list)

Protected Attributes

bool doTrace
bool doDefaultOutput

Static Protected Attributes

static Debugm_instance = 0

Constructor & Destructor Documentation

~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()


Member Function Documentation

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   }

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   }

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 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:

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 vtrace const char *  fmt,
std::va_list  list
[protected, virtual]
 

Definition at line 64 of file orsa_error.cc.

Referenced by Debug::trace().

00064                                                 {
00065     vfprintf(stderr, fmt, ap);
00066     fprintf(stderr, "\n");
00067   }


Member Data Documentation

bool doDefaultOutput [protected]
 

Definition at line 45 of file orsa_error.h.

Referenced by Debug::setDefaultOutput().

bool doTrace [protected]
 

Definition at line 44 of file orsa_error.h.

Referenced by Debug::set(), and Debug::trace().

Debug * m_instance = 0 [static, protected]
 

Definition at line 69 of file orsa_error.cc.

Referenced by Debug::construct(), Debug::obj(), and Debug::~Debug().


The documentation for this class was generated from the following files:
Generated on Tue Jan 11 15:28:11 2005 for liborsa by  doxygen 1.4.0