coriolis/hurricane/doc/hurricane/html/group__Generalities.html

141 lines
9.2 KiB
HTML

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Hurricane Documentation</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="SoC.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<h1 id="pagetop" class="header">Hurricane VLSI Database</h1>
<!--
<center class="header">
<table class="header">
<tr>
<td><a href="customSummary.html">Summary</a></td>
<td><a href="namespaces.html">Namespaces</a></td>
<td><a href="customHierarchy.html">Class Hierarchy</a></td>
<td><a href="annotated.html">Classes</a></td>
<td><a href="functions.html">Member Index</a></td>
</tr>
</table>
</center>
-->
<br>
<body onload="javascript:toggleLevel(1)">
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Generalities</div> </div>
</div><!--header-->
<div class="contents">
<p>The supporting paraphernalia.
</p>
<p>The supporting paraphernalia. </p>
<h1><a class="anchor" id="secGeneralitiesIntro"></a>
Introduction</h1>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<h1><a class="anchor" id="secGeneralitiesNammingConventions"></a>
Namming conventions</h1>
<p>The name of "C macros" are written with lower case letters and underscores (examples : <b>is_a</b>, <b>for_each_cell</b> or <b>end_for</b>) while the name of generic functions and member functions never use the underscore and always start with an Upper case letter (examples : <b>GetUnit</b>, <b>GetMasterCell</b>, <b>IsCalledBy</b>).</p>
<dl class="section remark"><dt>Remarks</dt><dd>When examining <code></code>.h include files for more detailed information you will find member functions which start with an underscore. <b>While being "public" those functions must never be called upon</b>. In principle, only here'after documented functions should be used by the application programmer.</dd></dl>
<h1><a class="anchor" id="secGeneralitiesGetString"></a>
GetString</h1>
<div class="fragment"><div class="line"><span class="keywordtype">string</span> GetString(<span class="keyword">const</span> Object&amp; <span class="keywordtype">object</span>);</div>
<div class="line"><span class="keywordtype">string</span> GetString(<span class="keyword">const</span> Object* <span class="keywordtype">object</span>);</div>
</div><!-- fragment --><p> Thoses generic function allows you to get into a string an explicit description of any kind of <a class="el" href="namespaceHurricane.html" title="The namespace dedicated to Hurricane.">Hurricane</a> object pointer or reference. </p><div class="fragment"><div class="line">ostream&amp; operator&lt;&lt; (ostream&amp; stream, <span class="keyword">const</span> Object&amp; <span class="keywordtype">object</span>);</div>
<div class="line">ostream&amp; operator&lt;&lt; (ostream&amp; stream, <span class="keyword">const</span> Object* <span class="keywordtype">object</span>);</div>
</div><!-- fragment --><p> All <a class="el" href="namespaceHurricane.html" title="The namespace dedicated to Hurricane.">Hurricane</a> objects have printing operators for a reference or a pointer. Those printing operators use the generic function Hurricane::GetString() previously studied.</p>
<h1><a class="anchor" id="secGeneralitiesPredicates"></a>
Predicates</h1>
<p>The <code>bool</code> <code>is_a&lt;Type*&gt;(object)</code> function.</p>
<p>For any kind of <a class="el" href="namespaceHurricane.html" title="The namespace dedicated to Hurricane.">Hurricane</a> 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 <code>&lt;type&gt;</code> as shown in the following example: </p><div class="fragment"><div class="line">DataBase* dataBase = GetDataBase();</div>
<div class="line"> </div>
<div class="line">Library* library = Library::Create(dataBase, <span class="stringliteral">&quot;std&quot;</span>);</div>
<div class="line"> </div>
<div class="line">Cell* cell = Cell::Create(library, <span class="stringliteral">&quot;nand&quot;</span>);</div>
<div class="line"> </div>
<div class="line"><span class="keywordflow">if</span> (is_a&lt;Cell*&gt;(cell)) {</div>
<div class="line"> <span class="comment">// will inevitably go through here</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordflow">if</span> (is_a&lt;Entity*&gt;(cell)) {</div>
<div class="line"> <span class="comment">// will go through here also because Cell derives from Entity</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordflow">if</span> (is_a&lt;Library*&gt;(cell)) {</div>
<div class="line"> <span class="comment">// will never go through here because Cell doesn&#39;t derive from Library</span></div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="secGeneralitiesInheritance"></a>
Inheritance</h1>
<p>All classes deriving directly from a base class define a new type named <b>Inherit</b> which represents this base class. <b>This one is unique because <a class="el" href="namespaceHurricane.html" title="The namespace dedicated to Hurricane.">Hurricane</a> doesn't use multiple inheritance</b>. 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: </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> MyObject::Draw() const</div>
<div class="line"><span class="comment">// ************************</span></div>
<div class="line">{</div>
<div class="line"> Inherit::Draw();</div>
<div class="line"> </div>
<div class="line"> DrawParticularities();</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="secGeneralitiesTraceUtilities"></a>
Trace utilities</h1>
<p>The library provides some usefull utilities for generating trace printings with a natural indentation allowing better understanding of the processing sequences:</p>
<ul>
<li>
<b>Hurricane::in_trace</b> </li>
<li>
<b>Hurricane::trace_on</b> </li>
<li>
<b>Hurricane::trace_off</b> </li>
<li>
<b>Hurricane::trace_in</b> </li>
<li>
<b>Hurricane::trace_out</b> </li>
<li>
<b>Hurricane::trace</b> </li>
</ul>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> MyFunction(MyData* data)</div>
<div class="line"><span class="comment">// **************************</span></div>
<div class="line">{</div>
<div class="line"> trace &lt;&lt; <span class="stringliteral">&quot;entering in MyFunction with &quot;</span> &lt;&lt; data &lt;&lt; endl;</div>
<div class="line"> trace_in();</div>
<div class="line"> </div>
<div class="line"> ...</div>
<div class="line"> </div>
<div class="line"> trace &lt;&lt; <span class="stringliteral">&quot;exiting of MyFunction&quot;</span> &lt;&lt; endl;</div>
<div class="line"> trace_out();</div>
<div class="line">}</div>
</div><!-- fragment --> <dl class="section remark"><dt>Remarks</dt><dd>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...</dd></dl>
<h1><a class="anchor" id="secGeneralitiesRemarks"></a>
Remarks</h1>
<p>Many other global and generic functions exist. Each one will be studied within the description of the classes which create or specialize them (example: <b>Hurricane::GetUnit</b> will be introduced with the Unit class and <b>Hurricane::GetCollection</b> with the <a class="el" href="classHurricane_1_1Collection.html" title="Collection description (API)">Collection</a> class). </p>
</div><!-- contents -->
<br>
<hr>
<table class="footer1">
<tr>
<td class="LFooter"><small>Generated by doxygen 1.9.1 on Tue Feb 21 2023</small></td>
<td class="RFooter"><a href='#pagetop'><small>Return to top of page</small></a></td>
</tr>
</table>
<table class="footer2">
<tr>
<td class="LFooter">Hurricane VLSI Database</td>
<td class="RFooter"><small>Copyright &#169; 2000-2020 Bull S.A. All rights reserved</small></td>
</tr>
</table>
</body>
</html>