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协议来操作这些资源,从而调用了内部 ...
随机推荐
- LeetCode 136:只出现一次的数字 Single Number
题目: 给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次.找出那个只出现了一次的元素. Given a non-empty array of integers, every e ...
- WPF 修改Webbrowser的IE版本小程序(32位)
偶尔用Winform的Webbrowser,但是ie版本太低. 手改改注册表了太慢了. 弄个了程序,修改的代码时网上的,自己就是写了个界面. 支持IE11. XAML页面代码 <Window.R ...
- 【CF933E】A Preponderant Reunion(动态规划)
[CF933E]A Preponderant Reunion(动态规划) 题面 CF 洛谷 题解 直接做很不好搞,我们把条件放宽,我们每次可以选择两个相邻的非零数让他们减少任意值,甚至可以减成负数(虽 ...
- dictionary vs Hashtables
DictionaryDictionary is generic type Dictionary<TKey,TValue>Dictionary class is a strong type ...
- hibernate关联关系(一对多)
什么是关联(association) 关联指的是类之间的引用关系.如果类A与类B关联,那么被引用的类B将被定义为类A的属性. 案例:如何建立客户和订单一对多双向关联 先不建立客户和订单的关联关系,定义 ...
- Python3---常见函数---open()
前言 该文章描述了Python3函数open的作用,以及使用方法. 修改时间:20191220 天象独行 函数open(name,mode,buffering)作用是打开一个文件,并且创建一个file ...
- AQS(抽象队列同步器)
AQS(全称为AbstractQueuedSynchronizer),即抽象队列同步器,它维护了一个volatile int state(代表共享资源)和一个FIFO线程等待队列. state的访问方 ...
- Vuex基本使用的总结--转载
在 Vue 的单页面应用中使用,需要使用Vue.use(Vuex)调用插件.使用非常简单,只需要将其注入到Vue根实例中. import Vuex from 'vuex' Vue.use(Vuex) ...
- Dynamics 365中计算字段与Now进行计算实体导入报错:You can't use Now(), which is of type DateTime, with the current function.
微软动态CRM专家罗勇 ,回复338或者20190521可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me. 计算字段是从Dynamics CRM 2015 SP1版本开始推 ...
- Python对csv文件的读写操作
python内置了csv模块,用它可以方便的操作csv文件. 1.写文件 (1)写文件的方法一 import csv # open 打开文件有多种模式,下面是常见的4种 # r:读数据,默认模式 # ...