# Hurricane VLSI Database

List of all members | Public Member Functions
tstream Class Reference

Trace & indentation enabled stream. More...

Inherits ostream.

## Public Member Functions
int | getMinLevel () const
int | getMaxLevel () const
int | setMinLevel (int)
int | setMaxLevel (int)
int | getLevel () const
int | setLevel (int)
bool | enabled () const
bool | enabled (int) const
tstream & | log (int level, int count=0)
tstream & | tabw (int level, int count)

## Detailed Description

Trace & indentation enabled stream.

Traced stream are a derived class of std::ostream that provides integrated indentation and selective printing according to a verbosity level. Only messages comprised between `minLevel` and `maxLevel` are to be printed:

The cdebug instance of this class, in conjunction with Hurricane::DebugSession is provided to create tailored program traces. cdebug is a global variable which is put in the root namespace (not the Hurricane namespace).

## Member Function Documentation

## ◆ getMinLevel()

int tstream::getMinLevel | ( |  | ) | const
| inline

Returns: The current mimimum level for the messages to be printeds (equal or superior).

Referenced by Hurricane::DebugSession::open().

## ◆ getMaxLevel()

int tstream::getMaxLevel | ( |  | ) | const
| inline

Returns: The current maximum level for the messages to be printeds (strictly inferior).

Referenced by Hurricane::DebugSession::open().

## ◆ setMinLevel()

int tstream::setMinLevel | ( | int | level | ) |
| inline

Sets the minimum level, returns the previous value of the level.

Referenced by Hurricane::DebugSession::close(), and Hurricane::DebugSession::open().

## ◆ setMaxLevel()

int tstream::setMaxLevel | ( | int | level | ) |
| inline

Sets the maximum level, returns the previous value of the level.

Referenced by Hurricane::DebugSession::close(), and Hurricane::DebugSession::open().

## ◆ getLevel()

int tstream::getLevel | ( |  | ) | const
| inline

Returns: The level of the latest message that was submitted to the stream. It is automatically set up after any call to tstream::log() or tstream::tabw().

## ◆ setLevel()

int tstream::setLevel | ( | int | level | ) |
| inline

Sets the current level, returns the previous value of the level. This is the level of the latest message that was submitted to the stream.

Referenced by log(), and tabw().

## ◆ enabled() [1/2]

bool tstream::enabled | ( |  | ) | const
| inline

Returns: true if the currently memorised level is inside the current valid range.

## ◆ enabled() [2/2]

bool tstream::enabled | ( | int | level | ) | const
| inline

Returns: true if this level is inside the current valid range.

## ◆ log()

tstream & tstream::log | ( | int | level,
|  | int | count = `0`
| ) |  |
| inline

Parameters

  level | The level into which to print.
  count | Increment/decrement the number of tabulations to print at the beginning of a line.

Returns
  A reference to the stream so the operator `<<` can be used.

Send a message into the stream, that will be displayed if `level` is enabled. The number of tabulations printed at the beginning of the line will be changed after this message has been printed (or discarted).

References setLevel().

## ◆ tabw()

tstream & tstream::tabw | ( | int | level,
|  | int | count
| ) |  |
| inline

Parameters

  level | The level into which to print.
  count | Increment/decrement the number of tabulations to print at the beginning of a line.

Returns
  A reference to the stream.

This function is dedicated to change the indentation level, but not print something on the stream (event if it returns a reference to it).

References setLevel().

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

- Commons.h
- Commons.dox

Generated by doxygen 1.8.14 on Tue Jul 21 2020 | Return to top of page

Hurricane VLSI Database | Copyright © 2000-2016 Bull S.A. All rights reserved