# Hurricane VLSI Database

Functions
Generalities

The supporting paraphernalia. More...

## Functions
string | Hurricane::demangle (const char *symbol)
string | Hurricane::demangle (const type_info &info)

## Detailed Description

The supporting paraphernalia.

# Introduction

When documenting a given class, only member functions introducted by this class are documented, inherited ones are not repeated. This is made easier by the presence of the inheritance sub-tree containing the described object type.

In the same way, some opetators or global functions are defined for all object types though they don't derive from a common base class. Those operators and generic functions will be described below.

terminology In the following, we will describe operators and functions applying to objects of different types. Therefore we will name "Object" any of those types.

# Namming conventions

The name of "C macros" are written with lower case letters and underscores (examples : is_a, for_each_cell or end_for) while the name of generic functions and member functions never use the underscore and always start with an Upper case letter (examples : GetUnit, GetMasterCell, IsCalledBy).

Remark: When examining ``.h include files for more detailed information
  you will find member functions which start with an underscore. While being "public" those functions must never be called upon. In principle, only here'after documented functions should be used by the application programmer.

# GetString

string GetString(const Object& object);
string GetString(const Object* object);

Thoses generic function allows you to get into a string an explicit description of any kind of Hurricane object pointer or reference.

ostream& operator<< (ostream& stream, const Object& object);
ostream& operator<< (ostream& stream, const Object* object);

All Hurricane objects have printing operators for a reference or a pointer. Those printing operators use the generic function Hurricane::GetString() previously studied.

# Predicates

The `bool` `is_a<Type*>(object)` function.

For any kind of Hurricane object pertaining to a class with at least one "virtual" member, it is possible to determine if this object is a type or a sub-type of `<type>` as shown in the following example:

DataBase* dataBase = GetDataBase();
Library* library = Library::Create(dataBase, "std");
Cell* cell = Cell::Create(library, "nand");
if (is_a<Cell*>(cell)) {
// will inevitably go through here
}
if (is_a<Entity*>(cell)) {
// will go through here also because Cell derives from Entity
}
if (is_a<Library*>(cell)) {
// will never go through here because Cell doesn't derive from Library
}

# Inheritance

All classes deriving directly from a base class define a new type named Inherit which represents this base class. This one is unique because Hurricane doesn't use multiple inheritance. This type is important because it allows to call upon the methods of the base class without knowing its name as shown in the following example:

void MyObject::Draw() const
// ************************
{
Inherit::Draw();
DrawParticularities();
}

# Trace utilities

The library provides some usefull utilities for generating trace printings with a natural indentation allowing better understanding of the processing sequences:

- Hurricane::in_trace
- Hurricane::trace_on
- Hurricane::trace_off
- Hurricane::trace_in
- Hurricane::trace_out
- Hurricane::trace

void MyFunction(MyData* data)
// **************************
{
trace << "entering in MyFunction with " << data << endl;
trace_in();
...
trace << "exiting of MyFunction" << endl;
trace_out();
}

Remark: Debugger enthousiastic users will probably ignore this trace
  capability which presents the annoying need to be inserted into the code... For myself, I do prefer those facilities...

# Remarks

Many other global and generic functions exist. Each one will be studied within the description of the classes which create or specialize them (example: Hurricane::GetUnit will be introduced with the Unit class and Hurricane::GetCollection with the Collection class).

## Function Documentation

## ◆ demangle() [1/2]

string Hurricane::demangle | ( | const char * | symbol | ) |

Translate (demangle) a symbol from C++ (`gnu-v3`) internal format into a human readable `string`.

Referenced by Hurricane::JsonStack::as(), Hurricane::demangle(), Hurricane::JsonStack::push_back(), and Hurricane::JsonStack::rhas().

## ◆ demangle() [2/2]

string Hurricane::demangle | ( | const type_info & | info | ) |
| inline

Parameters

  info | a type_info structure as returned by `typeid()`.

Translate (demangle) a symbol from C++ (`gnu-v3`) internal format into a human readable `string`.

References Hurricane::demangle().

Generated by doxygen 1.8.14 on Sun Mar 8 2020 | Return to top of page

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