|
Boost : |
Subject: Re: [boost] [interfaces] Boost Interface Library (2004?)
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-02-06 16:13:06
On 2/6/2011 3:07 PM, Daniel Larimer wrote:
> I recently ran across the unofficial Boost Interface Library (http://www.coderage.com/interfaces), but it appears that it is was never adopted nor much discussed since I joined this mailing list.
> Boost.Interfaces provides a macro-based Interface Definition Language (IDL) which can be used to define C++ class types called interfaces. An interface is a lightweight value type associated with a set of named function signatures. An interface instance can be bound at runtime to any object which implements the interface, i.e., to any object of a type with accessible non-static member functions having the same name and signature as the set of functions associated with the interface. The functions of the bound object can then be invoked through the interface instance using the �dot� operator. Binding is completely non-intrusive: the object's type need not declare any virtual functions or derive from any particluar base class.
>
> Interfaces were described in a September 2004 C/C++ Users Journal article by Christopher Diggins.
>
> After looking through the library I concluded that I did not like how it was implemented. Too many macros, unnatural syntax. I guess few people liked it enough for it to be kept up to date (6+ years old now). I have also looked at the Boost Mirror library which provides reflection of just about everything at the expense of some nasty macros and no clear path toward defining dynamic interfaces based upon the reflected type information.
How are is an interface any different than a C++ abstract class ?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk