Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-08-17 10:03:30


----- Original Message -----
From: "John Hunter" <jdhunter_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, August 17, 2001 10:50 AM
Subject: [boost] python - global var

>
> I have a some libraries that communicate through a global object that
> I want to wrap with boost::python. The 'main' driver code initializes
> this object at global scope and the libraries use this instance. I
> probably can and should replace this with a singleton design. But,
> while I embark on this redesign, I wonder if there is a way to
> construct an instance at global scope using boost::python without a
> redesign.
>
> I guess there is a good reason why my mother always told me to avoid
> global variables...

If I understand your problem, I think you can stick your global object in a
DLL, and have all of your boost::python modules link to it.

-Dave


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