COIN-OR::LEMON - Graph Library

source: lemon-0.x/doc/coding_style.dox @ 1187:04e5825000c5

Last change on this file since 1187:04e5825000c5 was 1083:8043b93e5973, checked in by Alpar Juttner, 20 years ago

Doc improvements

File size: 2.0 KB
RevLine 
[507]1/*!
2
[921]3\page coding_style LEMON Coding Style
[507]4
[811]5\section naming_conv Naming Conventions
[507]6
[667]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
[921]12developing LEMON library.
[603]13
[955]14\warning In some cases we diverge from these rules.
15This primary done because STL uses different naming convention and
16in certain cases
17it is beneficial to provide STL compatible interface.
18
19\subsection cs-files File Names
20
21The header file names should look like the following.
22
23\code
24header_file.h
25\endcode
26
[1083]27Note that all standard LEMON headers are located in the \c lemon subdirectory,
[955]28so you should include them from C++ source like this:
29
30\code
31#include <lemon/header_file.h>
32\endcode
33
34The source code files use the same style and they have '.cc' extension.
35
36\code
37source_code.cc
38\endcode
39
[614]40\subsection cs-class Classes and other types
[603]41
[955]42The name of a class or any type should look like the following.
[507]43
44\code
45AllWordsCapitalizedWithoutUnderscores
46\endcode
47
[614]48\subsection cs-func Methods and other functions
[603]49
[955]50The name of a function should look like the following.
[507]51
52\code
53firstWordLowerCaseRestCapitalizedWithoutUnderscores
54\endcode
55
[614]56\subsection cs-funcs Constants, Macros
[603]57
[955]58The names of constants and macros should look like the following.
[507]59
60\code
61ALL_UPPER_CASE_WITH_UNDERSCORES
62\endcode
63
[614]64\subsection cs-loc-var Class and instance member variables, auto variables
[507]65
[955]66The names of class and instance member variables and auto variables (=variables used locally in methods) should look like the following.
[507]67
68\code
69all_lower_case_with_underscores
70\endcode
71
[614]72\subsection cs-excep Exceptions
[507]73
[955]74When writing exceptions please comply the following naming conventions.
[603]75
[507]76\code
77ClassNameEndsWithException
78\endcode
79
[991]80\section header-template Template Header File
81
[1083]82Each LEMON header file should look like this:
[991]83
84\include template.h
85
[507]86*/
Note: See TracBrowser for help on using the repository browser.