[gmpi] Re: low level API - Abstract Factory summary

  • From: Mike Berry <mberry@xxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Fri, 11 Feb 2005 14:00:26 -0700

B.J. Buchalter wrote:

on 2/11/05 3:07 PM, Jeff McClintock at jeffmcc@xxxxxxxxxx wrote:


I suspect you have in mind a simple 'alternative' to COM, using the
familiar VST/LADSPA technique.
i.e. a C struct containing function pointers.  Each function pointer
leading to a 'stub' which calls the C++ wrapper layer.


In other words, COM.



Has anyone here actually implemented a COM server that returns multiple
disjoint interface on the same object using C as the implementation language
(as Mike is suggesting for GMPI)?

Have you dealt with the implementation complexity re: reference counting and
object pointer thunking that is described in that Microsoft Cookbook
document?

Is it really much easier to get right than it seems? Cause that just looks
like something that could be very difficult to get right and maintain,
especially as the API for each interface needs to evolve over time.

Or maybe in practice it can be structured internally just like my proposed
cluster of object factory methods.

But I would feel much better hearing that someone has actually implemented
what is being proposed and that it was no problem!


I have not done it in C myself. However, I want to point out that QueryInterface, AddRef, and Release will never need to be implemented by individual plugin coders unless they are perverse. I would assume that we would include a C SDK, just like we include a C++ SDK. The reference C would have these 3 functions implemented already (I'm sure we can find this code somewhere, in close to the form we will need). All that the C plugin writer (and I think there will be few of these) will have to do is fill in a definition of function pointers for each of the interfaces they want to support. Interfaces that are left with NULL function pointers would fail a QI for that interface. I think that all of the scary stuff can be done once and gotten right by us.



-- Mike Berry Adobe Systems

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: