Created
April 22, 2013 11:47
-
-
Save anonymous/5434187 to your computer and use it in GitHub Desktop.
Example of using Doxygen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ExampleClass.h" | |
namespace example | |
{ | |
ExampleClass::ExampleClass() : | |
x_(0), | |
y_(0) | |
{} | |
ExampleClass::~ExampleClass() | |
{} | |
void ExampleClass::swap(int& x, int& y) | |
{ | |
int temp; | |
temp = y; | |
y = x; | |
x = temp; | |
} | |
int ExampleClass::add(int x, int y) | |
{ | |
return x + y; | |
} | |
void ExampleClass::add(int x, int y, int& z) | |
{ | |
z = x + y; | |
} | |
int ExampleClass::add() | |
{ | |
return x_ + y_; | |
} | |
void ExampleClass::add(int& z) | |
{ | |
z = x_ + y_; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clearly with no documentation it is difficult to read | |
// and understand the intention of this class. | |
// At best one can make guesses based off experience and context | |
#ifndef EXAMPLE_CLASS_H_ | |
#define EXAMPLE_CLASS_H_ | |
namespace example | |
{ | |
class ExampleClass | |
{ | |
public: | |
ExampleClass(); | |
~ExampleClass(); | |
void swap(int& x, int& y); | |
int add(int x, int y); | |
void add(int x, int y, int& z); | |
int add(); | |
void add(int& z); | |
private: | |
int x_; | |
int y_; | |
}; | |
} | |
#endif // EXAMPLE_CLASS_H_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment