/// This is the head comment of a file.

 /*************************************************************************
*\CopyRight: 2015.9.21-NOW,Feel free to use and modify those codes. And
any modifications or copies shall remain these sentence for the purpose
of further development and code sharing.
*\Module/Sys: [M]/[S]Test
*\Version: 1.0.0.0
*\Description:Use for the describ of the functions of the file.
*\Author: CityForNaive
*\Date: 2015.9.21
*\History: <Date> <Dev> <Behavior>
*\ 2015.9.21 CityForNaive Build.
*************************************************************************/ #pragma once /// Use this as first option. #ifndef _COMMENT_H_
#define _COMMENT_H_
#endif // _COMMENT_H_ /// Comments of the definations as follow. #define _TEST_SUCCEED 1 /** Test succeed. */
#define _TEST_PARTIAL_SUCCEED 2 /** Test partial succeed. */
#define _TEST_FAILED 0 /** Test failed. */ /// This is the description of a class or a struct. /**
*\Description:Use for the test functions.
*\Methods: 1.SetTester : Set the basic param of the test
2.GetTester : Get the result of a test.
*\Other: This is a C based class.
*/
class TestClass
: public TestBaseClass
{
public:
TestClass( void );
virtual ~TestClass( void ); public:
/**
*\Description:Set function for the test class.
*\Input: 1.const int& param1, the first param of the func.
2.const int& param2, the second param of the func.
*\Output: None.
*\Return: const int : _TEST_SUCCEED, succeed
_TEST_PARTIAL_SUCCEED, partial succeed
_TEST_FAILED, failed.
*\Other: None.
*/
const int SetTester( const int& param1, const int& param2 ); /**
*\Description:Get the result of a test.
*\Input: 1.const int& token1, the first token of the func.
2.const int& token2, the second token of the func.
*\Output: 1.int& result, the result of the test.
*\Return: const int : _TEST_SUCCEED, succeed
_TEST_PARTIAL_SUCCEED, partial succeed
_TEST_FAILED, failed.
*\Other: None.
*/
const int GetTester( const int& token1, const int& token2,
int& result ); private:
int m_iParamFrst; /// The first param of the test.
int m_iParamScnd; /// The second param of the test.
}; // TestClass /// The comments in detailed code lines. /// I intended that the implementation of a method shall be in another file. /** Set function for the test class. */
int TestClass::SetTester( const int& param1, const int& param2 )
{
int rtnVal; // The return value of this function
rtnVal = _TEST_FAILED; // Set the param of the test
if ( param1 >= && param2 >= )
{
rtnVal = _TEST_SUCCEED;
}
else if ( param1 >= || param2 >= )
{
rtnVal = _TEST_PARTIAL_SUCCEED;
}
else
{
rtnVal = _TEST_FAILED;
} m_iParamFrst = param1;
m_iParamScnd = param2; return rtnVal;
} /** Get the result of a test. */
int TestClass::GetTester( const int& token1, const int& token2, int& result )
{
int rtnVal; // The return value of this function
rtnVal = _TEST_FAILED; // Judge the token to decide the result
if ( token1 == m_iParamFrst && token2 == m_iParamScnd )
{
result = m_iParamFrst * m_iParamScnd;
rtnVal = _TEST_SUCCEED;
}
else if ( token1 == m_iParamFrst || token2 == m_iParamScnd )
{
result = m_iParamFrst / m_iParamScnd;
rtnVal = _TEST_PARTIAL_SUCCEED;
}
else
{
result = ;
rtnVal = _TEST_FAILED;
} return rtnVal;
} /// For interface that we just write the brief of the function. class __declspec( novtable ) ITestInterface
{
public:
/** This is a function of the interface. */
virtual void func( const int& param, const char* charParam ) = ;
}; /// here we can also use EXTERN_C instead of extern "C" if under VS.
extern "C" __declspec( dllexport ) ITestInterface* getTestInterface();

以上是换了一家公司之后,根据公司内部的 code rule 自己整理的自己以后进行编码的参考格式(当然,现在这家并不是做什么开源项目的:3>)

Comment file的更多相关文章

  1. MySQL5.6 PERFORMANCE_SCHEMA 说明

    背景: MySQL 5.5开始新增一个数据库:PERFORMANCE_SCHEMA,主要用于收集数据库服务器性能参数.并且库里表的存储引擎均为PERFORMANCE_SCHEMA,而用户是不能创建存储 ...

  2. Nagios配置文件详解

    首先要看看目前Nagios的主配置路径下有哪些文件.[root@nagios etc]# ll总用量 152-rwxrwxr-x. 1 nagios nagios 1825 9月  24 14:40 ...

  3. 控制器层(Controllers)

    本章译者:@freewind 业务逻辑代码通常位于模型(model)层.客户端(比如浏览器)无法直接调用其中的代码,所以模型对象提供的功能,必须作为资源以URI方式暴露给外部. 客户端使用HTTP协议 ...

  4. 【转】 svn 错误 以及 中文翻译

    直接Ctrl+F 搜索你要找的错 # # Simplified Chinese translation for subversion package # This file is distribute ...

  5. SaltStack项目实战(六)

    SaltStack项目实战 系统架构图 一.初始化 1.salt环境配置,定义基础环境.生产环境(base.prod) vim /etc/salt/master 修改file_roots file_r ...

  6. SaltStack配置管理之状态模块和jinja2(五)

    官方文档 https://docs.saltstack.com/en/latest/topics/states/index.html 配置管理之SLS Salt  State  SLS描述文件(YAM ...

  7. js023-离线应用与客户端存储

    js023-离线应用与客户端存储 本章内容: 进行离线检测 使用离线缓存 在浏览器中保存数据 23.1 离线检测 第一步:知道设备是在线还是离线:navigator.Online属性.该值为true表 ...

  8. SaltStack实战

    SaltStack实战 #安装 安装注意几点 python-libs-2.6.6-64.el6.x86_64 conflicts with file from package python-2.6.6 ...

  9. Play Framework介绍:控制器层

    业务逻辑代码通常位于模型(model)层.客户端(比如浏览器)无法直接调用其中的代码,所以模型对象提供的功能,必须作为资源以URI方式暴露给外部. 客户端使用HTTP协议来操作这些资源,从而调用了内部 ...

随机推荐

  1. springboot mail整合freemark实现动态生成模板

    目标:1:springboot 整合 mail2: mail 使用freemark 实现模板动态生成(就是通过字符串生成模板,不需要在工程中写入固定模板)3: springboot 整合aop 实现日 ...

  2. Swiper实现轮播图效果

    为了实现轮播图(carousel)效果或左右滑动显示不同的内容,我们采用Swiper来实现. 需要引入swiper.min.css和swiper.min.js,文件可从https://github.c ...

  3. 08-蓝图&单元测试

    学习目标 能够使用代码实现蓝图对项目进行模块化 能够说出断言的作用 能够说出实现单元测试步骤 能够说出单元测试所执行方法的定义规则 Blueprint(蓝图) 随着flask程序越来越复杂,我们需要对 ...

  4. solidity智能合约如何判断mapping值为空

    mapping值的判断问题 在Java这类编程语言中,我们可以获得Map里面的值然后与null或空来进行判断该key对应的值是否为空.可是在solidity中貌似并没有提供类似的判断.那么我们如果来进 ...

  5. Redis系列---redis简介01

    一. 本章我们将用简短的几句话来帮助你快速的了解什么是redis,初学者不必深究 1 Redis简介 Remote Dictionary Server(Redis)是一个开源的使用ANSI C语言编写 ...

  6. wpf 当DataGrid列模版是ComboBox时,显示信息

    ​ 实际工作中,有时DataGrid控件某一列显示数据是从Enum集合里面选择出来的,那这时候设置列模版为ComboBox就能满足需求.而关于显示的实际内容,直接是Enum的string()返回值可能 ...

  7. C# Spire简单实现导出word(去水印)

    今天老姐打电话,说:下个月一号要换到其他岗位上,到时需要对word操作,小弟我随口答应,这个简单,我给你开发一款小程序,你直接在我程序上录入一些数据,我给你导出到word中. 利用中午空闲时间,百度了 ...

  8. Typescript基础(3)——类

    前言 今天继续typescript的学习,开始ts类的学习. 类 类的实现 在ES6中新增了类的概念.我们先看ES6中类的实现. class Person { constructor(name,age ...

  9. ucoreOS_lab5 实验报告

    所有的实验报告将会在 Github 同步更新,更多内容请移步至Github:https://github.com/AngelKitty/review_the_national_post-graduat ...

  10. Mixins and Python

    什么是Mixin (混入) Mixin 这个词在Python/Ruby中经常使用, Java 中几乎看不到这个名词. 在Java 中, 我们经常定一个一个子类扩展了某个基类, 同时实现某些接口. 因为 ...