diana:diana_codestyle

Differences

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

Link to this comparison view

Next revision
Previous revision
diana:diana_codestyle [2008-12-03 13:49:24]
lisbethb created
— (current)
Line 1: Line 1:
-====== Code style ====== 
  
-  * Code style for Eclipse:[[http://diana.met.no/pu_codestyle.xml|code style]] 
-  * Use single blank lines 
-  * Use doxygen (java or c++) 
-  * Always use downcase in namespace 
-  * Space after semicolon in for-loops etc. 
-  * Space before and after assignment operators 
- 
-... and follow the example below ... 
- 
-<code> 
- 
-namespace metno { 
- 
-const int DEFAULT_NUMBER = 1; 
- 
-/** 
- * A sample source file for the code formatter preview 
- */ 
-class Point { 
-public: 
-  /** 
-   * @param xc bla bla 
-   */ 
-  Point(double xc, double yc) : x(xc), y(yc) { } 
- 
-  Point(double yc) : y(yc)  
-  { 
-    if (true) { 
-       
-    } else if (false) { 
-       
-    } 
-    for (int i = 0; i < yc; ++i) { ///< space etter ; 
-      int j = 0; 
-    } 
- 
-  } 
-   
-  /** 
-   * Description of distance 
-   */ 
-  double distance(const Point& other) const; 
-  int minParam; 
-  double x; ///< a doxygen comment on dx 
-  double y; 
-  char *hello; 
-  Point& p; 
- 
-  /// Enum description 
-  enum MyEnum {ONE, TWO, THREE}; 
- 
-}; 
- 
-double Point::distance(const Point& other) const { 
-  double dx = x - other.x; 
-  LOG4CXX_DEBUG(logger,""); 
-  double dy = y - other.y; // comment 
-  return sqrt(dx * dx + dy * dy); 
-} 
- 
-} // end namespace metno 
- 
-</code> 
  • diana/diana_codestyle.1228312164.txt.gz
  • Last modified: 2022-05-31 09:23:14
  • (external edit)