Difference between revisions of "Cpp Coding Standards/ENC"

From Apache OpenOffice Wiki
Jump to: navigation, search
(improve formatting for printing)
Line 1: Line 1:
Topic-Id: '''ENC'''
+
=== Encapsulation (ENC) - Summary ===
 +
''Information hiding in classes. These items are all implementations of the meta rule [[../PRINC#Hide | PRINC:Hide]] - Hide Information.''
  
Information hiding in classes. These items are all implementations of the meta rule [[../Principles#Hide | PRINC:Hide]] - Hide Information.
+
===== Private Data <span id="PrivData">(PrivData)</span> =====
----
+
Make all class member data private. [[/PrivData|-> Details]]
=== Summary ===
+
==== Private Data <span id="PrivData">(PrivData)</span> ====
+
Make all class member data private.
+
 
+
[[/PrivData|Details]]
+
 
+
==== No Friends <span id="NoFriends">(NoFriends)</span> ====
+
Don't use “friend” except for the classical cases like stream operators.
+
 
+
[[/NoFriends|Details]]
+
 
+
==== Keep Internals <span id="Internal">(Internal)</span> ====
+
Don't give out handles to class-internal data.
+
  
[[/Internal|Details]]
+
===== No Friends <span id="NoFriends">(NoFriends)</span> =====
 +
Don't use “friend” except for the classical cases like stream operators. [[/NoFriends|-> Details]]
  
==== Protect <span id="Protect">(Protect)</span> ====
+
===== Keep Internals <span id="Internal">(Internal)</span> =====
Make all functions only to be used by derived classes protected.
+
Don't give out handles to class-internal data. [[/Internal|-> Details]]
  
[[/Protect|Details]]
+
===== Protect <span id="Protect">(Protect)</span> =====
 +
Make all functions only to be used by derived classes protected. [[/Protect|-> Details]]
  
 
----
 
----
 
=== Related Rules ===
 
=== Related Rules ===
* [[../Principles#Hide |PRINC:Hide]] - Hide Information
+
* [[../PRINC#Hide |PRINC:Hide]] - Hide Information
  
 
----
 
----
 
[[Category:Coding Standards]]
 
[[Category:Coding Standards]]

Revision as of 15:52, 22 May 2007

Encapsulation (ENC) - Summary

Information hiding in classes. These items are all implementations of the meta rule PRINC:Hide - Hide Information.

Private Data (PrivData)

Make all class member data private. -> Details

No Friends (NoFriends)

Don't use “friend” except for the classical cases like stream operators. -> Details

Keep Internals (Internal)

Don't give out handles to class-internal data. -> Details

Protect (Protect)

Make all functions only to be used by derived classes protected. -> Details


Related Rules


Personal tools