View Single Post
  #1 (permalink)  
Old 01-24-2004
shaver shaver is offline
Registered User
 
 
Join Date: May 2003
Posts: 35
Lightbulb request: macro declaring slice interface's methods

If I have a number of implementations of a given interface, modifying the interface requires changing a lot of boilerplate code, which is both tedious and error-prone.

We solved this problem in XPCOM/xpidl by generating helper macros for each interface, such that you would put in

Code:
class mySample : public nsISample
{
public:
    mySample();

    // nsISample interface
    NS_DECL_NSISAMPLE;
private:
    int _sampleInt;
};
rather than hand-typing all of the nsISample method signatures by hand. Would you take a patch that added such a macro to slice2cpp-generated headers? No code bloat for people who don't use it, this time I promise!

Mike
Reply With Quote