Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-02-02 01:04:56

Jonathan Turkanis wrote:
> Rene Rivera wrote:
>>NAME(Type VALUE(0x003))
> Unfortunately, once you switch to the boost macro-naming conventions, having a
> macros to declare the argument list becomes a bit verbose:
> BOOST_IDL_VOID_METHOD(readData,BOOST_IDL_ARGS3(UInt64&,UInt64&,Pointer&))
> 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
for CW8).

> The project you mention looks interesting. What sort of interfaces are you
> generating?

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. */
#include <com/redshift-software/projects/Thot/product/api/All.h>
#undef com_redshift_software_projects_thot_product_api_datatransferevent_h
[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. -
-- rrivera/ - grafik/ - 102708583/icq

Boost list run by bdawes at, gregod at, cpdaniel at, john at