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

  • From: Tim Hockin <thockin@xxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Mon, 14 Feb 2005 09:45:47 -0800

On Mon, Feb 14, 2005 at 12:27:20PM -0500, Ron Kuper wrote:
> I'd like to see us cherry pick the best ideas from COM, but still keep
> the interface as streamlined as possible.  For starters this could mean
> getting rid of reference counting and limiting the set of interfaces to
> avoid many small ephemeral objects floating around.
> 
> In C++, I'm thinking something along these lines:
> 
> struct GMPI_Object
> {
>     GMPI_RESULT GetInterface( UUID interfaceID, void** obj ) = 0;
> };
> 
> struct GMPI_Factory : public GMPI_Object
> {
>     GMPI_RESULT Create( UUID objectClass, GMPI_Object** object ) = 0;
>     GMPI_RESULT Destroy( GMPI_Object* object ) = 0;
> };
> 
> struct GMPI_Plugin : public GMPI_Object
> {
>     // Plugin methods go here, such as process, event queue, etc.
>     // TBD: derive GMPI_Queue, GMPI_Pin, etc, from GMPI_Object or not?
> };
> 
> Every GMPI module (DLL, whatever) then needs to expose one global entry
> point, a "get factory" function.
> 
> Thoughts?

Ron, You're singing my song. :)  I still want to pay attention to how
the C API tastes, so it's not torture to write in C, but I am willing to
be flexible such that the C++ API is clean, too.

Balance.

Tim

----------------------------------------------------------------------
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: