Boost logo

Boost :

From: Karl Bellve (Karl.Bellve_at_[hidden])
Date: 2001-03-26 14:43:11


Phlip:

Thanks,

But it appears that BPL must first create a python class in the first
line before you can use the second line (m = n.getWorld(1)). In your
example, you have hello::world, which has a function to construct a new
hello::world (getWorld). But, using BPL, how do you load a preexisting
c++ object, already contructed, into python? I assume you just can't do
a "import object\n" and then use its functions? Basically, can you skip
line one in your python code, and go straight to line 2?

Phlip wrote:
>
>
> We demonstrate three behaviors here:
>
> - Python calls 'new' (the first line would have a 'new' if Python created
> objects like that) and gets a C++ object thru BPL
>
> - A C++ method (getWorld) calls 'new' & returns a Pythonized pointer to it
>
> - A C++ object does not call new & returns a None, so Python can detect this
>
> I ended that thread when I figured out how to safely return a None. Boost
> does not (yet) translate a C++ NULL into a None. But I can't remember what
> the thread said - we implemented BPL in our project (replacing SWIG
> [yay!]) and moved on.
>
> --
> Phlip phlip_cpp_at_[hidden]
> ============== http://phlip.webjump.com ==============
> -- Whoever dies with the most features wins --
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

-- 
Cheers,
Karl Bellve, Ph.D.                   ICQ # 13956200
Biomedical Imaging Group             TLCA# 7938 		
University of Massachusetts
Email: Karl.Bellve_at_[hidden]
Phone: (508) 856-6514
Fax:   (508) 856-1840
PGP Public key: finger kdb_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk