Portable C++ Component Design(可移植的 C++ 组件设计)
问题描述
我过去一直使用 COM 和 .NET 程序集来开发基于组件的系统.现在我要处理一个跨平台的 C++ 项目,并且想在组件中构建代码......
I've been using COM and .NET assemblies in the past to develop component-based-systems. Now I'm going to work on a cross-plattform-C++-project and want to structure the code in components aswell…
显然 COM 和 .NET 不是一个选项,因为 COM 在任何地方都不可用,但 Windows 和程序集会将依赖项添加到目标系统可能不可用的 .NET 框架.
Obviously COM and .NET are not an option, as COM is not available anywhere but Windows and Assemblies would add dependencies to the .NET framwork which may be not available at the target system.
我知道由于 ABI 差异,我无法在不重新编译的情况下在不同操作系统之间移动组件,但我想以一种在源代码级别兼容的方式编写代码.
I'm aware that due to ABI-differences I won't be able to move components between different operating systems without recompilation, but I would like to write the code in a manner, that it's compatible at source-code-level.
是否有任何系统/框架可以在 C++ 中实现这样的架构?
Is there any system/framework that enables such a architecture in C++?
推荐答案
我过去曾使用过这样的系统 - 我们基本上重新发明了 COM.如果您对这种方法感兴趣,请查看这篇很棒的文章:http://msdn.microsoft.com/en-us/library/ms809983.aspx
I have worked with such a system in the past - we basically re-invented COM. If you are interested in that approach, check out this great article: http://msdn.microsoft.com/en-us/library/ms809983.aspx
这篇关于可移植的 C++ 组件设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:可移植的 C++ 组件设计


基础教程推荐
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 这个宏可以转换成函数吗? 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 常量变量在标题中不起作用 2021-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07