MeVisLab Toolbox Reference
ml::Trace< INDEXTYPE > Class Template Reference

This class simply implements a constructor and a destructor. More...

#include <mlTrace.h>

Public Member Functions

 Trace (const char *const traceInString, TraceBuffer< INDEXTYPE > &traceBuf)
 Constructor.
 
 ~Trace ()
 Destructor.
 

Detailed Description

template<typename INDEXTYPE>
class ml::Trace< INDEXTYPE >

This class simply implements a constructor and a destructor.

The constructor calls the add method of a TraceBuffer and the destructor calls the remove method of a TraceBuffer. It will typically be called of ML_TRACE_IN macros on function entries to track the string description of the function name in a call stack and a call list in a TraceBuffer object.

Parameters
INDEXTYPEspecifies the data type and indirectly the size of the stack and the list. Normally it should be MLuint8 or MLuint16 which then will result in 256 or 65536 stack and list entries. Other types are supported. IMPORTANT: For further documentation and thread-safety see TraceBuffer class!

Definition at line 181 of file mlTrace.h.

Constructor & Destructor Documentation

◆ Trace()

template<typename INDEXTYPE >
ml::Trace< INDEXTYPE >::Trace ( const char *const traceInString,
TraceBuffer< INDEXTYPE > & traceBuf )
inline

Constructor.

It adds the passed string reference to the trace buffer and to the top of the trace stack. Passed string pointer also may be NULL. If not NULL it must point to any null-terminated non changing permanent string. To be used by ML_TRACE_IN macros.

Parameters
traceInStringis the string pointer to the permanent static string to be added to list and pushed to stack.
traceBufis the TraceBuffer in which the string shall be appended and pushed. VERY TIME CRITICAL!

Definition at line 196 of file mlTrace.h.

References mlrange_cast().

◆ ~Trace()

template<typename INDEXTYPE >
ml::Trace< INDEXTYPE >::~Trace ( )
inline

Destructor.

It removes the last entry from the TraceBuffer. That pops the last pushed string reference from the stack and resets its entry to NULL. Normally automatically called when leaving the scope where the constructor is called. VERY TIME CRITICAL!

Definition at line 211 of file mlTrace.h.


The documentation for this class was generated from the following file: