基于插件架构的c / c ++应用程序 [英] plug-in architecture based c/c++ application

查看:171
本文介绍了基于插件架构的c / c ++应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何开始编写基于插件架构的应用程序。我的意思是如何写一个基本代码,让其他人通过添加他们写的插件来开发应用程序。
我知道在c ++中这样做有一些问题。大多数人使用其他语言(如python)在其c ++应用程序中添加插件。

解决方案

回答您的期望,但您可以尝试检查 Rainmeter 来源。它是用C ++编写的(有些地方可以做的更好,在我的脑海中,但总的来说是确定的),整个应用程序是这样做,只是处理插件。



即使是简单的API是通过插件完成的,还有一些例子的贡献的插件,我的意思是,由别人写的(我这样做了,有一天)。



我认为你可以通过查看其他应用程序,实际研究了许多新的技巧在基于插件的开发。



另外一个很好的例子是 Miranda IM



编辑:此外,如果我有同样的任务,我会添加一些 python (或类似的东西)后端到我的应用程序,并使用它作为SDK的语言(例如,使用 boost :: python )。 p>

I need to know how to start writing an application based on plug-in architecture. I mean how to write a base code and let others develop the application by adding the plug-ins they write. I know that there is some problems in doing so in c++. most people use another language such as python to add plug-ins to their c++ application.

解决方案

I think, this is not the answer you expect, but you could try to examine the Rainmeter sources. It's written in C++ (some places could be done better, to my mind, but overall it's ok) and the whole application is done the way so it just handles plugins.

Even the simple API is done via plugins, there is also a bunch of examples of contributed plugins, I mean, written by someone else (I did that too, one day).

I think you could actually study a lot of new tricks in the plugin-based development by looking at other applications.

Also to mention, another good sample is Miranda IM.

Edit: Also, if I han the same task, I would actually add some python (or something like that) backend to my application and use it as the language for SDK (for example, using boost::python).

这篇关于基于插件架构的c / c ++应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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