C++程序规范

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/WilliamYuYuYu/article/details/78790392

思飞工作室2017-C/C++程序规范

V 1.1

[ 一 ] 版权声明

1.Copyright版权声明

团队声明

/*=================================================================================
 *                                  XXXXX.c --
 *                     Copyright © 2017 HUST ThinkFly Studio
 *                             All Rights Reserved
 *                     Copyright © 2017 华中科技大学思飞工作室
 *                                  版权所有
 *
 * Filename                : XXXXX.c
 * Description             : 
 * Reference               : 
 * Programmer(s)           : William Yu, windmillyucong@163.com
 * Company                 : HUST, ThinkFly Studio
 * Modification History    : ver1.0, 201X.XX.XX, XXX
 *                           ver1.1, 201X.XX.XX, XXX XX add notes             
=================================================================================*/

个人声明

/*=================================================================================
 *                                 XXXXX.c --
 *                       Copyright © 2017 William Yu
 *                           All Rights Reserved
 *                       Copyright © 2017 William Yu
 *                                 版权所有
 *
 * Filename                : XXXXX.c
 * Description             :
 * Reference               :
 * Programmer(s)           : William Yu, windmillyucong@163.com
 * Company                 : HUST, ThinkFly Studio
 * Modification History    : ver1.0, 201X.XX.XX, William Yu
 *                           ver1.1, 201X.XX.XX, William Yu add notes             
=================================================================================*/
2.Copyleft版权声明

团队声明

/*=================================================================================
 *                           XXXXX.c --
 *              Copyleft! 2017 HUST ThinkFly Studio
 *        Some rights reserved:CC(creativecommons.org)BY-NC-SA
 *              Copyleft! 2017 华中科技大学思飞工作室
 *    版权部分所有,遵循CC(creativecommons.org)BY-NC-SA协议授权方式使用
 *
 * Filename                : XXXXX.c
 * Description             : 
 * Reference               : 
 * Programmer(s)           : William Yu, windmillyucong@163.com
 * Company                 : HUST, ThinkFly Studio
 * Modification History    : ver1.0, 201X.XX.XX, William Yu
 *                           ver1.1, 201X.XX.XX, William Yu add notes            
=================================================================================*/

个人声明

/*=================================================================================
 *                          XXXXX.c--
 *                  Copyleft! 2017 William Yu
 *          Some rights reserved:CC(creativecommons.org)BY-NC-SA
 *                  Copyleft! 2017 William Yu
 *      版权部分所有,遵循CC(creativecommons.org)BY-NC-SA协议授权方式使用
 *
 * Filename                : 
 * Description             : (编译环境:OpenCV2.4.9+VS2013)                          
 * Reference               : 
 * Programmer(s)           : William Yu, windmillyucong@163.com
 * Company                 : HUST, ThinkFly Studio
 * Modification History    : ver1.0, 201X.XX.XX, William Yu

=================================================================================*/

[二] 全局变量

/// Global Variables

[三] 函数声明

/// Function headers 
/*Description*/
your function header
/*Description*/
your function header

[四] 函数定义

///Function definitions
/**
 * @function
 * @brief
 * @author
 */
 your function A
 /**
 * @function
 * @brief
 * @author
 */
 your function B

[五] 改动和添加

(先在标题Modification History处注明改动人/日期/等信息)

1.程序交流
//---以下是我修改的---------------------
//---以上是我修改的------------------
//---以下是我添加的---------------------
//---以上是我添加的------------------
2.程序改动
///2018.01.01添加
///2018.01.01改动

[六] 代码注解

1.一级分段
//---------------------------------------------------------------------------
//  这里添加注解
//----------------------------------------------------------------
2.二级分段
//[1]这里添加注解
3.三级标注
//

[附件1] 示例

1.头文件include_all.h
#ifndef INCLUDE_ALL_H
#define INCLUDE_ALL_H

#include <opencv.hpp>
#include <iostream>
#include <cmath>

using namespace std;
using namespace cv;


#endif // !INCLUDE_ALL_H
2.头文件function_declare.h
#ifndef FUNCTION_DECLARE_H
#define FUNCTION_DECLARE_H

#include "include_all.h"

/// Global Variables
const int NUMBER = 10;
...

/// Function headers 
/*获取随机点*/
void get_Random_points(vector<cv::Point>& Random_points);
/*查找形心*/
int get_centroid(vector<Point> & Points, vector<Point> & Points_checked);
/*测试函数*/
void test_function(vector<cv::Point>& number)
...

#endif // !FUNCTION_DECLARE_H
3.主函数main.cpp
/*=================================================================================
 *                                  main.c --
 *                     Copyright © 2017 HUST ThinkFly Studio
 *                             All Rights Reserved
 *                     Copyright © 2017 华中科技大学思飞工作室
 *                                  版权所有
 *
 * Filename                : main.c
 * Description             : build with opencv3.3
 * Reference               : 
 * Programmer(s)           : William Yu, windmillyucong@163.com
 * Company                 : HUST, ThinkFly Studio
 * Modification History    : ver1.0, 2017.10.24, William Yu
 *                           ver1.1, 2017.11.11, William Yu add notes             
=================================================================================*/
#include"function_declare.h"

 /**
 * @function main
 * @brief test code
 * @author Wiliam Yu
 */
int main(int argc, char** argv)
{
    ...

    ///2018.01.01添加
    ...
    ///2018.01.01改动
    ...

    return 0;
}
4.get_Random_points.cpp
#include"function_declare.h"

/// Function definitions
/**
* @function get_Random_points
* @brief 获取随机点
* @author Wiliam Yu
*/
void get_Random_points(vector<cv::Point>& Random_points)
{
    ...
}
/**
* @function test_function
* @brief 测试函数
* @author Wiliam Yu
*/
void test_function(vector<cv::Point>& number)
{
    ...
}

(2017.11.23-V1.0-不完全版-ThinkflyStudio-WilliamYu)

(2017.11.26-V1.1-不完全版-ThinkflyStudio-WilliamYu)

阅读更多

没有更多推荐了,返回首页