root/doc/html/codingrules.html @ 224

Revision 224, 4.3 kB (checked in by smidl, 16 years ago)

doc

Line 
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">
3<title>mixpp: Coding Rules (Mostly inherited from IT++)</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5<link href="tabs.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.5.6 -->
8<div class="navigation" id="top">
9  <div class="tabs">
10    <ul>
11      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
12      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
13      <li><a href="modules.html"><span>Modules</span></a></li>
14      <li><a href="annotated.html"><span>Classes</span></a></li>
15      <li><a href="files.html"><span>Files</span></a></li>
16    </ul>
17  </div>
18</div>
19<div class="contents">
20<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">
21Default Naming Rules for Variables</a></h2>
22Variables are named using lower-case letters and words are separated using under-score. Abbreviations, when used in variable names, are also written with lower-case letters. Examples:<p>
23<ul>
24<li>
25<code>`fft_size'</code>  </li>
26<li>
27<code>`nrof_paths'</code>  </li>
28<li>
29<code>`my_variable_name'</code>  </li>
30</ul>
31<p>
32Some variable names or parts of variable names are commonly used in several different functions and files to denote the same thing. For instance the following common names and prefixes should be used:<p>
33<ul>
34<li>
35<code>`rows'</code> - number of rows in a matrix  </li>
36<li>
37<code>`cols'</code> - number of columns in a matrix  </li>
38<li>
39<code>`nrof_'</code> - number of ...  </li>
40</ul>
41<h2><a class="anchor" name="cr_files">
42Default Naming Rules for Files</a></h2>
43Files are named using lower-case letters and words are separated using under-score. Abbreviations, when used in file names, are also written with lower-case letters.<p>
44Source files are named using <code>`.cpp'</code> suffix, whereas header files end with <code>`.h'</code> extension. Examples:<p>
45<ul>
46<li>
47<code>`my_file.h'</code>  </li>
48<li>
49<code>`my_file.cpp'</code>  </li>
50</ul>
51<h2><a class="anchor" name="cr_functions">
52Default Naming Rules for Functions</a></h2>
53Function 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>
54<ul>
55<li>
56<code>int my_function_name(int a, int b)</code>  </li>
57</ul>
58<h2><a class="anchor" name="cr_specialfunctions">
59Convention for sensitive functions</a></h2>
60For efficiency, some functions may return pointers to internal variables. Such functionality is indicated by underscore as the first letter in the the name.<p>
61<ul>
62<li>
63<code>mat* _internal_matrix()</code>  </li>
64</ul>
65<h2><a class="anchor" name="cr_classes">
66Default Naming Rules for Classes and Structures</a></h2>
67Each new word in a class or structure name should always start with a capital letter and the words should be separated with an under-score. Abbreviations are written with capital letters. Examples:<p>
68<ul>
69<li>
70<code>`My_Class_Name'</code>  </li>
71<li>
72<code>`My_Struct_Name'</code>  </li>
73<li>
74<code>`OFDM'</code>  </li>
75</ul>
76<h2><a class="anchor" name="cr_classes_functionality">
77Default Functionality of Classes</a></h2>
78All classes that are configured by input parameters should include:<p>
79<ul>
80<li>
81default empty constructor  </li>
82<li>
83one or more additional constructor(s) that takes input parameters and initializes the class instance  </li>
84<li>
85setup function, preferably named <code>`setup'</code> or <code>`set_parameters'</code>  </li>
86</ul>
87<p>
88Explicit 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>
89<hr size="1"><address style="text-align: right;"><small>Generated on Mon Jan 5 19:29:12 2009 for mixpp by&nbsp;
90<a href="http://www.doxygen.org/index.html">
91<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
92</body>
93</html>
Note: See TracBrowser for help on using the browser.