Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

lambda debugging and tracing


SourceForge.net Logo     CTTL on    
    SourceForge    
    Download    
    Latest    
    Documentation    
    Index    
    Library    
    News    
    CVS    
    Repository    
   Other    
   Links    

Macro CTTL_TRACE_EVERYTHING turns on tracing of lambda expressions unless CTTL_TRACE_DEPOSITS_OFF is defined.

Macro CTTL_TRACE_RULES turns on tracing of lambda expressions, unless CTTL_TRACE_DEPOSITS_OFF is defined.

Macro CTTL_TRACE_DEPOSITS turns on tracing of lambda expressions.

Macro CTTL_TRACE_DEPOSITS_OFF turns off tracing of lambda expressions, to be used in combination with CTTL_TRACE_EVERYTHING and CTTL_TRACE_RULES.

Macro CTTL_LAMBDA_ASSERT( expression ) tests logical expression. If the expression is false, it invokes standard C assert().

Macro CTTL_TRACE_DEPOSIT_JUSTIFY( ) sends spaces std::cout to align output cursor with the current level of CTTL tracing.

Macro CTTL_TRACE_DEPOSIT_TEXT( expression ) sends expression to std::cout.

Macro CTTL_LAMBDA_TRACE( xmessage ) sends character string to std::cout from inside lambda expressions. Lambda expression CTTL_LAMBDA_TRACE( xmessage ) has type of integer, and the value of atoi( xmessage ) while in trace mode; otherwise it has a value of 1.

For example:

code debugging

Prints message when lambda tracing is turned on.

Result of evaluation may be controlled by an integer in front of the text message submitted as atoi argument..

#define CTTL_TRACE_RULES // automatically turns lambda tracing on

#include "cttl/cttl.h"
#include "lambda/lambda.h"

using namespace cttl;

int main(int argc, char* argv[])
{
    CTTL_TRACE_DEPOSIT_JUSTIFY();
    CTTL_TRACE_DEPOSIT_TEXT( "BEGIN" );
    CTTL_TRACE_DEPOSIT_TEXT( std::endl );
    (
        CTTL_LAMBDA_TRACE( "File: " __FILE__ " Line:" CTTL_QUOTED_EXPRESSION( __LINE__ )  )
    ).evaluate();
    CTTL_TRACE_DEPOSIT_JUSTIFY();
    CTTL_TRACE_DEPOSIT_TEXT( "END" );

    return 0;
}
/*
Program output:

     BEGIN
     ( ++ "File: main.cpp Line:14"  0 )
     END
*/



Copyright © 1997-2006 Igor Kholodov mailto:cttl@users.sourceforge.net.

Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.


Generated on Thu Nov 2 17:48:53 2006 for CTTL Lambda Expression by  doxygen 1.3.9.1