可移植的 C++ 组件设计

Portable C++ Component Design(可移植的 C++ 组件设计)
本文介绍了可移植的 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++ 组件设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Rising edge interrupt triggering multiple times on STM32 Nucleo(在STM32 Nucleo上多次触发上升沿中断)
How to use va_list correctly in a sequence of wrapper functions calls?(如何在一系列包装函数调用中正确使用 va_list?)
OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?(OpenGL透视投影裁剪多边形,顶点在视锥外=错误的纹理映射?)
How does one properly deserialize a byte array back into an object in C++?(如何正确地将字节数组反序列化回 C++ 中的对象?)
What free tiniest flash file system could you advice for embedded system?(您可以为嵌入式系统推荐什么免费的最小闪存文件系统?)
Volatile member variables vs. volatile object?(易失性成员变量与易失性对象?)