Reference

ACE_Trace(3)

A C++ trace facility that keeps track of which methods are entered and exited.

NAME

ACE_Trace - A C++ trace facility that keeps track of which methods are entered and exited.

SYNOPSIS

#include <ace/Trace.h>
class ACE_Trace
{
  public:
    ACE_Trace (
        const ASYS_TCHAR *n,
        int line = 0,
        const ASYS_TCHAR *file = ASYS_TEXT ("")
        );
    ~ACE_Trace (void);
    static int is_tracing(void);
    static void start_tracing (void);
    static void stop_tracing (void);
    static void set_nesting_indent (int indent);
    void dump (void) const;
  private:
    const ASYS_TCHAR *name_;
    static int nesting_indent_;
    static int enable_tracing_;
    enum{ DEFAULT_INDENT = 3, DEFAULT_TRACING = 1 };
};

DESCRIPTION

This class uses C++ constructors and destructors to automate the ACE_Trace nesting. In addition, thread-specific storage is used to enable multiple threads to work correctly.

Initialization and termination methods.

ACE_Trace (
    const ASYS_TCHAR *n,
    int line = 0,
    const ASYS_TCHAR *file = ASYS_TEXT ("")
    );

Perform the first part of the trace, which prints out the string N, the LINE, and the ACE_FILE as the function is entered.

~ACE_Trace (void);

Perform the second part of the trace, which prints out the NAME as the function is exited.

Control the tracing level.

static int is_tracing(void);

Determine if tracing is enabled (return == 1) or not (== 0)

static void start_tracing (void);

Enable the tracing facility.

static void stop_tracing (void);

Disable the tracing facility.

static void set_nesting_indent (int indent);

Change the nesting indentation level.

void dump (void) const;

Dump the state of an object.

AUTHOR

Douglas C. Schmidt [email protected]

LIBRARY

ace