|
1 | 1 | # CONTRIBUTION |
2 | 2 |
|
| 3 | +##### COMMENT STYLE |
| 4 | +```c |
| 5 | +/** |
| 6 | +* Describe what method does |
| 7 | +* |
| 8 | +* @param paramName its meaning |
| 9 | +* @param paramName2 its meaning |
| 10 | +* @throw exception and situations it would be thrown |
| 11 | +* @see anotherClassOrMethod they need to reference |
| 12 | +* @return returnDataType describe what will returned |
| 13 | +**/ |
| 14 | +``` |
| 15 | + |
| 16 | +Example: |
| 17 | +```c |
| 18 | +/** |
| 19 | + * A test class. A more elaborate class description. |
| 20 | + */ |
| 21 | +class Javadoc_Test |
| 22 | +{ |
| 23 | + public: |
| 24 | + /** |
| 25 | + * An enum. |
| 26 | + * More detailed enum description. |
| 27 | + */ |
| 28 | + enum TEnum { |
| 29 | + TVal1, /**< enum value TVal1. */ |
| 30 | + TVal2, /**< enum value TVal2. */ |
| 31 | + TVal3 /**< enum value TVal3. */ |
| 32 | + } |
| 33 | + *enumPtr, /**< enum pointer. Details. */ |
| 34 | + enumVar; /**< enum variable. Details. */ |
| 35 | + |
| 36 | + /** |
| 37 | + * A constructor. |
| 38 | + * A more elaborate description of the constructor. |
| 39 | + */ |
| 40 | + Javadoc_Test(); |
| 41 | + |
| 42 | + /** |
| 43 | + * A destructor. |
| 44 | + * A more elaborate description of the destructor. |
| 45 | + */ |
| 46 | + ~Javadoc_Test(); |
| 47 | + |
| 48 | + /** |
| 49 | + * a normal member taking two arguments and returning an integer value. |
| 50 | + * |
| 51 | + * @param a an integer argument. |
| 52 | + * @param s a constant character pointer. |
| 53 | + * @see Javadoc_Test() |
| 54 | + * @see ~Javadoc_Test() |
| 55 | + * @see testMeToo() |
| 56 | + * @see publicVar() |
| 57 | + * @return int The test results |
| 58 | + */ |
| 59 | + int testMe(int a,const char *s); |
| 60 | + |
| 61 | + /** |
| 62 | + * A pure virtual member. |
| 63 | + * |
| 64 | + * @see testMe() |
| 65 | + * @param c1 the first argument. |
| 66 | + * @param c2 the second argument. |
| 67 | + * @throw IllegalArgumentException if c1 is uppercase |
| 68 | + */ |
| 69 | + virtual void testMeToo(char c1,char c2) = 0; |
| 70 | + |
| 71 | + /** |
| 72 | + * a public variable. |
| 73 | + * Details. |
| 74 | + */ |
| 75 | + int publicVar; |
| 76 | + |
| 77 | + /** |
| 78 | + * a function variable. |
| 79 | + * Details. |
| 80 | + */ |
| 81 | + int (*handler)(int a,int b); |
| 82 | +}; |
| 83 | + |
| 84 | +``` |
| 85 | + |
3 | 86 | ##### SHOULD (Test case name must be named in camel syntax) |
4 | 87 | ```c |
5 | 88 | TEST(General, DistributionCountingSort) { |
|
0 commit comments