User Tools

Site Tools


coastalme_coding_standards

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
coastalme_coding_standards [2016/10/23 13:43]
coastalmeadmin
coastalme_coding_standards [2016/10/23 14:41] (current)
coastalmeadmin
Line 31: Line 31:
   * m_strCMEDir: string "str"   * m_strCMEDir: string "str"
   * m_tSysStartTime: time_t "t"   * m_tSysStartTime: time_t "t"
-  *   +  * m_VbConsChangedThisIter: vector boolean "Vb" 
 +  * m_VnProfileToSave: vector integer "Vn" 
 +  * m_VdSliceElev: vector double "Vd" 
 +  * m_VstrInitialFineUnconsSedimentFile: vector string "Vstr" 
 +  * m_VPoints: vector of C2DPoint "VPoints" 
 +  * m_LCoastline: a variable of CLine "L" 
 +  * ... 
  
-An exception to this rule are ofstream type variables being the format of ofstream is VariableNAmeStream +**Pointers** are denoted by a lowercase "p" before the variable type: 
 + 
 +  * m_pRasterGrid: a pointer of a RasterGrid object 
 +  * m_pVCoastPolygon: a pointer to a Vector of CoastPolygons 
 +  * pSim: a pointer to a CSimulation   
 +  * pPtVGetPoints: a pointer to a C2DPoint 
 +  * ... 
 + 
 +An exception to this rule are ofstream type variables being the format of ofstream: **VariableNAmeStream** 
  
 Examples of ofstream variables: Examples of ofstream variables:
Line 42: Line 56:
   * SedLostTSStream   * SedLostTSStream
  
-All class members should be private. Public class members are STRONGLY discouraged+Class members can be public or private.
  
 ===== Accessor Functions ===== ===== Accessor Functions =====
  
  
-Class member values should be obtained through accesssor functions. The function should be named without a get prefix. Accessor functions for the two private members above would be:+Class member values should be obtained through accesssor functions. The function should be named with an indicative prefix (i.e. Set, Get,...). Examples of accessor functions for the private member variable m_dBasementElevation would be:
  
-  * bBeachErosionOrDepositionThisIter(): function with a byte-value return code +  * dGetBasementElev(): function with a double return code 
-  *  +  * SetBasementElev(double const): function to set a double member variable
-===== Functions =====+
  
 +===== Functions =====
  
 Function names begin with a lowercase letter and are formed using mixed case. The function name should convey something about the purpose of the function. Function names begin with a lowercase letter and are formed using mixed case. The function name should convey something about the purpose of the function.
  
-    updateMapExtent() +  * bWriteProfileData() 
-    setUserOptions()+  * nDoAllWaveEnergyToCoastLandforms() 
 +  * ...
  
  
coastalme_coding_standards.txt · Last modified: 2016/10/23 14:41 by coastalmeadmin