Debugging


Classes

class  libthrowable::TracePoint
 A class that can be very useful for finding bugs. More...

Defines

#define LIBTHROWABLE_ASSERT(assertionArg)
 Assertion macro that throws a FailedAssertion object if the assertion fails.
#define LIBTHROWABLE_TRACE()   libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE)
 Initializes a libthrowable::TracePoint.
#define LIBTHROWABLE_TRACE_MSG(message)   libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE, (message))
 Initializes a libthrowable::TracePoint with an additional message.
#define LIBTHROWABLE_TRACE_VAR(variable)   libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE, (variable), #variable)
 Initializes a libthrowable::TracePoint with a message showing a variable and its value.

Define Documentation

#define LIBTHROWABLE_ASSERT ( assertionArg   ) 

Value:

do \
    { \
        if(!(assertionArg)) \
        throw libthrowable::FailedAssertion(LIBTHROWABLE_HERE,  std::string("assertion \"" #assertionArg "\" failed !")); \
    }while(0)
Assertion macro that throws a FailedAssertion object if the assertion fails.

Note:
Define LIBTHROWABLE_NDEBUG to remove the effects of this macro for production code.

 
#define LIBTHROWABLE_TRACE (  )     libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE)

Initializes a libthrowable::TracePoint.

Note:
define LIBTHROWABLE_NTRACE or LIBTHROWABLE_NDEBUG to remove the effects of this macro for production code.

#define LIBTHROWABLE_TRACE_MSG ( message   )     libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE, (message))

Initializes a libthrowable::TracePoint with an additional message.

Parameters:
message The message you wish to pass. Should be convertable to std::string.
Note:
define LIBTHROWABLE_NTRACE or LIBTHROWABLE_NDEBUG to remove the effects of this macro for production code.

#define LIBTHROWABLE_TRACE_VAR ( variable   )     libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE, (variable), #variable)

Initializes a libthrowable::TracePoint with a message showing a variable and its value.

This small example shows how to use this macro:

  int i = 1;
  LIBTHROWABLE_TRACE_VAR(i); // same as
                             // LIBTHROWABLE_TRACE_MSG("i = " + libthrowable::util::stringify(i));
Parameters:
variable A variable you want to trace. Note that it must fullfill all requirements for libthrowable::util::stringify().
Note:
define LIBTHROWABLE_NTRACE or LIBTHROWABLE_NDEBUG to remove the effects of this macro for production code.
Since:
libthrowable-1.0.0


Generated on Wed Jan 9 18:07:17 2008 for libthrowable by  doxygen 1.5.4  Hosted on  SourceForge.net Logo