Homepage Demos Overview Downloads Tutorials Reference
Credits

debuget.h File Reference


Detailed Description

Defines several debugging functions and macros, including ASSERT (and variations).

Author:
ejt (Creator)
Author
ejt
Name
tekkotsu-2_2_2
Revision
1.2
State
Rel
Date
2003/09/25 15:31:53

Definition in file debuget.h.

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <fstream>

Include dependency graph for debuget.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ASSERT(b, str)   {if(!(b)) std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl;}
 if the bool b is false, std::cout the string
#define ASSERTRET(b, str)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return; }}
 if the bool b is false, std::cout the string and return
#define ASSERTRETVAL(b, str, v)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return v; }}
 if the bool b is false, std::cout the string and return the value
#define ASSERTFATAL(b, str, x)   {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; exit(x); }}
 if the bool b is false, std::cout the string and exit(x)

Functions

const char * _extractFilename (const char *path)
 for historical reasons - the previous compiler give the entire path for __FILE__, for display, just use the filename
char hexdigit (int c)
 returns the hex char that corresponds to c, which should be 0-16 (returns '.' otherwise)
void charhexout (char c)
 printf's the two hex digits coresponding to a byte
void hexout (const void *p, size_t n)
 charhexout's n bytes starting at p


Define Documentation

#define ASSERT b,
str   )     {if(!(b)) std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl;}
 

if the bool b is false, std::cout the string

Definition at line 19 of file debuget.h.

Referenced by OldHeadPointerMC::convFromBodyRelative(), OldHeadPointerMC::convToBodyRelative(), MotionManager::doAddMotion(), EventTranslator::enqueue(), MotionManager::getOutputs(), SoundPlay::GotEventTranslatorQueue(), MMCombo::GotEventTranslatorQueue(), MMCombo::GotMotionManager(), MMCombo::GotSoundManager(), MMCombo::GotWorldState(), SoundPlay::InitRegion(), SoundManager::initRegion(), MMCombo::InitRegion(), SegCamBehavior::openPacket(), RawCamBehavior::openPacket(), SoundManager::Play(), RawCameraGenerator::processEvent(), GroundPlaneBehavior::processEvent(), FreeMemReportControl::processEvent(), FollowHeadBehavior::processEvent(), FilterBankGenerator::processEvent(), CDTGenerator::processEvent(), EventTranslator::sendEvent(), RawCameraGenerator::setDimensions(), CDTGenerator::setDimensions(), MMCombo::SetupOutputs(), BehaviorSwitchControl< B, Al >::stopother(), and StateNode::~StateNode().

#define ASSERTFATAL b,
str,
 )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; exit(x); }}
 

if the bool b is false, std::cout the string and exit(x)

Definition at line 25 of file debuget.h.

#define ASSERTRET b,
str   )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return; }}
 

if the bool b is false, std::cout the string and return

Definition at line 21 of file debuget.h.

Referenced by EventLogger::checkLogFile(), Controller::closeGUI(), VisualTargetCloseTrans::processEvent(), SegCamBehavior::processEvent(), RawCamBehavior::processEvent(), PlayMotionSequenceNode< SIZE >::processEvent(), HeadLevelBehavior::processEvent(), FreeMemReportControl::processEvent(), BatteryMonitorBehavior::processEvent(), MMCombo::ReadySendJoints(), RawCameraGenerator::reconstructImage(), and RawCameraGenerator::upsampleImage().

#define ASSERTRETVAL b,
str,
 )     {if(!(b)) { std::cout << "ASSERT:"<<_extractFilename(__FILE__)<<'.'<<__LINE__<<':'<< str << std::endl; return v; }}
 

if the bool b is false, std::cout the string and return the value

Definition at line 23 of file debuget.h.

Referenced by Profiler::getNewID(), RawCameraGenerator::LoadBuffer(), SegCamBehavior::openPacket(), RawCamBehavior::openPacket(), RawCameraGenerator::SaveBuffer(), RawCamBehavior::writeColor(), SegCamBehavior::writeRLE(), SegCamBehavior::writeSeg(), and RawCamBehavior::writeSingleChannel().


Function Documentation

const char* _extractFilename const char *  path  )  [inline]
 

for historical reasons - the previous compiler give the entire path for __FILE__, for display, just use the filename

Definition at line 11 of file debuget.h.

void charhexout char  c  )  [inline]
 

printf's the two hex digits coresponding to a byte

Definition at line 50 of file debuget.h.

Referenced by hexout().

char hexdigit int  c  )  [inline]
 

returns the hex char that corresponds to c, which should be 0-16 (returns '.' otherwise)

Definition at line 39 of file debuget.h.

Referenced by charhexout().

void hexout const void *  p,
size_t  n
[inline]
 

charhexout's n bytes starting at p

Definition at line 55 of file debuget.h.


Tekkotsu v2.2.2
Generated Tue Jan 4 15:43:36 2005 by Doxygen 1.4.0