什么是一个C ++的插件系统安全吗? [英] What's safe for a C++ plug-in system?

查看:176
本文介绍了什么是一个C ++的插件系统安全吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

插件用C系统,因为ABI没有正确定义++是很难的,而且每个编译器(或它们的版本)遵循自己的规则。但是,在Windows COM表明,它可以创建一个最小的插件系统,允许具有不同的编译器程序员使用一个简单的接口与主机应用程序创建的插件。

Plug-in systems in C++ are hard because the ABI is not properly defined, and each compiler (or version thereof) follows its own rules. However, COM on Windows shows that it's possible to create a minimal plug-in system that allows programmers with different compilers to create plug-ins for a host application using a simple interface.

让我们成为现实,并留下C ++标准,这是不是在这方面非常有帮助的,除了一分钟。如果我想要写为Windows和Mac(以及可选Linux)的一个应用程序,支持C ++的插件,如果我想给插件作者的一个相当大的选择,编译器(比如小于2岁的版本的Visual C ++的,GCC或英特尔C ++编译器)的C ++什么功能,我可以指望?

Let's be practical, and leave the C++ standard, which is not very helpful in this respect, aside for a minute. If I want to write an app for Windows and Mac (and optionally Linux) that supports C++ plug-ins, and if I want to give plug-in authors a reasonably large choice of compilers (say less than 2 year old versions of Visual C++, GCC or Intel's C++ compiler), what features of C++ could I count on?

当然,我认为插件会针对特定平台编写。

Of course, I assume that plug-ins would be written for a specific platform.

我的头顶部,这里有我能想到的一些C ++特性,凭什么我认为答案是:

Off the top of my head, here are some C++ features I can think of, with what I think is the answer:


  • 虚表的布局,通过抽象类使用对象? (是)

  • 内建类型,指针? (是)

  • 结构,联合? (是)

  • 例外? (无)

  • 的externC的功能呢? (是)

  • STDCALL非的externC与功能内置参数类型? (是)

  • 非STDCALL非的externC与用户定义的参数类型的功能呢? (无)

我想AP preciate你,你可以分享这方面的任何经验。如果您知道任何比较成功的应用程序,有一个C ++的插件系统,这很酷了。

I would appreciate any experience you have in that area that you could share. If you know of any moderately successful app that has a C++ plug-in system, that's cool too.

卡尔

推荐答案

这里是关于这个问题的pretty良好的阅读。这是一个系列文章,涵盖建筑,开发和C / C ++跨平台插件框架的部署。

Here is a pretty good reading on the subject. It is a series of articles which covers the architecture, development, and deployment of a C/C++ cross-platform plugin framework.

希望它帮助!

这篇关于什么是一个C ++的插件系统安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆