Changes between Version 14 and Version 15 of CodingGuidelines
- Timestamp:
- Mar 29, 2012, 10:56:42 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CodingGuidelines
v14 v15 12 12 * identate by two spaces, never tabs 13 13 * Code Style from Eclipse, see [attachment:ESPACK_codestyle.xml]: 14 15 === Declaration file === #style-file-declaration 16 17 Your declaration file should: 18 * contain all documentation (this is what the user may see in the code, never the implementation) 19 * contain include of config.h as very first 20 * always be properly bracketed in __uniquely__ name preprocessor defines to avoid double inclusion. 21 14 22 {{{ 15 23 /* 16 * A sample source file for the code formatter preview 17 */ 18 #include <math.h> 19 24 * Point.hpp 25 * 26 * Created on: <creation date> 27 * Author: <author> 28 */ 29 30 #ifndef POINT_HPP_ 31 #define POINT_HPP_ 32 33 // include config.h 34 #ifdef HAVE_CONFIG_H 35 #include <config.h> 36 #endif 37 38 /** Point is an implementation of a point in 2D space. 39 * 40 * With this we have a distance measure between two given coordinates. 41 */ 20 42 class Point 21 43 { 22 44 public: 45 /** Constructor for class Point. 46 * @param xc x coordinate 47 * @param yc y coordinate 48 */ 23 49 Point(double xc, double yc) : 24 50 x(xc), y(yc) 25 { 26 } 51 {} 52 53 /** Returns distance to another Point \a other. 54 * 55 * @param other other Point 56 * @return relative euclidian distance to \a other 57 */ 27 58 double distance(const Point& other) const; 28 59 60 //!> internal x coordinate of this Point 29 61 double x; 62 //!> internal y coordinate of this Point 30 63 double y; 31 64 }; 65 66 #endif /* POINT_HPP_ */ 67 }}} 68 69 === Definition file === #style-file-definition 70 71 Your definition file should: 72 * contain a disclaimer with copyright, the year is initially the current one and should be extended whenever the file is edited again. 73 * include first config.h then !MemDebug.hpp, then your specific header file of this implementation, then all others 74 75 {{{ 76 /* 77 * Project: MoleCuilder 78 * Description: creates and alters molecular systems 79 * Copyright (C) 2010-2012 University of Bonn. All rights reserved. 80 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. 81 */ 82 83 /* 84 * \file Point.cpp 85 * 86 * This file contains Point definition. 87 * 88 * Created on: <creation date> 89 * Author: <author> 90 */ 91 92 // include config.h 93 #ifdef HAVE_CONFIG_H 94 #include <config.h> 95 #endif 96 97 // always have the MemDebug first 98 #include "CodePatterns/MemDebug.hpp" 99 100 // then following by include of respective header file (without path) 101 #include "Point.hpp" 102 103 // then other includes 104 ... 105 #include <math.h> 106 ... 32 107 33 108 double Point::distance(const Point& other) const