跨平台替代COM [英] Cross-platform alternative to COM

查看:291
本文介绍了跨平台替代COM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直沉迷于基于组件的编程(使用COM,另一个系统,或者只是使用范例纯C ++吧)。这需要一点时间来适应的,如果一个通常用于传统OOP模型,但它是definetely值得的。它使我的code更容易维护和易于扩展。

I've been enamoured with component based programming (be it with COM, another system, or just using the paradigm in plain C++). It requires a bit of getting used to, if one is usually used to the "traditional" OOP model, but it's definetely worth it. It's made my code more maintainable and easier to extend.

该项目中,我目前正在使用的模式,但没有一套系统。不过,我真的想找到某种制度,我可以与下列要求使用。从我现在有一个新的系统切换会采取了一些时间,但我后来保存了当时的倍数。

The project I'm currently working on is using the paradigm, but no set system. However, I'd really like to find some sort of system I could use with the following requirements. Switching over from what I have now to a new system would take a bit of time, but I'd save a multiple of that time later.

的要求:


  1. 跨平台

  2. 快速

  3. 用C效果很好++

  4. 支持跨进程编组

让我解释这些要求:

跨平台

基本上,我需要它在Windows和Mac工作。 Linux的将是很好的,但不以任何方式至关重要。此外,它真的需要满足所有平台的其他要求。有用于Mac一个COM,这将是理想的,但它不支持要求4中。另外,它必须支持GCC和MSVC。

Basically, I need it to work on Windows and Mac. Linux would be nice, but is not in any way essential. Also, it really needs to fulfil the other requirements for all platforms. There's a COM for Mac, which would be ideal but it doesn't support requirement 4. Additionally, it must support both GCC and MSVC.

快速

这是CORBA不幸输了,即使它满足了其他三个要求。在进程的方法调用需要尽可能快(理想情况下,如COM),因为一些例程也可能从一个音频中断被调用。

This is where CORBA unfortunately loses, even though it fulfils the other three requirements. In-process method calls need to be as fast as possible (ideally, like COM), since some of the routines might also be called from an audio interrupt.

用C效果很好++

...我想这个主要是显而易见的。我不介意不使用C ++类来实现组件,尽管这会definetely是有帮助的,而且替​​代仍必须易于使用,尤其是因为我最终打算推出针对第三方扩展的API。

... I guess this one is mostly obvious. I don't mind not using C++ classes to implement components, though that would definetely be helpful, and the alternative must still be easy to use, especially since eventually I intend to release an API for 3rd party extensions.

支持跨进程编组

我的意思是,至少能够序列化的呼叫。如果这是通过从IDL生成code做了,这是我完全没有问题,我也不会介意实现跨进程通信本身。

By that I mean at least being able to serialize the calls. If this is done via code generated from an IDL, that's perfectly fine with me, and I also don't mind implementing the cross-process communication itself.

COM将是巨大的,但它不符合要求的1充分。 CORBA将是巨大的,但它不符合要求的2(即使以最快的ORB在那里)​​。 XPCOM可能不符合要求2,并且不与MSVC工作,所以不符合要求1

COM would be great, but it doesn't meet requirement 1 fully. CORBA would be great too, but it doesn't meet requirement 2 (even with the fastest ORB out there). XPCOM might not meet requirement 2, and doesn't work with MSVC so doesn't meet requirement 1.

任何想法还有什么是在那里?我的下一个步骤将是使用protobufs或类似的东西推出自己的,但我当然想避免这种情况。

Any ideas what else is out there? My next step would be to roll my own using protobufs or something similar, but of course I'd like to avoid that.

更新

Update

要详细说明 - 在这种情况下音频中断可低至2-3ms。这时间不完全对我来说甚至可用,其他组件需要在该时间来处理,而我的软件本身包装另外的软件,需要在这一时间来处理。这就是为什么无论在进程和跨进程编组需要是非常快的。

To elaborate - an audio interrupt in this context can be as low as 2-3ms. That time isn't even available in full to me, as other components need to process in that time, and my software is itself wrapping another piece of software that needs to process in that time. This is why both in-process and cross-process marshalling needs to be extremely fast.

推荐答案

这ZeroC HTTP ICE://www.zeroc。 COM / 是另一种选择。

ICE from ZeroC http://www.zeroc.com/ is another alternative.

对于CORBA老前辈,米尺亨宁是当天的大师之一。他现在是ZeroC。它是一个开源,跨平台的,包括所有的目标(包括Linux)系统。

For those CORBA old-timers, Michi Henning was one of the gurus of the day. He is now with ZeroC. It is an open-source, cross-platform, including all your targets (including Linux), system.

C ++是唯一的语言之一,和ICE的C ++绑定比CORBA C ++绑定是显著更好。

C++ is only one of the languages, and ICE's C++ bindings are significantly better than the CORBA C++ bindings are.

这篇关于跨平台替代COM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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