-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refresh "Development How-To" section in documentation, move after "Manual" in navtree, refresh style guide info, remove superfluous page. [base] * Including math.h instead of cmath is no longer necessary. [base, combigrid, datadriven, pde, scons] * Try to fix some Windows warnings. [base, datadriven] git-svn-id: https://ipvs.informatik.uni-stuttgart.de/SGpp/repos/trunk@5332 4eea3252-f0fb-4393-894d-40516dce545b
- Loading branch information
Showing
24 changed files
with
124 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,127 @@ | ||
/** | ||
@page development Developer How-Tos | ||
@page development Development How-To | ||
|
||
<div width=60% align=center style="color:#FF0000;">All code has to be documented in such a way that functions, | ||
classes and all other entities appearing in this documentation are easily understandable | ||
for @e all other developers.</div> | ||
On this page, we describe best coding practices for SG++. | ||
|
||
<div style="max-width:40em; padding:1em; margin:1em auto; color:red;"> | ||
All code has to be documented in such a way that functions, | ||
classes, and all other entities appearing in this documentation are easily understandable | ||
for @e all other developers. | ||
</div> | ||
|
||
|
||
|
||
<!-- ############################################################# --> | ||
@section development__overview Overview | ||
- @ref development__unittests (this page) | ||
- @ref development__doxygen (this page) | ||
- @ref development__windows (this page) | ||
- @subpage styleguide | ||
@section development_overview Overview | ||
- @ref development_testing | ||
- @ref development_doxygen | ||
- @ref development_styleguide | ||
|
||
|
||
|
||
<!-- ############################################################# --> | ||
@section development__unittests Testing | ||
@section development_testing Testing | ||
|
||
We have both Python unit tests and unit test based on @c BOOST. They can be found | ||
in the test subdirectory of each module. The @c BOOST unit tests are preferrably | ||
to be used. However, there is some extra functionality in Python which | ||
We have both Boost unit tests (in C++) and Python unit tests. | ||
The tests can be found in the test subdirectory of each module. | ||
New tests should be written preferably with Boost. | ||
However, there is some extra functionality in Python which | ||
can be tested only in Python, of course. | ||
|
||
If you modify existing code, do not forget | ||
to make sure that no new errors are introduced. If you write new | ||
functionalities, do @em always add unit tests for each functionality! | ||
|
||
|
||
|
||
<!-- ############################################################# --> | ||
@section development__doxygen Doxygen | ||
@section development_doxygen Doxygen | ||
|
||
The documentation has to be Doxygen compatible. Doxygen | ||
tags must be used in the Java-style way, i.e. starting with \@. | ||
The documentation has to be Doxygen compatible. | ||
Doxygen tags must be used in the Java-style way, i.e., | ||
starting with <tt>\@</tt>. | ||
|
||
During development tags like \@todo should be used wherever applicable. They | ||
are then listed on the @link todo ToDo@endlink-page. | ||
During development tags like <tt>\@todo</tt> should be used wherever applicable. | ||
They are then listed on the @ref todo "Todo page". | ||
|
||
Different source files can be grouped together in so-called modules. The | ||
link to the page listing all modules can be found in the navigation | ||
bar of the documentation. | ||
Different source files can be grouped together in so-called modules. | ||
The link to the @ref modules "page listing all modules" | ||
can be found in the navigation bar of the documentation. | ||
Note that this page and the @ref examples "page listing all examples" | ||
are autogenerated when running SCons. | ||
|
||
Please correct any warnings or errors that appear when creating the | ||
documentation with doxygen! | ||
documentation with Doxygen! | ||
|
||
@sa <a href="http://www.stack.nl/~dimitri/doxygen/manual.html" | ||
target="_blank">Doxygen manual</a> | ||
@sa <a href="http://www.stack.nl/~dimitri/doxygen/docblocks.html" | ||
target="_blank">Documenting the code with Doxygen</a> | ||
@sa <a href="http://www.stack.nl/~dimitri/doxygen/commands.html" | ||
target="_blank">Special Doxygen commands</a> | ||
|
||
@subsection development_doxygen_usage Usage | ||
|
||
Executing <tt>doxygen</tt> in the main folder creates the | ||
Doxygen documentation in the subfolder <tt>doc</tt>. | ||
The settings for Doxygen are taken from <tt>Doxyfile</tt>. | ||
This file is automatically created based on <tt>Doxyfile_template</tt> | ||
each time @c scons is exectued, | ||
therefore, for modifications, please change <tt>Doxyfile_template</tt> instead. | ||
|
||
@sa Doxygen Manual http://www.stack.nl/~dimitri/doxygen/manual.html | ||
@sa Documenting the code http://www.stack.nl/~dimitri/doxygen/docblocks.html | ||
@sa Special Commands http://www.stack.nl/~dimitri/doxygen/commands.html | ||
|
||
|
||
<!-- ############################################################# --> | ||
@section development__windows Windows compatibility issues | ||
|
||
- \b externals: external variables have been used to specify singletons | ||
in some SG++ packages (base, optimization). To make the declaration | ||
and platform independent one needs to add a preprocessor directive, | ||
which distinguishes if one tries to build a static or a dynamic | ||
library. In <tt>ClenshawCurtisTable.hpp</tt> this looks like | ||
@verbatim | ||
#if defined _WIN32 && !defined _USE_STATICLIB | ||
extern __declspec(dllimport) ClenshawCurtisTable clenshawCurtisTable; | ||
#else | ||
extern ClenshawCurtisTable clenshawCurtisTable; | ||
#endif | ||
@endverbatim | ||
|
||
-\b cmath: the cplusplus way to use constants like <tt>M_PI</tt> is to include | ||
the <tt>cmath</tt> header. Well, this does not work on windows. To | ||
access them you need to include the old <tt>math.h</tt> header and | ||
define the additional symbol <tt>_D_MATH_DEFINES</tt>. The latter | ||
part is done by scons automatically. | ||
|
||
<!-- ============================================================= --> | ||
@subsection development__doxygen__howto How to run, use and customize | ||
@section development_styleguide Style Guide | ||
|
||
Compliance with the style guide is important to write good code. | ||
A style guide is more than a bunch of indentation rules; | ||
rather, it is the art of creating easily reusable, understandable, and | ||
refactorable code. | ||
|
||
@subsection development_styleguide_comments Comments | ||
|
||
The complete code has to be commented elaborately. | ||
The comments, together with the identifiers, have to enable others to | ||
familiarize with the code quickly. | ||
Header files have to be commented completely. | ||
In source files, it suffices to comment the codelines. | ||
The comments have to be verbose enough so that one can understand what is | ||
going on without reading the code! | ||
Please use Doxygen-compatible comments for classes and methods. | ||
|
||
@subsection development_styleguide_style Style | ||
|
||
We adhere mostly to the | ||
<a href="https://google.github.io/styleguide/cppguide.html" target="_blank"> | ||
Google C++ Style Guide</a>. | ||
However, there are some exceptions, e.g., | ||
the indentation of namespaces. | ||
The SG++ code style is defined by a set of | ||
<a href="http://astyle.sourceforge.net/" target="_blank">astyle</a> | ||
parameters. | ||
It can be found in the file <tt>tools/astylerc</tt>. | ||
|
||
@subsection development_styleguide_naming Naming | ||
|
||
Naming: | ||
- Directories: all lowercase, underscore separated | ||
(e.g., <tt>test_problem</tt>) | ||
- Classes: camel case starting uppercase | ||
(e.g., <tt>GridStorage</tt>) | ||
- Functions, Methods, Variables: camel case starting lowercase | ||
(e.g., <tt>getLevel</tt>) | ||
- Constants, Defines: all uppercase, underscore separated | ||
(e.g., <tt>INITIAL_LEVEL</tt>) | ||
- Nothing starts with underscores (only system/builtin/compiler). | ||
|
||
Don't… | ||
- … include <tt>sgpp_MODULENAME.hpp</tt>. | ||
Only include the header files you require to avoid long building durations. | ||
- … use <tt>using namespace</tt>. | ||
- … use tabs, use two spaces instead! | ||
Please configure your editor in order to do so! | ||
|
||
Executing <tt>doxygen</tt> in the main folder creates the | ||
Doxygen-documentation in the subfolder <tt>doc</tt>. The settings | ||
for Doxygen are automatically taken from the file | ||
<tt>Doxyfile</tt>. It is automatically created based on @c Doxyfile.template | ||
each time @c scons is exectued. | ||
*/ | ||
|
||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.