Show
Ignore:
Timestamp:
10/12/09 13:49:39 (15 years ago)
Author:
mido
Message:

\doc directory cleaned a bit

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/html/codingrules.html

    r641 r651  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    2 <html xmlns="http://www.w3.org/1999/xhtml"> 
    3 <head> 
    4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 
     1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
     2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
    53<title>mixpp: Coding Rules (Mostly inherited from IT++)</title> 
    6 <link href="tabs.css" rel="stylesheet" type="text/css"/> 
    7 <link href="doxygen.css" rel="stylesheet" type="text/css"/> 
    8 </head> 
    9 <body> 
    10 <!-- Generated by Doxygen 1.6.1 --> 
     4<link href="tabs.css" rel="stylesheet" type="text/css"> 
     5<link href="doxygen.css" rel="stylesheet" type="text/css"> 
     6</head><body> 
     7<!-- Generated by Doxygen 1.5.9 --> 
    118<script type="text/javascript"> 
    129<!-- 
     
    6360</div> 
    6461<div class="contents"> 
    65  
    66  
    67 <h1><a class="anchor" id="codingrules">Coding Rules (Mostly inherited from IT++) </a></h1><p>In the following sections we describe the naming conventions which are used for files, classes, structures, local variables, and global variables.</p> 
    68 <h2><a class="anchor" id="cr_variables"> 
     62<h1><a class="anchor" name="codingrules">Coding Rules (Mostly inherited from IT++) </a></h1>In the following sections we describe the naming conventions which are used for files, classes, structures, local variables, and global variables.<h2><a class="anchor" name="cr_variables"> 
    6963Default Naming Rules for Variables</a></h2> 
    70 <p>Generally, variables are named using lower-case letters and words are separated using under-score. But there are many exceptions, for instance abbreviations or classical matematical notations. Therefore, coding rules for variables are quite free. Examples:</p> 
     64Generally, variables are named using lower-case letters and words are separated using under-score. But there are many exceptions, for instance abbreviations or classical matematical notations. Therefore, coding rules for variables are quite free. Examples:<p> 
    7165<ul> 
    7266<li> 
     
    7771<code>`my_variable'</code>  </li> 
    7872</ul> 
    79 <h2><a class="anchor" id="cr_files"> 
     73<h2><a class="anchor" name="cr_files"> 
    8074Default Naming Rules for Files</a></h2> 
    81 <p>Files are named using lower-case letters and words are separated using under-score. If an abbreviation is inevitable within file name, it is written with lower-case letters.</p> 
    82 <p>Source files are named using <code>`.cpp'</code> suffix, whereas header files end with <code>`.h'</code> extension. Examples:</p> 
     75Files are named using lower-case letters and words are separated using under-score. If an abbreviation is inevitable within file name, it is written with lower-case letters.<p> 
     76Source files are named using <code>`.cpp'</code> suffix, whereas header files end with <code>`.h'</code> extension. Examples:<p> 
    8377<ul> 
    8478<li> 
     
    8781<code>`user_info.cpp'</code>  </li> 
    8882</ul> 
    89 <h2><a class="anchor" id="cr_file_templates"> 
     83<h2><a class="anchor" name="cr_file_templates"> 
    9084Form of the source files</a></h2> 
    91 <p>For all the library classes, both header file `[filename].h' and source file `[filename].cpp' should be implemented. And the following few rules should be respected</p> 
     85For all the library classes, both header file `[filename].h' and source file `[filename].cpp' should be implemented. And the following few rules should be respected<p> 
    9286<ul> 
    9387<li> 
    94 <p class="startli">if possible, each `#include ... ' dircetive should be located within the `.h' file, one obvious exception is the case of `#include "[filename].h"' written in `[filename].cpp' </p> 
    95 <p class="endli"></p> 
     88if possible, each `#include ... ' dircetive should be located within the `.h' file, one obvious exception is the case of `#include "[filename].h"' written in `[filename].cpp' <p> 
    9689</li> 
    9790<li> 
    98 <p class="startli">firstly, system headers should be included (i.e. those with brackets `#include &lt;system_header_name&gt;'), other headers (like `#include "my_header_name.h"') should follow (this rule leads to the faster search of an error on some compilators) </p> 
    99 <p class="endli"></p> 
     91firstly, system headers should be included (i.e. those with brackets `#include &lt;system_header_name&gt;'), other headers (like `#include "my_header_name.h"') should follow (this rule leads to the faster search of an error on some compilators) <p> 
    10092</li> 
    10193<li> 
    102 <p class="startli">source code itself should be placed in the `.cpp' file, `.h' should contains only class declarations and documentation (this rule has a few exceptions like inline functions, templates and some extremely short function bodies)</p> 
    103 <p class="endli"></p> 
     94source code itself should be placed in the `.cpp' file, `.h' should contains only class declarations and documentation (this rule has a few exceptions like inline functions, templates and some extremely short function bodies)<p> 
    10495</li> 
    10596</ul> 
    106 <p>Rules considering formatting of the source code itself are stored in the file /system/astylerc, which is a configuration file for code formating utility named ASTYLE. To apply them, download the proper version from its web page <a href="http://astyle.sourceforge.net/">http://astyle.sourceforge.net/</a></p> 
    107 <h2><a class="anchor" id="cr_functions"> 
     97<p> 
     98Rules considering formatting of the source code itself are stored in the file /system/astylerc, which is a configuration file for code formating utility named ASTYLE. To apply them, download the proper version from its web page <a href="http://astyle.sourceforge.net/">http://astyle.sourceforge.net/</a><h2><a class="anchor" name="cr_functions"> 
    10899Default Naming Rules for Functions</a></h2> 
    109 <p>Function names are named using lower-case letters and words are separated using under-score. Abbreviations, when used in function names, are also written with lower-case letters. This rule applies both to stand-alone functions as well as to member functions of classes. Example:</p> 
     100Function names are named using lower-case letters and words are separated using under-score. Abbreviations, when used in function names, are also written with lower-case letters. This rule applies both to stand-alone functions as well as to member functions of classes. Example:<p> 
    110101<ul> 
    111102<li> 
    112103<code>int my_function_name(int a, int b)</code>  </li> 
    113104</ul> 
    114 <h2><a class="anchor" id="cr_specialfunctions"> 
     105<h2><a class="anchor" name="cr_specialfunctions"> 
    115106Convention for sensitive functions</a></h2> 
    116 <p>For efficiency, some functions may return pointers to internal variables. Such functionality is indicated by underscore as the first letter in the the name.</p> 
     107For efficiency, some functions may return pointers to internal variables. Such functionality is indicated by underscore as the first letter in the the name.<p> 
    117108<ul> 
    118109<li> 
    119110<code>mat* _internal_matrix()</code>  </li> 
    120111</ul> 
    121 <h2><a class="anchor" id="cr_classes"> 
     112<h2><a class="anchor" name="cr_classes"> 
    122113Default Naming Rules for Classes and Structures</a></h2> 
    123 <p>Each new word in a class or structure name should always start with a capital letter and the words should not be separated. Abbreviations are written with capital letters. Examples:</p> 
     114Each new word in a class or structure name should always start with a capital letter and the words should not be separated. Abbreviations are written with capital letters. Examples:<p> 
    124115<ul> 
    125116<li> 
     
    130121<code>`OFDM'</code>  </li> 
    131122</ul> 
    132 <h2><a class="anchor" id="cr_classes_functionality"> 
     123<h2><a class="anchor" name="cr_classes_functionality"> 
    133124Default Functionality of Classes</a></h2> 
    134 <p>All classes that are configured by input parameters should include:</p> 
     125All classes that are configured by input parameters should include:<p> 
    135126<ul> 
    136127<li> 
     
    141132setup function, preferably named <code>`setup'</code> or <code>`set_parameters'</code>  </li> 
    142133</ul> 
    143 <p>Explicit destructor functions are not required, unless they are needed. It shall not be possible to use any of the other member functions unless the class has been properly initiated with the input parameters. </p> 
    144 </div> 
    145 <hr size="1"/><address style="text-align: right;"><small>Generated on Sun Sep 27 00:49:05 2009 for mixpp by&nbsp; 
     134<p> 
     135Explicit destructor functions are not required, unless they are needed. It shall not be possible to use any of the other member functions unless the class has been properly initiated with the input parameters. </div> 
     136<hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 17:34:44 2009 for mixpp by&nbsp; 
    146137<a href="http://www.doxygen.org/index.html"> 
    147 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> 
     138<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> 
    148139</body> 
    149140</html>