gstlearn
1.0.0
CCC
|
The Style class contains all the recommended styles considerations. It has no special functionalities.
This is only a template class that developers can mimic.
More...
#include <Style.hpp>
Public Member Functions | |
Style () | |
Style (const Style &r) | |
Style & | operator= (const Style &r) |
virtual | ~Style () |
int | DocumentedStandard (int myArg) const |
int | DocumentedWithFormula (int myArg) const |
int | UnusedArgument (int a) |
double | getArgDouble () const |
int | getArgInt () const |
const VectorDouble & | getArgVectorDouble () const |
const VectorInt & | getArgVectorInt () const |
void | setArgDouble (double argDouble) |
void | setArgInt (int argInt) |
void | setArgVectorDouble (const VectorDouble &argVectorDouble) |
void | setArgVectorInt (const VectorInt &argVectorInt) |
Static Public Member Functions | |
static void | myFunction (int myArgInt, double myArgDoubleDef=2.) |
Private Member Functions | |
int | _increment (int arg) const |
Private Attributes | |
int | _argInt |
Private attribute of type int More... | |
double | _argDouble |
Private attribute of type double More... | |
VectorInt | _argVectorInt |
Private attribute of type VectorInt More... | |
VectorDouble | _argVectorDouble |
Private attribute of type VectorDouble More... | |
The Style class contains all the recommended styles considerations. It has no special functionalities.
This is only a template class that developers can mimic.
This class includes coding rules and doxygen documentation examples.
Since doxygen 1.8.0, Markdown support is available in doxygen comments (see here).
Look at gstlearn READMEs for a quick overview of Markdown syntax.
This class demonstrates:
const
DECLARE_UNUSED
macro (need including geoslib_define.h)DECLARE_UNUSED
)Here are some rules about naming C++ types, functions, variables and symbols:
Here are some coding rules (good practices) for C++ developers:
goto
break
only in switch
casesconst
every whereusing namespace
More good practices available here
Here are some rules regarding constructors and destructors:
Main principles for documenting class methods are the following:
Style::Style | ( | ) |
Default constructor
Always use the initialization list to set the default value of each class member. Put attributes in the same order than their declaration in the C++ header.
Style::Style | ( | const Style & | r | ) |
Copy constructor
Always use the initialization list to set the value of each class member. Put attributes in the same order than their declaration in the C++ header.
|
virtual |
Destructor
Always free pointers and clear the lists of the class
|
private |
Example of a private method
[in] | arg | Input integer argument |
int Style::DocumentedStandard | ( | int | myArg | ) | const |
A method with standard argument documentation
[in] | myArg | Here should be placed the description of this argument |
int Style::DocumentedWithFormula | ( | int | myArg | ) | const |
Documentation with Latex formula
The distance between and is (this formula may need to do this: https://github.com/doxygen/doxygen/issues/7484#issuecomment-572503569)
[in] | myArg | Here should be placed the description of this argument |
|
static |
Description of a static function
[in] | myArgInt | Integer argument |
[in] | myArgDoubleDef | Double argument |
Assignment operator
Always protect from self copy if the if statement
int Style::UnusedArgument | ( | int | a | ) |
A function where the argument is not used (could be the case in abstract methods)
[in] | a | Input argument not used (but documented) |
|
private |
Private attribute of type double
|
private |
Private attribute of type int
|
private |
Private attribute of type VectorDouble
|
private |
Private attribute of type VectorInt