MsgUtil.h File Reference

#include <map>
#include <string>
#include <sstream>
#include <stdarg.h>

Include dependency graph for MsgUtil.h:

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

Go to the source code of this file.

Classes

class  MsgUtil

Defines

#define memTraceMsg(classname)   static const char* _classname_ = classname;
#define traceMsg(message)   ((void)0)
#define traceId(classname)   static const char* _classname_ = classname;
#define assertMsg(e)   ((void)0)
#define verboseMsg(message)
#define verboseMsg1(format, arg1)
#define verboseMsg2(format, arg1, arg2)
#define verboseMsg3(format, arg1, arg2, arg3)
#define verboseMsg4(format, arg1, arg2, arg3, arg4)
#define verboseMsg5(format, arg1, arg2, arg3, arg4, arg5)
#define verboseMsg6(format, arg1, arg2, arg3, arg4, arg5, arg6)
#define debugMsg(message)
#define debugMsg1(format, arg1)
#define debugMsg2(format, arg1, arg2)
#define debugMsg3(format, arg1, arg2, arg3)
#define debugMsg4(format, arg1, arg2, arg3, arg4)
#define debugMsg5(format, arg1, arg2, arg3, arg4, arg5)
#define debugMsg6(format, arg1, arg2, arg3, arg4, arg5, arg6)
#define infoMsg(message)
#define infoMsg1(format, arg1)
#define infoMsg2(format, arg1, arg2)
#define infoMsg3(format, arg1, arg2, arg3)
#define infoMsg4(format, arg1, arg2, arg3, arg4)
#define infoMsg5(format, arg1, arg2, arg3, arg4, arg5)
#define infoMsg6(format, arg1, arg2, arg3, arg4, arg5, arg6)
#define warnMsg(message)
#define warnMsg1(format, arg1)
#define warnMsg2(format, arg1, arg2)
#define warnMsg3(format, arg1, arg2, arg3)
#define warnMsg4(format, arg1, arg2, arg3, arg4)
#define warnMsg5(format, arg1, arg2, arg3, arg4, arg5)
#define warnMsg6(format, arg1, arg2, arg3, arg4, arg5, arg6)


Define Documentation

#define assertMsg  )     ((void)0)
 

assertMsg(<statement>) if the statement is true, will print the statement. This is not associated with a class or a level. Asserts always print in debug mode and are compiled out in release mode Use this instead of a normal assert and your asserts will get sent to your log file.

Definition at line 301 of file MsgUtil.h.

#define debugMsg message   ) 
 

Sends a debug level message. Debug messages are only compiled in if _DEBUG_ is defined. Use debug message for debugging problems. See warnMsg(message) for more information

Definition at line 409 of file MsgUtil.h.

Referenced by MWorld::getJoint(), MWorld::getObject(), MWorld::getSpace(), and MObject::setBody().

#define debugMsg1 format,
arg1   ) 
 

See debugMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 413 of file MsgUtil.h.

#define debugMsg2 format,
arg1,
arg2   ) 
 

See debugMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 417 of file MsgUtil.h.

#define debugMsg3 format,
arg1,
arg2,
arg3   ) 
 

See debugMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 421 of file MsgUtil.h.

#define debugMsg4 format,
arg1,
arg2,
arg3,
arg4   ) 
 

See debugMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 425 of file MsgUtil.h.

#define debugMsg5 format,
arg1,
arg2,
arg3,
arg4,
arg5   ) 
 

See debugMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 429 of file MsgUtil.h.

#define debugMsg6 format,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6   ) 
 

See debugMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 433 of file MsgUtil.h.

#define infoMsg message   ) 
 

Value:

{\
  ostringstream _strStream_; \
  _strStream_<<message; \
  MsgUtil::printMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::INFO, _strStream_.str().c_str()); \
}
Sends an info level message. Info messages are always compiled in and default to turned on. Use infor message for normal status messages that you want the user to see. See warnMsg(message) for more information

Definition at line 442 of file MsgUtil.h.

#define infoMsg1 format,
arg1   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::INFO, format, \
                    arg1)
See infoMsg(message) and warnMsg(format, arg1)

Definition at line 452 of file MsgUtil.h.

#define infoMsg2 format,
arg1,
arg2   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::INFO, format, \
                    arg1, arg2)
See infoMsg(message) and warnMsg(format, arg1)

Definition at line 459 of file MsgUtil.h.

#define infoMsg3 format,
arg1,
arg2,
arg3   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::INFO, format, \
                    arg1, arg2, arg3)
See infoMsg(message) and warnMsg(format, arg1)

Definition at line 466 of file MsgUtil.h.

#define infoMsg4 format,
arg1,
arg2,
arg3,
arg4   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::INFO, format, \
                    arg1, arg2, arg3, arg4)
See infoMsg(message) and warnMsg(format, arg1)

Definition at line 473 of file MsgUtil.h.

#define infoMsg5 format,
arg1,
arg2,
arg3,
arg4,
arg5   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::INFO, format, \
                    arg1, arg2, arg3, arg4, arg5)
See infoMsg(message) and warnMsg(format, arg1)

Definition at line 480 of file MsgUtil.h.

#define infoMsg6 format,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::INFO, format, \
                    arg1, arg2, arg3, arg4, arg5, arg6)
See infoMsg(message) and warnMsg(format, arg1)

Definition at line 487 of file MsgUtil.h.

#define memTraceMsg classname   )     static const char* _classname_ = classname;
 

MEMORY TRACE Put this macro in the constructors and destructors to print out a memory trace message any time an instance of the class is created or destroyed. This is compiled out in a non-debug build

Definition at line 255 of file MsgUtil.h.

Referenced by MBody::MBody(), MBoxGeom::MBoxGeom(), MGeometry::MGeometry(), MHingeJoint::MHingeJoint(), MJoint::MJoint(), MObject::MObject(), MPlaneGeom::MPlaneGeom(), MSphereGeom::MSphereGeom(), MWorld::MWorld(), VBoxGeom::VBoxGeom(), VCanvas::VCanvas(), VControlPanel::VControlPanel(), VGeometry::VGeometry(), VGeomFactory::VGeomFactory(), ViewerGUI::ViewerGUI(), VLight::VLight(), VLighting::VLighting(), VPlaneGeom::VPlaneGeom(), VSphereGeom::VSphereGeom(), VWorld::VWorld(), VWorldTree::VWorldTree(), MBody::~MBody(), MBoxGeom::~MBoxGeom(), MGeometry::~MGeometry(), MHingeJoint::~MHingeJoint(), MJoint::~MJoint(), MObject::~MObject(), MPlaneGeom::~MPlaneGeom(), MSphereGeom::~MSphereGeom(), MWorld::~MWorld(), VCanvas::~VCanvas(), VGeometry::~VGeometry(), VLight::~VLight(), VLighting::~VLighting(), VWorld::~VWorld(), and VWorldTree::~VWorldTree().

#define traceId classname   )     static const char* _classname_ = classname;
 

Function trace traceId(const char *className) Use this macro at the start of every function. This does two things. First it sets up a variable called _classname_ which is used in all the following macros. Second, it sends an empty trace message so that you can trace the function calls during a run. Since this can result in lots of messages, TRACE level messaging is turned off by default.

Definition at line 285 of file MsgUtil.h.

Referenced by VWorld::addGeometry(), MObject::addGeometry(), MBody::addMassDistribution(), MWorld::advanceModel(), MHingeJoint::applyTorque(), MJoint::body1(), MJoint::body2(), VWorld::cleanup(), VLight::cleanup(), VGeometry::cleanup(), MWorld::cleanup(), MObject::cleanup(), MJoint::cleanup(), MBody::cleanup(), VGeomFactory::createGeometry(), MGeomFactory::createGeometry(), MJointFactory::createJoint(), VLight::draw(), VGeometry::draw(), VWorld::drawAllObjects(), VLight::drawBox(), VLighting::drawLights(), VSphereGeom::drawObject(), VPlaneGeom::drawObject(), VBoxGeom::drawObject(), MGeometry::encapsulatedGeomID(), MJointFactory::factory(), MGeomFactory::factory(), VWorld::findGeometry(), MPlaneGeom::getAbsolutePosition(), MGeometry::getAbsolutePosition(), MPlaneGeom::getAbsoluteQuaternion(), MGeometry::getAbsoluteQuaternion(), VLighting::getAmbientLight(), MHingeJoint::getAnchor(), MHingeJoint::getAngle(), MHingeJoint::getAngleRange(), VLighting::getAvailableData(), VLight::getAvailableData(), VGeometry::getAvailableData(), MTransformable::getAvailableData(), MPlaneGeom::getAvailableData(), MJoint::getAvailableData(), MBoxGeom::getAvailableData(), MBody::getAvailableData(), MHingeJoint::getAxis(), MBody::getBodyForID(), MBody::getCenterOfMass(), VLight::getColor(), VLight::getConstantAttenuation(), VLighting::getDataValue(), VLight::getDataValue(), VGeometry::getDataValue(), MTransformable::getDataValue(), MSphereGeom::getDataValue(), MPlaneGeom::getDataValue(), MJoint::getDataValue(), MHingeJoint::getDataValue(), MBoxGeom::getDataValue(), MBody::getDataValue(), MBoxGeom::getDimensions(), VLight::getDirection(), MHingeJoint::getForceMax(), MGeometry::getGeomForID(), MWorld::getJoint(), VLighting::getLightParameters(), VLight::getLinearAttenuation(), MBody::getMassDistribution(), MSphereGeom::getMassDistro(), MPlaneGeom::getMassDistro(), MBoxGeom::getMassDistro(), MWorld::getObject(), MPlaneGeom::getPlaneEquation(), VLight::getPosition(), MPlaneGeom::getPosition(), MGeometry::getPosition(), MBody::getPosition(), VLight::getQuadraticAttenuation(), MPlaneGeom::getQuaternion(), MGeometry::getQuaternion(), MBody::getQuaternion(), MHingeJoint::getRotationRate(), MWorld::getSpace(), MObject::getSpace(), VLight::getSpotCutoff(), VLight::getSpotDirection(), VLight::getSpotExponent(), MBody::getTotalMass(), MBody::getVelocity(), MWorld::handleGravityNode(), MWorld::handleJointNode(), MWorld::handleObjectNode(), MWorld::handleSpaceNode(), VWorld::initFromXML(), VLighting::initFromXML(), VLight::initFromXML(), ViewerGUI::initFromXML(), ViewerApp::initFromXML(), VGeometry::initFromXML(), VControlPanel::initFromXML(), VCanvas::initFromXML(), MWorld::initFromXML(), MSphereGeom::initFromXML(), MPlaneGeom::initFromXML(), MObject::initFromXML(), MHingeJoint::initFromXML(), MBoxGeom::initFromXML(), MBody::initFromXML(), VCanvas::InitGL(), VGeometry::name(), MGeometry::nearCallback(), VGeometry::objectName(), VControlPanel::onAccuracyChoice(), VCanvas::onEnterWindow(), VControlPanel::onFFBtn(), VWorldTree::onGridChanged(), ViewerGUI::onGridDataChanged(), ViewerGUI::onIdle(), ViewerApp::OnInit(), VCanvas::onKey(), VCanvas::onMouse(), VControlPanel::onResetBtn(), VWorldTree::onSelectionChanged(), ViewerGUI::onSelectionChanged(), VCanvas::onSize(), VControlPanel::onSpeedChoice(), MBody::parseMassNode(), MTransformable::parseTransformNode(), MSphereGeom::radius(), ViewerApp::reInit(), VWorldTree::selectObject(), ViewerGUI::selectObject(), VLighting::setAmbientLight(), MHingeJoint::setAnchor(), MHingeJoint::setAngleRange(), MHingeJoint::setAxis(), MObject::setBody(), VCanvas::setCameraPosition(), MBody::setCenterOfMass(), VLight::setColor(), VLight::setConstantAttenuation(), VLighting::setDataValue(), VLight::setDataValue(), VGeometry::setDataValue(), MTransformable::setDataValue(), MSphereGeom::setDataValue(), MPlaneGeom::setDataValue(), MJoint::setDataValue(), MHingeJoint::setDataValue(), MBoxGeom::setDataValue(), MBody::setDataValue(), MBoxGeom::setDimensions(), VLight::setDirection(), MHingeJoint::setForceMax(), VLighting::setLightParameters(), VLight::setLinearAttenuation(), MBody::setMassDistribution(), MHingeJoint::setMotorVelocity(), MPlaneGeom::setPlaneEquation(), VLight::setPosition(), MPlaneGeom::setPosition(), MGeometry::setPosition(), MBody::setPosition(), VLight::setQuadraticAttenuation(), MPlaneGeom::setQuaternion(), MGeometry::setQuaternion(), MBody::setQuaternion(), MPlaneGeom::setRotation(), MGeometry::setRotation(), MBody::setRotation(), VLight::setSpotCutoff(), VLight::setSpotDirection(), VLight::setSpotExponent(), VGeometry::setTextureFromJPEG(), MBody::setTotalMass(), MBody::setVelocity(), VCanvas::setViewProjection(), VWorldTree::setWorld(), MGeometry::spaceID(), VWorldTree::updateGrid(), and VControlPanel::updateGUI().

#define traceMsg message   )     ((void)0)
 

Standard trace Use this macro to trace the progress of a function. You can add a message to indicate what branch of a conditional was hit or status.

Definition at line 269 of file MsgUtil.h.

#define verboseMsg message   ) 
 

Sends a verbose level message. Verbose messages are only compiled in if _DEBUG_ is defined. Use verbose message for detailed output of what is happening in a function. This is output that could be useful to the developer, but no to the user. See warnMsg(message) for more information

Definition at line 344 of file MsgUtil.h.

Referenced by VGeomFactory::createGeometry(), MGeomFactory::createGeometry(), MJointFactory::createJoint(), MWorld::handleSpaceNode(), MWorld::initFromXML(), MObject::initFromXML(), MBody::initFromXML(), VCanvas::onMouse(), and MBody::parseMassNode().

#define verboseMsg1 format,
arg1   ) 
 

See verboseMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 348 of file MsgUtil.h.

Referenced by VWorld::initFromXML(), ViewerGUI::initFromXML(), ViewerApp::initFromXML(), VCanvas::initFromXML(), ViewerApp::OnInit(), and VCanvas::onMouse().

#define verboseMsg2 format,
arg1,
arg2   ) 
 

See verboseMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 352 of file MsgUtil.h.

#define verboseMsg3 format,
arg1,
arg2,
arg3   ) 
 

See verboseMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 356 of file MsgUtil.h.

#define verboseMsg4 format,
arg1,
arg2,
arg3,
arg4   ) 
 

See verboseMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 360 of file MsgUtil.h.

#define verboseMsg5 format,
arg1,
arg2,
arg3,
arg4,
arg5   ) 
 

See verboseMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 364 of file MsgUtil.h.

#define verboseMsg6 format,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6   ) 
 

See verboseMsg(message) and warnMsg1(format, arg1) for more info

Definition at line 368 of file MsgUtil.h.

#define warnMsg message   ) 
 

Value:

{\
  ostringstream _strStream_; \
  _strStream_<<message; \
  MsgUtil::printMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::WARN, _strStream_.str().c_str()); \
}
warnMsg(message) Sends a warning level message. Warnings are always compiled in and default to turned on. Use warnings for things that you want the user to see
Parameters:
message The message that you want to print. This can be any valid stream operation. Anything that could be streamed like: cout<<message will work. So you could do:
  • warnMsg("warning!");
  • warnMsg("warning x="<<x<<" is invalid.");
  • warnMsg(5<<"is not a valid entry for class "<<c);

Definition at line 503 of file MsgUtil.h.

Referenced by MObject::addGeometry(), VGeomFactory::createGeometry(), MGeomFactory::createGeometry(), MJointFactory::createJoint(), MWorld::handleJointNode(), MWorld::handleObjectNode(), MWorld::handleSpaceNode(), VLight::initFromXML(), ViewerGUI::initFromXML(), ViewerApp::initFromXML(), VCanvas::initFromXML(), MPlaneGeom::initFromXML(), MHingeJoint::initFromXML(), VCanvas::onMouse(), VGeometry::setTextureFromJPEG(), and VWorldTree::setWorld().

#define warnMsg1 format,
arg1   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::WARN, format, \
                    arg1)
warnMsg[1-6](const char *fmt, ...) Sends a warn message using a printf formated string and between 1 and 5 arguments. Sends a warning level message. Warnings are always compiled in and default to turned on. Use warnings for things that you want the user to see

Definition at line 517 of file MsgUtil.h.

#define warnMsg2 format,
arg1,
arg2   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::WARN, format, \
                    arg1, arg2)
see warnMsg1(format, arg1)

Definition at line 524 of file MsgUtil.h.

#define warnMsg3 format,
arg1,
arg2,
arg3   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::WARN, format, \
                    arg1, arg2, arg3)
see warnMsg1(format, arg1)

Definition at line 531 of file MsgUtil.h.

#define warnMsg4 format,
arg1,
arg2,
arg3,
arg4   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::WARN, format, \
                    arg1, arg2, arg3, arg4)
see warnMsg1(format, arg1)

Definition at line 538 of file MsgUtil.h.

#define warnMsg5 format,
arg1,
arg2,
arg3,
arg4,
arg5   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::WARN, format, \
                    arg1, arg2, arg3, arg4, arg5)
see warnMsg1(format, arg1)

Definition at line 545 of file MsgUtil.h.

#define warnMsg6 format,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6   ) 
 

Value:

MsgUtil::printfMsg(_classname_, __PRETTY_FUNCTION__, __LINE__, \
                    MsgUtil::WARN, format, \
                    arg1, arg2, arg3, arg4, arg5, arg6)
see warnMsg1(format, arg1)

Definition at line 552 of file MsgUtil.h.


Generated on Sat Dec 3 10:47:52 2005 for Robotics by  doxygen 1.4.5