Comment file
/// 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的更多相关文章
- MySQL5.6 PERFORMANCE_SCHEMA 说明
背景: MySQL 5.5开始新增一个数据库:PERFORMANCE_SCHEMA,主要用于收集数据库服务器性能参数.并且库里表的存储引擎均为PERFORMANCE_SCHEMA,而用户是不能创建存储 ...
- Nagios配置文件详解
首先要看看目前Nagios的主配置路径下有哪些文件.[root@nagios etc]# ll总用量 152-rwxrwxr-x. 1 nagios nagios 1825 9月 24 14:40 ...
- 控制器层(Controllers)
本章译者:@freewind 业务逻辑代码通常位于模型(model)层.客户端(比如浏览器)无法直接调用其中的代码,所以模型对象提供的功能,必须作为资源以URI方式暴露给外部. 客户端使用HTTP协议 ...
- 【转】 svn 错误 以及 中文翻译
直接Ctrl+F 搜索你要找的错 # # Simplified Chinese translation for subversion package # This file is distribute ...
- SaltStack项目实战(六)
SaltStack项目实战 系统架构图 一.初始化 1.salt环境配置,定义基础环境.生产环境(base.prod) vim /etc/salt/master 修改file_roots file_r ...
- SaltStack配置管理之状态模块和jinja2(五)
官方文档 https://docs.saltstack.com/en/latest/topics/states/index.html 配置管理之SLS Salt State SLS描述文件(YAM ...
- js023-离线应用与客户端存储
js023-离线应用与客户端存储 本章内容: 进行离线检测 使用离线缓存 在浏览器中保存数据 23.1 离线检测 第一步:知道设备是在线还是离线:navigator.Online属性.该值为true表 ...
- SaltStack实战
SaltStack实战 #安装 安装注意几点 python-libs-2.6.6-64.el6.x86_64 conflicts with file from package python-2.6.6 ...
- Play Framework介绍:控制器层
业务逻辑代码通常位于模型(model)层.客户端(比如浏览器)无法直接调用其中的代码,所以模型对象提供的功能,必须作为资源以URI方式暴露给外部. 客户端使用HTTP协议来操作这些资源,从而调用了内部 ...
随机推荐
- Linux内核驱动之GPIO子系统API接口概述
1.前言 在嵌入式Linux开发中,对嵌入式SoC中的GPIO进行控制非常重要,Linux内核中提供了GPIO子系统,驱动开发者在驱动代码中使用GPIO子系统提供的API函数,便可以达到对GPIO控制 ...
- 创 PHP RSA2 签名算法
什么是RSA2 ? RSA2 是在原来SHA1WithRSA签名算法的基础上,新增了支持SHA256WithRSA的签名算法. 该算法比SHA1WithRSA有更强的安全能力. 为了您的应用安 ...
- MySQL for OPS 09:MHA + Atlas 实现读写分离高可用
写在前面的话 前面做了 MHA 高可用,但是存在这样一个问题,我们花了 4 台机器,但是最终被利用起来的也就一台,主库.这样硬件利用率才 25%,这意味着除非发生故障,不然其他几台机器都是摆设.明显的 ...
- 【linux】dmesg命令显示开机信息和设备加载情况
Linux命令dmesg用来显示开机信息,kernel会将开机信息存储在ring buffer中.您若是开机时来不及查看信息,可利用dmesg来查看.开机信息亦保存在/var/log目录中,名称为dm ...
- Web前端——Html常用标签及属性
html 常用的标题等标签就不记录了,只记录一下比较少见的标签以及属性 表格 table td 单元格 tr 表的行 th 表头 td或th可以下面的两个属性达到跨行或跨列 表格跨行 rowspan ...
- 总结了Python中的22个基本语法
"人生苦短,我用Python".Python编程语言是最容易学习.并且功能强大的语言.只需会微信聊天.懂一点英文单词即可学会Python编程语言.但是很多人声称自己精通Python ...
- Tomcat8史上最全优化实践
Tomcat8史上最全优化实践 1.Tomcat8优化 1.1.Tomcat配置优化 1.1.1.部署安装tomcat8 1.1.2 禁用AJP连接 1.1.3.执行器(线程池) 1.1.4 3种运行 ...
- [转]C++字符串操作函数_tcschr、_tcsrchr
原文出处:https://blog.csdn.net/eickandy/article/details/50083169 C++标准库函数提供了字符和字符串的操作函数,并提供了其UNICODE版本,本 ...
- JavaScript初探 二 (了解数据)
JavaScript初探 (二) JavaScript 事件 HTML事件 HTML事件是可以在浏览器或用户做的某些事情 HTML事件的例子: HTML网页完成加载 HTML输入字段被修改 HTML按 ...
- CODING 签约天津大学,助力高校“产学”接轨
近日,CODING 与天津大学顺利达成合作,将通过 CODING 的一站式 DevOps 解决方案为天津大学师生提供软件研发管理方面的先进理念和产品. 根据中共中央.国务院印发的<中国教育现代化 ...