vpr::DebugOutputGuard Class Reference

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

#include <vpr/Util/Debug.h>

Collaboration diagram for vpr::DebugOutputGuard:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 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 428 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 551 of file Debug.cpp.

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

00554    : mCat(cat)
00555    , mLevel(level)
00556    , mEntryText(entryText)
00557    , mExitText(exitText)
00558    , mIndent(indent)
00559 {
00560    if(mIndent)
00561    {
00562       vprDEBUG_BEGIN(mCat, mLevel) << mEntryText << vprDEBUG_FLUSH;
00563    }
00564    else
00565    {
00566       vprDEBUG(mCat, mLevel) << mEntryText << vprDEBUG_FLUSH;
00567    }
00568 }

vpr::DebugOutputGuard::~DebugOutputGuard (  ) 

Definition at line 570 of file Debug.cpp.

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

00571 {
00572    if(mIndent)
00573    {
00574       // Don't bother printing anything if mExitText is an empty string.
00575       if(mExitText == std::string(""))
00576       {
00577          vprDEBUG_DECREMENT_INDENT(mCat, mLevel);
00578       }
00579       else
00580       {
00581          vprDEBUG_END(mCat, mLevel) << mExitText << vprDEBUG_FLUSH;
00582       }
00583    }
00584    else
00585    {
00586       // Don't bother printing anything if mExitText is an empty string.
00587       if(mExitText != std::string(""))
00588       {
00589          vprDEBUG(mCat, mLevel) << mExitText << vprDEBUG_FLUSH;
00590       }
00591    }
00592 }


Member Data Documentation

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

Definition at line 437 of file Debug.h.

Referenced by DebugOutputGuard(), and ~DebugOutputGuard().

int vpr::DebugOutputGuard::mLevel

Definition at line 438 of file Debug.h.

Referenced by DebugOutputGuard(), and ~DebugOutputGuard().

std::string vpr::DebugOutputGuard::mEntryText

Definition at line 439 of file Debug.h.

Referenced by DebugOutputGuard().

std::string vpr::DebugOutputGuard::mExitText

Definition at line 440 of file Debug.h.

Referenced by ~DebugOutputGuard().

bool vpr::DebugOutputGuard::mIndent

Definition at line 441 of file Debug.h.

Referenced by DebugOutputGuard(), and ~DebugOutputGuard().


The documentation for this class was generated from the following files:
Generated on Thu Jan 4 10:56:03 2007 for VR Juggler Portable Runtime by  doxygen 1.5.1