From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-02-02 01:04:56
Jonathan Turkanis wrote:
> Rene Rivera wrote:
> Unfortunately, once you switch to the boost macro-naming conventions, having a
> macros to declare the argument list becomes a bit verbose:
> I guess you could have the outer macro stick the prefix on the inner macro, so
> there wouldn't really be any ARGn macros. Is that what you do?
Something like that.. I have a Def.h to define the bare macros in terms
of fully prefixed macros, THOT_* in my case, and a corresponding Undef.h
to clear things out. The Def.h takes care to prepend the prefix only
when needed, and the individual outer macros will prepend the inner ones
as needed. It's a round about way of doing it but it has the benefit of:
a) having the real macros defined once, b) the real macros are much
easier to read, c) the outer layer can take care of PP problems (like
> The project you mention looks interesting. What sort of interfaces are you
I current use them to generate:
1. Public header only PIMPL API to all my DLLs/SOs.
2. Private header PIMPL implementation declarations to all my DLLs/SOs.
3. Private source PIMPL implementation to forward to implementation classes.
4. Lua bindings to my API using LuaBind.
All that is done by changing only the definition of the inner macros. To
produce the code I'm looking for. For example here's the file to do the
Lua binding for the above DataTransferEvent interface..
/* Copyright (c) 2003 Redshift Software, Inc. All Rights Reserved. */
[Imp.h is the one that defines the inner macros in this case]
That alone was worth all the effort of implementing a PP based IDL -- I
once even tried to bind my complete API in a single file like the above,
but that ground the compiler to a halt when it tried to use a few
magnitudes more memory than I have :-)
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk