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协议来操作这些资源,从而调用了内部 ...
随机推荐
- SVN基本使用
1.把服务器的所有内容下载到本地 svn checkout 服务器地址 --username=使用者 --password=密码 2.添加文件 touch main.m(文件名) : 创建main.m ...
- MySQL基础之STRAIGHT JOIN用法简介
MySQL基础之STRAIGHT JOIN用法简介 引用mysql官方手册的说法: STRAIGHT_JOIN is similar to JOIN, except that the left tab ...
- selenium元素定位方法之轴定位
一.轴运算名称 ancestor:祖先结点(包括父结点) parent:父结点 preceding:当前元素节点标签之前的所有结点(html页面先后顺序) preceding-sibling:当前元素 ...
- PELT算法
参考:http://www.wowotech.net/process_management/PELT.html 本文是对https://lwn.net/Articles/531853/的翻译 mark ...
- .deb文件安装应该怎么做
https://unix.stackexchange.com/questions/159094/how-to-install-a-deb-file-by-dpkg-i-or-by-apt
- Vue中计算属性、侦听、过滤、自定义指令、ref的操作
1.计算属性 <div id="app"> <input type="text" v-model="x"> < ...
- 用Python查找数组中出现奇数次的那个数字
有一个数组,其中的数都是以偶数次的形式出现,只有一个数出现的次数为奇数次,要求找出这个出现次数为奇数次的数. 集合+统计 解题思路 最简单能想到的,效率不高.利用集合的特性,通过 Python 的 s ...
- docker下安装Redis
Docker介绍 1.节约时间.快速部署和启动 2.节约成本 3.标准化应用发布 4.方便做持续继承 5作为集群中的轻量主机或节点 6.方便构建基于SOA或者微服务架构的系统 Docker中文文档 h ...
- cmdb全总结
1.什么是cmdb ,做什么的? 配置管理数据库 ,就是存储基础设施的信息配置使用的 简单说就是CMDB这个系统可以自动发现网络上的IT设备 ,并自动存储相关信息 ,像一台服务器有型号 厂商 系统 c ...
- SQL学习_WHERE 数据过滤
1.比较运算符 SQL:SELECT name, hp_max FROM heros WHERE hp_max > 6000 SQL:SELECT name, hp_max FROM heros ...