conventions.txt 763 Bytes
Newer Older
DUFAY Arthur's avatar
DUFAY Arthur committed
1 2
MRF coding conventions

DUFAY Arthur's avatar
DUFAY Arthur committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
Variables:
int variable;
int a_variable_with_multiple_words;

Functions:
void function();
void functionWithMultipleWords();

Const variables:
void func(TYPE const & name_variable) instead of void func(const TYPE & name_variable)

Attributes and classes:
class Test
{
 public:
  void aMethod();
  void aMethodWithMultipleWords();
 private:
  int _a;
  int _another_attribute;
}

File inclusion:
Use #pragma once instead of 
#ifndef FILE_H 
#define FILE_H 
#endif

Indentation:
Install astyle
Use script run_astyle.bat/.sh


Header file:
Start each header file with
/*
*
* author : Romain Pacanowski @ institutoptique.fr
* Copyright CNRS 2016
* Copyright CNRS 2017
*
**/

#pragma once

#include "mrf/mrf_dll.hpp"
#include "mrf/mrf_types.hpp"