[C++-sig] Boost... Exception safe (can I turn it off?), and controlled object construction?

Adrian Bentley adruab at hotmail.com
Mon Mar 1 02:02:53 CET 2004


Hi,

I'd like to turn off the exception forwarding feature of boost python (trying to adapt for use in high performance where exceptions are not desired).  What I'd really like to do is be able to handle the exception classically, by giving it a function to call or the like.  I've read through some of the documentation and haven't found anything like this. Any pointers would be welcome.

Also, I'm trying to use the language in kind of a weird way.  It's probably a bad idea but I'm running with it anyway :)...  I'm trying to embed python as a scripting language for my object system thing (game engine framework), and I'd like to be able to extend objects using python (extend embed at the same time! :P).

Example of something like what I'm trying to do:

//In pyobject file
class BaseObject
{
    void *data; //where the variables will all go
    //All it's stuff in here, some which requires manual construction and such
};

Pythonclass : BaseObject
{
    //add stuff here
}

//in actual program
class Py_wrapper : public BaseObject
{
    PyObject    *pyo;    //gotten from embedded python

    //forward variable requests to python object etc....
};

// End example

Ok, now that you all know I'm crazy the reason why I want to do this is that the base object is designed to communicate a certain way with things it's attached to, which probably wouldn't cooperate with the way python works, so I need to manually construct the base object (also not sure how to do this in boost python).

Basically what I'd like is to have python override things like a class normally would, and track it in my object system.  I'm kind of doubting there's a way to do that, hence then extra layer of indirection py_wrapper (which should work).

So yeah, if anyone has any ideas I'd really appreciate it.  Feel free to enlighten me to a better method of interoperation (I'm kinda new to multi language stuff).  

Any help is appreciated, thanks,
Adruab > Adrian Bentley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20040229/81c39ca5/attachment.htm>


More information about the Cplusplus-sig mailing list