Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

Trace


Modules

Trace in Standard Strings

Defines

#define hyp_TRACE_SET_FILE(Stream)
#define hyp_TRACE(args)
#define hyp_TRACE_BEGIN
#define hyp_TRACE_DO(Args)
#define hyp_TRACE_END

Functions

std::ostream& GetTraceStream (void)
void SetTraceStream (std::ostream &Stream)
std::string Begin (const char *File, int Line)
std::string End (void)
std::string Print (const char *Msg,...)

Variables

std::ostream& gs_TraceStream = clog

Detailed Description

Utilitary macros These macros is used to defined hyp_TRACE. But its could be used to generated successive traces without the name of the file, the line number and a new line.
        hyp_TRACE_BEG;
        for ( int i = 0; i < nb; i++ ) {
                ...
                hyp_TRACE_DO( ( "tab[%d]=%d\n", i, tab[ i ] ) );
                ...
        }
        hyp_TRACE_END;

Define Documentation

#define hyp_TRACE( args )
 

Value:

{                                                   \
        hyp_TRACE_BEGIN;                            \
        hyp_TRACE_DO( args );                       \
        hyp_TRACE_END;                              \
}
Standard trace macro.

#define hyp_TRACE_BEGIN
 

Value:

        hyp::ker::GetTraceStream()<<hyp::ker::Begin( __FILE__, __LINE__ )
Writes in the trace file:
  • the file name;
  • the line number where the macro has been insered.

#define hyp_TRACE_DO( Args )
 

Value:

        hyp::ker::GetTraceStream()<<hyp::ker::Print Args
Writes in the trace file a message which is made up of arguments from the printf function.
hyp_TRACE_DO( ( "toto, %s: %d,%d", "hello", 3, 4 ) );

#define hyp_TRACE_END
 

Value:

Writes in the trace file a sequence of characters which terminate the trace operations.

#define hyp_TRACE_SET_FILE( Stream )
 

Value:

        hyp::ker::SetStreamTrace( Stream )
Defines the stream used to trace operations. This stream is called trace file. By default, the stream is the hyplog file.


Function Documentation

std::string Begin ( const char * File,
int Line )
 

Formats head data to a string. Used by the trace macro.

Parameters:
File   File name where this function is insered. It is always filled by __FILE__ macro.
Line   Line number where this function is insered. It is always filled by __LINE__ macro.
Returns:
Formated string.

std::string End ( void )
 

Formats the end date to a string. Used by the trace macro.

Returns:
Formated string.

std::ostream & GetTraceStream ( void )
 

Get the stream used for the trace operations.

Returns:
Trace stream

std::string Print ( const char * Msg,
... )
 

Formats data to a string.

Parameters:
Msg   Message made up of arguments from the printf function.
Returns:
Formated string
Todo:
overflow capacity

void SetTraceStream ( std::ostream & Stream )
 

Set the stream used for the trace operations.

Parameters:
Stream   Trace stream


Variable Documentation

std::ostream & gs_TraceStream = clog
 

Stream by default for the trace operations.


Top of Page
written by Pierre Rebours © 2000-2001. Terms of Use.