root/doc/html/codingrules.html @ 79

Revision 79, 4.2 kB (checked in by smidl, 17 years ago)

oprava dokumentace

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.3 -->
8<div class="tabs">
9  <ul>
10    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11    <li><a href="annotated.html"><span>Classes</span></a></li>
12    <li><a href="files.html"><span>Files</span></a></li>
13    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
14  </ul>
15</div>
16<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">
17Default Naming Rules for Variables</a></h2>
18Variables 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>
19<ul>
20<li>
21<code>`fft_size'</code>  </li>
22<li>
23<code>`nrof_paths'</code>  </li>
24<li>
25<code>`my_variable_name'</code>  </li>
26</ul>
27<p>
28Some 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>
29<ul>
30<li>
31<code>`rows'</code> - number of rows in a matrix  </li>
32<li>
33<code>`cols'</code> - number of columns in a matrix  </li>
34<li>
35<code>`nrof_'</code> - number of ...  </li>
36</ul>
37<h2><a class="anchor" name="cr_files">
38Default Naming Rules for Files</a></h2>
39Files 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>
40Source files are named using <code>`.cpp'</code> suffix, whereas header files end with <code>`.h'</code> extension. Examples:<p>
41<ul>
42<li>
43<code>`my_file.h'</code>  </li>
44<li>
45<code>`my_file.cpp'</code>  </li>
46</ul>
47<h2><a class="anchor" name="cr_functions">
48Default Naming Rules for Functions</a></h2>
49Function 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>
50<ul>
51<li>
52<code>int my_function_name(int a, int b)</code>  </li>
53</ul>
54<h2><a class="anchor" name="cr_specialfunctions">
55Convention for sensitive functions</a></h2>
56For efficiency, some functions may return pointers to internal variables. Such functionality is indicated by underscore as the first letter in the the name.<p>
57<ul>
58<li>
59<code>mat* _internal_matrix()</code>  </li>
60</ul>
61<h2><a class="anchor" name="cr_classes">
62Default Naming Rules for Classes and Structures</a></h2>
63Each 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>
64<ul>
65<li>
66<code>`My_Class_Name'</code>  </li>
67<li>
68<code>`My_Struct_Name'</code>  </li>
69<li>
70<code>`OFDM'</code>  </li>
71</ul>
72<h2><a class="anchor" name="cr_classes_functionality">
73Default Functionality of Classes</a></h2>
74All classes that are configured by input parameters should include:<p>
75<ul>
76<li>
77default empty constructor  </li>
78<li>
79one or more additional constructor(s) that takes input parameters and initializes the class instance  </li>
80<li>
81setup function, preferably named <code>`setup'</code> or <code>`set_parameters'</code>  </li>
82</ul>
83<p>
84Explicit 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. <hr size="1"><address style="text-align: right;"><small>Generated on Fri Apr 18 11:15:16 2008 for mixpp by&nbsp;
85<a href="http://www.doxygen.org/index.html">
86<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
87</body>
88</html>
Note: See TracBrowser for help on using the browser.