Intel® Trace Analyzer and Collector User and Reference Guide

ID 767272
Date 3/31/2023
Public
Document Table of Contents

VT_Function Class Reference

Description

In C++ an instance of this class should be created at the beginning of a function.

The constructor will then log the function entry, and the destructor the function exit.

Providing a source code location for the function exit manually is not supported, because this source code location would have to define where the function returns to. This cannot be determined at compile time.

Constructor & Destructor Documentation

VT_Function(const char *symname, const char *classname)

Defines the function with VT_classdef() and VT_funcdef(), then enters it.

This is less efficient than defining the function once and then reusing the handle. Silently ignores errors, like uninitialized Intel® Trace Analyzer and Collector.

Parameters:

symname name of the function
classname the class this function belongs to

VT_Function(const char *symname, const char *classname, const char *file, int line)

The same as the previous constructor, but also stores information about where the function is located in the source code.

Parameters:

symname name of the function
classname the class this function belongs to
file name of source file, may but does not have to include path
line line in this file where function starts

VT_Function(VT_FuncDef &funcdef)

This is a more efficient version which supports defining the function only once.

Parameters:

funcdef this is a reference to the (usually static) instance that defines and remembers the function handle

VT_Function (VT_FuncDef &funcdef, VT_SclDef &scldef)

This is a more efficient version which supports defining the function and source code location only once.

Parameters:

funcdef this is a reference to the (usually static) instance that defines and remembers the function handle
scldef this is a reference to the (usually static) instance that defines and remembers the scl handle

~VT_Function()

The destructor marks the function exit.