c++ PImpl实现机制

上传者: yao_hou | 上传时间: 2021-09-23 11:02:33 | 文件大小: 284KB | 文件类型: ZIP
**PIMPL** ,即Private Implementation,一般称之为类的私有化实现,PImpl主要有两个作用; (1)它让声明和实现进行解耦,在项目开发时,如果很多文件引用了该头文件,如果头文件改变了一些实现,那么在编译时,所有引用的文件也得重新编译一次,增加了c++程序的编译时间, 如果把实现用一个指针进行声明,改变实现的代码,只会关联一次,降低了耦合度,可以减少编译时间。 (2)Pimpl,也可以称之为pointer to implementation, 指向实现的指针,可以用来对“类的接口与实现”进行解耦,比如在sdk开发时,可以用这个技巧来避免在头文件中暴露私有细节,使sdk接口与实现保持完全分离。

文件下载

资源详情

[{"title":"( 23 个子文件 284KB ) c++ PImpl实现机制","children":[{"title":"PImpl","children":[{"title":"Debug","children":[{"title":"Boss.obj <span style='color:#111;'> 62.71KB </span>","children":null,"spread":false},{"title":"PImpl.exe.recipe <span style='color:#111;'> 285B </span>","children":null,"spread":false},{"title":"PImpl.log <span style='color:#111;'> 124B </span>","children":null,"spread":false},{"title":"WorkerPrivate.obj <span style='color:#111;'> 56.02KB </span>","children":null,"spread":false},{"title":"vc142.pdb <span style='color:#111;'> 460.00KB </span>","children":null,"spread":false},{"title":"PImpl.ilk <span style='color:#111;'> 537.00KB </span>","children":null,"spread":false},{"title":"vc142.idb <span style='color:#111;'> 275.00KB </span>","children":null,"spread":false},{"title":"PImpl.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'> 1.93KB </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 1.36KB </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 65.91KB </span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'> 2.36KB </span>","children":null,"spread":false},{"title":"PImpl.lastbuildstate <span style='color:#111;'> 158B </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 588B </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 3.66KB </span>","children":null,"spread":false}],"spread":true},{"title":"main.obj <span style='color:#111;'> 36.55KB </span>","children":null,"spread":false}],"spread":true},{"title":"PImpl.vcxproj.filters <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false},{"title":"Boss.cpp <span style='color:#111;'> 468B </span>","children":null,"spread":false},{"title":"Boss.h <span style='color:#111;'> 219B </span>","children":null,"spread":false},{"title":"PImpl.vcxproj.user <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"WorkerPrivate.cpp <span style='color:#111;'> 294B </span>","children":null,"spread":false},{"title":"main.cpp <span style='color:#111;'> 225B </span>","children":null,"spread":false},{"title":"WorkerPrivate.h <span style='color:#111;'> 117B </span>","children":null,"spread":false},{"title":"PImpl.vcxproj <span style='color:#111;'> 7.34KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明