<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6">
  <compounddef id="codingrules" kind="page">
    <compoundname>codingrules</compoundname>
    <title>Coding Rules (Mostly inherited from IT++)</title>
    <detaileddescription>
<para>In the following sections we describe the naming conventions which are used for files, classes, structures, local variables, and global variables.</para><sect1 id="codingrules_1cr_variables">
<title>Default Naming Rules for Variables</title>
<para>Variables 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:</para><para><itemizedlist>
<listitem>
<para><computeroutput>`fft_size&apos;</computeroutput>  </para></listitem>
<listitem>
<para><computeroutput>`nrof_paths&apos;</computeroutput>  </para></listitem>
<listitem>
<para><computeroutput>`my_variable_name&apos;</computeroutput>  </para></listitem>
</itemizedlist>
</para><para>Some 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:</para><para><itemizedlist>
<listitem>
<para><computeroutput>`rows&apos;</computeroutput> - number of rows in a matrix  </para></listitem>
<listitem>
<para><computeroutput>`cols&apos;</computeroutput> - number of columns in a matrix  </para></listitem>
<listitem>
<para><computeroutput>`nrof_&apos;</computeroutput> - number of ...  </para></listitem>
</itemizedlist>
</para></sect1>
<sect1 id="codingrules_1cr_files">
<title>Default Naming Rules for Files</title>
<para>Files 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.</para><para>Source files are named using <computeroutput>`.cpp&apos;</computeroutput> suffix, whereas header files end with <computeroutput>`.h&apos;</computeroutput> extension. Examples:</para><para><itemizedlist>
<listitem>
<para><computeroutput>`my_file.h&apos;</computeroutput>  </para></listitem>
<listitem>
<para><computeroutput>`my_file.cpp&apos;</computeroutput>  </para></listitem>
</itemizedlist>
</para></sect1>
<sect1 id="codingrules_1cr_functions">
<title>Default Naming Rules for Functions</title>
<para>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:</para><para><itemizedlist>
<listitem>
<para><computeroutput>int my_function_name(int a, int b)</computeroutput>  </para></listitem>
</itemizedlist>
</para></sect1>
<sect1 id="codingrules_1cr_specialfunctions">
<title>Convention for sensitive functions</title>
<para>For efficiency, some functions may return pointers to internal variables. Such functionality is indicated by underscore as the first letter in the the name.</para><para><itemizedlist>
<listitem>
<para><computeroutput>mat* _internal_matrix()</computeroutput>  </para></listitem>
</itemizedlist>
</para></sect1>
<sect1 id="codingrules_1cr_classes">
<title>Default Naming Rules for Classes and Structures</title>
<para>Each 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:</para><para><itemizedlist>
<listitem>
<para><computeroutput>`My_Class_Name&apos;</computeroutput>  </para></listitem>
<listitem>
<para><computeroutput>`My_Struct_Name&apos;</computeroutput>  </para></listitem>
<listitem>
<para><computeroutput>`OFDM&apos;</computeroutput>  </para></listitem>
</itemizedlist>
</para></sect1>
<sect1 id="codingrules_1cr_classes_functionality">
<title>Default Functionality of Classes</title>
<para>All classes that are configured by input parameters should include:</para><para><itemizedlist>
<listitem>
<para>default empty constructor  </para></listitem>
<listitem>
<para>one or more additional constructor(s) that takes input parameters and initializes the class instance  </para></listitem>
<listitem>
<para>setup function, preferably named <computeroutput>`setup&apos;</computeroutput> or <computeroutput>`set_parameters&apos;</computeroutput>  </para></listitem>
</itemizedlist>
</para><para>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. </para></sect1>
    </detaileddescription>
  </compounddef>
</doxygen>
