-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcoding_guidelines.cpp
81 lines (62 loc) · 2.29 KB
/
coding_guidelines.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef NAMESPACE_NAMES_THEN_PRIMARY_CLASS_OR_FUNCTION_THEN_HPP
#define NAMESPACE_NAMES_THEN_PRIMARY_CLASS_OR_FUNCTION_THEN_HPP
#include <boost/headers/go/first>
#include <boost/in_alphabetical/order>
#include <then_standard_headers>
#include <in_alphabetical_order>
#include "then/any/detail/headers"
#include "in/alphabetical/order"
#include "then/any/remaining/headers/in"
#include "alphabetical/order/duh"
#define NAMESPACE_NAMES_THEN_MACRO_NAME(p_macroNames) ARE_ALL_CAPS
namespace NameSpaceInCamelCase
{
class ClassesAreAlsoCamels
{
/*##############################################################################
# PUBLIC FUNCTIONS
##############################################################################*/
public:
void functionsUsePascalCase() const
{
volatile int localVariablesUsePascalCase = 0;
}
const complex_type& memberVariable() const
{
return m_memberVariable; // no conflict with value here
}
void setMemberVariable(const SomeType& p_parameterVariable)
{
m_memberVariable = p_parameterVariable; // or here
}
/*##############################################################################
# PUBLIC MEMBERS
##############################################################################*/
public:
int m_iAmAPublicMember;
// the more public it is, the more important it is,
// so order: public on top, then protected then private
/*******************************************************************************
* PROTECTED FUNCTIONS
*******************************************************************************/
protected:
template <typename Template, typename Parameters>
void areCamelCase()
{
// ...
}
/*******************************************************************************
* PROTECTED MEMBERS
*******************************************************************************/
protected:
/*------------------------------------------------------------------------------
| PRIVATE FUNCTIONS
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
| PRIVATE MEMBERS
------------------------------------------------------------------------------*/
private:
SomeType m_memberVariable;
};
}
#endif