/// 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. ModelAndView重定向带参数解决方法

    业务场景:SpringMVC项目使用ModelAndView进行重定向跳转到另外一个action时,需要在url后面带上参数 如果是带参数带一个页面,直接用modelAndView.addObject ...

  2. 使用logging模块进行封装,让bug无处遁寻

    import logging from scripts.handle_config import conf from scripts.constants import LOGS_DIR class H ...

  3. Java开发桌面程序学习(七)——ImageView设置图片以及jar包读取fxml文件

    ImageView设置图片 JavaFx的ImageView,设置图片不能直接通过属性设置,只能通过代码来设置 ImageView设置图片 首先,我们让fxml对应的那个controller的java ...

  4. C#上手练习3(while、do while语句)(添加机器人聊天)

    C# while 循环与 for 循环类似,但是 while 循环一般适用于不固定次数的循环. while 循环的语法形式如下. while(布尔表达式){    语句块;} while 语句执行的过 ...

  5. wpf/winform获取windows10系统颜色和主题色

    Windows10开始微软在系统颜色中添加了深色,对于UWP来说很轻松就能获取到系统当前的颜色和主题色,而对于Win32应用就没有那么直观了. 在wpf中,可以通过SystemParameters.W ...

  6. Swagger UI in AspNetCore WebAPI

    Swagger其实包含了三个部分,分别是Swagger Editor文档接口编辑器,根据接口文档生成code的Swagger Codegen,以及生成在线文档的Swagger UI.在AspNetCo ...

  7. Spring Boot 中如何支持异步方法

    本人免费整理了Java高级资料,涵盖了Java.Redis.MongoDB.MySQL.Zookeeper.Spring Cloud.Dubbo高并发分布式等教程,一共30G,需要自己领取.传送门:h ...

  8. Java生鲜电商平台-电商会员体系系统的架构设计与源码解析

    Java生鲜电商平台-电商会员体系系统的架构设计与源码解析 说明:Java生鲜电商平台中会员体系作为电商平台的基础设施,重要性不容忽视.我去年整理过生鲜电商中的会员系统,但是比较粗,现在做一个最好的整 ...

  9. Runtime 类初探

    Runtime类 认识 Runtime类 在每一个JVM进程中都会存在一个Runtime类,这个类的主要功能是取得一些与运行时有关的环境属性或创建进程等操作. 在Runtime类定义的时候,它的构造方 ...

  10. postgreSQL数据库的初探

    kali是黑客的强大武器,还有一个也是哦——Metasploit postgreSQL数据库是Metasploit的默认数据库哦! 启动postgresql: service postgresql s ...