Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

vpr::DebugOutputGuard Struct Reference

Helper class that outputs debug information at creation and destruction of the object. More...

#include <Debug.h>

Collaboration diagram for vpr::DebugOutputGuard:

Collaboration graph
[legend]
List of all members.

Public Methods

 DebugOutputGuard (const vpr::DebugCategory &cat, const int level, std::string entryText, std::string exitText=std::string(""), bool indent=true)
 ~DebugOutputGuard ()

Public Attributes

const vpr::DebugCategorymCat
int mLevel
std::string mEntryText
std::string mExitText
bool mIndent

Detailed Description

Helper class that outputs debug information at creation and destruction of the object.

Definition at line 363 of file Debug.h.


Constructor & Destructor Documentation

vpr::DebugOutputGuard::DebugOutputGuard const vpr::DebugCategory   cat,
const int    level,
std::string    entryText,
std::string    exitText = std::string(""),
bool    indent = true
 

Definition at line 475 of file Debug.cpp.

References mCat, mEntryText, mLevel, vprDEBUG, vprDEBUG_BEGIN, and vprDEBUG_FLUSH.

00478    : mCat(cat), mLevel(level), mEntryText(entryText), mExitText(exitText),
00479      mIndent(indent)
00480 {
00481    if(mIndent)
00482    {
00483       vprDEBUG_BEGIN(mCat, mLevel) << mEntryText << vprDEBUG_FLUSH;
00484    }
00485    else
00486    {
00487       vprDEBUG(mCat, mLevel) << mEntryText << vprDEBUG_FLUSH;
00488    }
00489 }

vpr::DebugOutputGuard::~DebugOutputGuard  
 

Definition at line 491 of file Debug.cpp.

References mCat, mExitText, mLevel, vprDEBUG, vprDEBUG_DECREMENT_INDENT, vprDEBUG_END, and vprDEBUG_FLUSH.

00492 {
00493    if(mIndent)
00494    {
00495       // Don't bother printing anything if mExitText is an empty string.
00496       if(mExitText == std::string(""))
00497       {
00498          vprDEBUG_DECREMENT_INDENT(mCat, mLevel);
00499       }
00500       else
00501       {     
00502          vprDEBUG_END(mCat, mLevel) << mExitText << vprDEBUG_FLUSH;
00503       }
00504    }
00505    else
00506    {
00507       // Don't bother printing anything if mExitText is an empty string.
00508       if(mExitText != std::string(""))
00509       {
00510          vprDEBUG(mCat, mLevel) << mExitText << vprDEBUG_FLUSH;
00511       }
00512    }
00513 }


Member Data Documentation

const vpr::DebugCategory& vpr::DebugOutputGuard::mCat
 

Definition at line 372 of file Debug.h.

Referenced by DebugOutputGuard, and ~DebugOutputGuard.

int vpr::DebugOutputGuard::mLevel
 

Definition at line 373 of file Debug.h.

Referenced by DebugOutputGuard, and ~DebugOutputGuard.

std::string vpr::DebugOutputGuard::mEntryText
 

Definition at line 374 of file Debug.h.

Referenced by DebugOutputGuard.

std::string vpr::DebugOutputGuard::mExitText
 

Definition at line 375 of file Debug.h.

Referenced by ~DebugOutputGuard.

bool vpr::DebugOutputGuard::mIndent
 

Definition at line 376 of file Debug.h.


The documentation for this struct was generated from the following files:
Generated on Sun May 2 14:47:15 2004 for VR Juggler Portable Runtime by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002