On Sun, Jan 3, 2010 at 8:01 AM, Kevin Atkinson <kev...@gm...> wrote:
> Hi there, Roman et al,
>
> I've been doing a bit of exploratory coding to see if I can wrap bits of
> OpenCascade (hereafter OCC) with PY++, and I currently have the following
> issue:
>
> OCC is very good about not including stuff it doesn't have to in headers --
> it uses a forward declaration of the class if it can possibly get away with
> it. So if I want to wrap the class using PY++ and have it compile, I have
> to include the headers for those classes myself or the module doesn't
> compile.
>
> So: is there an easy way to identify which classes are only
> forward-declared? I can think of a hacky way, not sure if it would actually
> work -- iterate through all member functions, look at their signatures, and
> see if the "exportable" flag is False, or something.
>
> Any and all help greatly appreciated....
mb = module_builder_t( .... )
fds = mb.global_ns.decls( decl_type=declarations.class_declaration_t )
or
fds = mb.global_ns.decls( lambda d: isinstance( d,
declarations.class_declaration_t ) )
Select what you like better.
The following are the relevant links to the documentation:
* http://language-binding.net/pygccxml/apidocs/declarations.html#module-pygccxml.declarations.scopedef
* http://language-binding.net/pygccxml/query_interface.html ( highly
recommended )
HTH
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|