[C++-sig] boost::python - how to pass by reference/pointer to python overriden class functions

2011-05-25 Thread Jay Riley
Hi all, Hopefully this is the correct way to post a question, If not I apologize as I haven't used mailing lists before. Anyways, here is my problem: I have some class functions that takes in parameters by pointer. However, when I expose and override this class/these functions in boost::pytho

Re: [C++-sig] boost::python - how to pass by reference/pointer to python overriden class functions

2011-05-25 Thread Jay Riley
/pointer to > python overriden class functions > > On 05/25/2011 02:26 PM, Jay Riley wrote: > > I have some class functions that takes in parameters by pointer. > > However, when I expose and override this class/these functions in > > boost::python, any changes I make to the p

[C++-sig] Using boost::tuple from python

2011-06-25 Thread Jay Riley
I've been trying to figure out how to expose a property in my class that is a boost::tuple. The tuple is defined as follows: typedef boost::shared_ptr action_ptr; typedef boost::tuple ActionTargetTuple; It's contained with a class defined as follows: class Action : public Cloneable

[C++-sig] Boost Python - Implementing a Cloning function

2011-06-30 Thread Jay Riley
I'm trying to implement a Cloning function for one of my classes I want to extend to Python. Extending the classes in C++ is easy as I can just override the Clone function, but it's definitely not working like that for Python. Here's the code, with unimportant detail ommitted. template

[C++-sig] Boost Python loss of values

2011-08-25 Thread Jay Riley
I'm having a really weird issue in boost python. I'm focusing on a particular property/method to simplify the example. Here's the situation: In my program, I have a class called Attack. With the following layout (simplified for example) class Attack : public Action { public:

Re: [C++-sig] Boost Python loss of values

2011-08-26 Thread Jay Riley
member of the base class anyways? > Date: Thu, 25 Aug 2011 13:18:04 -0700 > From: tallji...@gmail.com > To: cplusplus-sig@python.org > CC: super24bitso...@hotmail.com > Subject: Re: [C++-sig] Boost Python loss of values > > On 08/25/2011 04:17 AM, Jay Riley wrote: > > >

Re: [C++-sig] Boost Python loss of values

2011-08-30 Thread Jay Riley
Self is indeed a PyObject* this is a bit confusing > Date: Fri, 26 Aug 2011 13:00:11 -0700 > From: tallji...@gmail.com > To: cplusplus-sig@python.org > Subject: Re: [C++-sig] Boost Python loss of values > > On 08/26/2011 08:27 AM, Jay Riley wrote: > > Hi Jim, > >

[C++-sig] Passing ownership to C++ through pointer

2011-11-07 Thread Jay Riley
I'm trying to pass an object from python to C++. I want C++ to take control of the object. The object I'm trying to change ownership on is defined in it's module as follows (superfluous code removed): BOOST_PYTHON_MODULE(ComponentModule){ class_ >("Component"

Re: [C++-sig] Passing ownership to C++ through pointer

2011-11-07 Thread Jay Riley
Sorry just as a quick append, UseComponentWrap inherits from UseComponent to allow overriding of a few virtual methods On 2011-11-08, at 1:13 AM, "Jay Riley" wrote: > I'm trying to pass an object from python to C++. I want C++ to take control > of the object. > &g

Re: [C++-sig] Passing ownership to C++ through pointer

2011-11-08 Thread Jay Riley
e_policy()) .def("__copy__", &generic__copy__) .def("__deepcopy__", &generic__deepcopy__) ; I really don't see how this can get turned into an Item, Any ideas? Thanks for the he

[C++-sig] Python freezing

2011-11-10 Thread Jay Riley
I'm doing some testing on my C++ wrappers, and I'm hitting a point where python just freezes. The debugger stops, no exception is thrown and my program stops responding. I'm not entirely sure what code to show, so if it's not enough, let me know. Here's the python code: class HealingComponent(U

Re: [C++-sig] Python freezing

2011-11-10 Thread Jay Riley
[C++-sig] Python freezing > > > on Thu Nov 10 2011, Jay Riley wrote: > > > so it seems as though string isn't in the registry? and the error > > gets digested silently. This is really weird and I don't quite > > understand why returning a string causing

[C++-sig] Boost python and boost signal

2011-11-21 Thread Jay Riley
I was wondering if it's possible to hook python functions as slots into boost::signal or boost::signal2 signals? I found an old thread that said it wasn't directly possible, but it was from 2004. ___ Cplusplus-

[C++-sig] Exposing Multi-Level Inheritance with virtual functions

2012-01-13 Thread Jay Riley
I've been looking around and I can find tons of information about how to wrap shallow inheritance hierarchys with virtual/pure virtual functions, but none of them show how to do multi level inheritance. I'm unsure if I'm supposed to inherit from the wrapper or the base class for the virtual fun

[C++-sig] boost ref problem

2012-02-06 Thread Jay Riley
I'm trying to wrap a C++ class into python. I need to pass an enum value by reference through a virtual function. I'm doing it like so (non relevant code omitted): class BasicRMLScreenWrap : public BasicRMLScreen{ public:bool HandleKeyPress

[C++-sig] Properly copying wrapped classes

2012-05-31 Thread Jay Riley
I'm having a problem with some python objects derived in python. I have a Clone method that's supposed to make a full copy of these python inherited objects, but it isn't working. The problem is my wrapper class' PyObject* self isn't getting copied, so when I use call_method<>(self, "method nam

Re: [C++-sig] Properly copying wrapped classes

2012-06-08 Thread Jay Riley
non clone prints out the python side code. > Date: Thu, 7 Jun 2012 17:13:55 -0400 > From: jbo...@astro.princeton.edu > To: super24bitso...@hotmail.com > Subject: Re: [C++-sig] Properly copying wrapped classes > > On 06/05/2012 12:41 AM, Jay Riley wrote: > > That got rid of the co

Re: [C++-sig] Properly copying wrapped classes

2012-06-09 Thread Jay Riley
> > > (btw, apologies to the rest of the list - I accidentally replied without > including the list a few emails back, but all you've missed are a number > of ideas that don't work) > > > Jim > > > > > > On 06/08/2012 0

[C++-sig] Problem with boost::unordered_map and map_indexing_suite

2013-03-20 Thread Jay Riley
I've come across two problems with some python exporting Im trying to do. First problems is as follows. I have the following piece of python code: inv = ActiveGame.GetPlayerParty().GetInventory().GetItems() print str(len(inv))print type(inv)inv["Th