Hi everyone,

I think I'm finally getting the hang of this, I seem to have gotten almost 
everything in my project working thanks to Gustavo's latest pybindgen patch. 
One of the remaining things I am having difficulty with is putting annotations 
on member variables of a class. I have something of the form:

class foo{
 <stuff>
};

class baz {
  public:
  foo* var;
}

The error I am getting from pybindgen is "WrapperWarning: Return value '::foo 
*' error (used in baz::var [variable]): TypeConfigurationError('Either 
caller_owns_return or self.reference_existing_object must be given')

 I know that the issue is that I need to stick an annotation on there. Since 
the pointer is allocated and tracked by the underlying C++ code, I'm pretty 
sure that I need to put reference_existing_object on it. I've tried inserting 
"{'reference_existing_object' : 'true'}" into the global_annotations table, and 
also inserting it into the parameter_annotations["return"] dictionary. For 
kicks, I even tried both at once. No matter what I do I can't get rid of the 
error, or see it show up in my final build, which leads me to believe there's 
something I'm missing. I went and looked up the documentation for 
reference_existing_object, but of course none of their examples show how you 
could use it on a member variable. What am I missing?

Thanks,
Ben Fitzpatrick
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to