COIN-OR::LEMON - Graph Library

source: lemon-0.x/doc/coding_style.dox @ 2166:c67e8b928a95

Last change on this file since 2166:c67e8b928a95 was 2157:f9171bfc7ebb, checked in by Alpar Juttner, 14 years ago
  • Doc improvements
  • rot180() added to xy.h
File size: 2.2 KB
Line 
1/*!
2
3\page coding_style LEMON Coding Style
4
5\section naming_conv Naming Conventions
6
7In order to make development easier we have made some conventions
8according to coding style. These include names of types, classes,
9functions, variables, constants and exceptions. If these conventions
10are met in one's code then it is easier to read and maintain
11it. Please comply with these conventions if you want to contribute
12developing LEMON library.
13
14\note When the coding style requires the capitalization of an abbreviation,
15only the first letter should be upper case.
16
17\code
18XmlReader
19\endcode
20
21
22\warning In some cases we diverge from these rules.
23This primary done because STL uses different naming convention and
24in certain cases
25it is beneficial to provide STL compatible interface.
26
27\subsection cs-files File Names
28
29The header file names should look like the following.
30
31\code
32header_file.h
33\endcode
34
35Note that all standard LEMON headers are located in the \c lemon subdirectory,
36so you should include them from C++ source like this:
37
38\code
39#include <lemon/header_file.h>
40\endcode
41
42The source code files use the same style and they have '.cc' extension.
43
44\code
45source_code.cc
46\endcode
47
48\subsection cs-class Classes and other types
49
50The name of a class or any type should look like the following.
51
52\code
53AllWordsCapitalizedWithoutUnderscores
54\endcode
55
56\subsection cs-func Methods and other functions
57
58The name of a function should look like the following.
59
60\code
61firstWordLowerCaseRestCapitalizedWithoutUnderscores
62\endcode
63
64\subsection cs-funcs Constants, Macros
65
66The names of constants and macros should look like the following.
67
68\code
69ALL_UPPER_CASE_WITH_UNDERSCORES
70\endcode
71
72\subsection cs-loc-var Class and instance member variables, auto variables
73
74The names of class and instance member variables and auto variables (=variables used locally in methods) should look like the following.
75
76\code
77all_lower_case_with_underscores
78\endcode
79
80\subsection cs-excep Exceptions
81
82When writing exceptions please comply the following naming conventions.
83
84\code
85ClassNameEndsWithException
86\endcode
87
88or
89
90\code
91ClassNameEndsWithError
92\endcode
93
94\section header-template Template Header File
95
96Each LEMON header file should look like this:
97
98\include template.h
99
100*/
Note: See TracBrowser for help on using the repository browser.