Generalities Generalities 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). 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 stringGetString(constObject&object); stringGetString(constObject*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,constObject&object); ostream&operator<<(ostream&stream,constObject*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)){ //willinevitablygothroughhere } if(is_a<Entity*>(cell)){ //willgothroughherealsobecauseCellderivesfromEntity } if(is_a<Library*>(cell)){ //willnevergothroughherebecauseCelldoesn'tderivefromLibrary } 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: voidMyObject::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 voidMyFunction(MyData*data) //************************** { trace<<"enteringinMyFunctionwith"<<data<<endl; trace_in(); ... trace<<"exitingofMyFunction"<<endl; trace_out(); } 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).