C++宏与类
来源:互联网 发布:excel vba编程 编辑:程序博客网 时间:2024/05/22 07:09
struct ServiceFactory { virtual ~ServiceFactory() {} virtual Service * CreateService() const = 0; virtual const char* GetName() const = 0; virtual int GetCmdId() const = 0;};//宏定义#define SERVICE_FACTORY(ServiceClass) ServiceClass##Factory#define SERVICE_ENTRY_DECLARE(ServiceClass) \ class SERVICE_FACTORY(ServiceClass) : public ServiceFactory { \ Service * CreateService() const; \ const char* GetName() const; \ int GetCmdId() const; \ };#define SERVICE_ENTRY(ServiceClass, ServiceName, CmdId) \ SERVICE_ENTRY_DECLARE(ServiceClass) \ Service * SERVICE_FACTORY(ServiceClass)::CreateService() const \ { return new ServiceClass(); } \ const char* SERVICE_FACTORY(ServiceClass)::GetName() const { return ServiceName; } \ int SERVICE_FACTORY(ServiceClass)::GetCmdId() const { return CmdId; }
0 0
- c与c++?励志类
- C宏与函数
- C语言与宏
- C++-类与对象
- 【C#】类与实例
- C++:类与对象
- 【C++】类 与继承
- C++(类与对象)
- 【c++】类与对象
- C++-类与对象
- C#---结构与类
- C/C++:宏定义中的#与##
- C/C++:函数模板与类模板
- [C/C++]模板函数与模板类
- C语言宏与typedef
- C++_对象与类
- c++-类与结构体
- C#----接口与抽象类
- 微信小程序之小豆瓣图书Demo
- VIM插件安装
- BOA移植
- 在 JNI 编程中避免内存泄漏
- 移动前端开发
- C++宏与类
- 数据结构
- Linux Shell之cut命令
- Android 热修复 Tinker接入及源码浅析
- Android studio 运行出现Error running app: This version of Android Studio is incompatible with the Gradle
- 训练10-使用一个CSS Class去给标签定义Style
- 2.1 Spark基本原理以及核心概念
- 0、WSO2 API Manager概述
- HWC blending mode