On Sun, Apr 4, 2010 at 1:07 PM, Christopher Bruns wrote:
[...]
>>> // C++ API
>>> struct Foo {
>>> Foo(ostream& os);
>>> };
>>>
>>> # desired python usage
>>> foo = Foo(streambuf(sys.stdout))
Solved. Thanks everyone
On Sat, Apr 3, 2010 at 8:54 PM, Ralf W. Grosse-Kunstleve wrote:
>> // C++ API
>> struct Foo {
>> Foo(ostream& os);
>> };
>>
>> # desired python usage
>> foo = Foo(streambuf(sys.stdout))
>
> Did you already try the usual
>
> def(init((arg("os"
Yes. Well pretty close. Py++ code generator
On Sat, Apr 3, 2010 at 11:53 AM, troy d. straszheim wrote:
> BOOST_PYTHON_MODULE(mod)
> {
> def("sayhello", as( &sayhello ));
> // arg converter ^
> };
>
> The as<> might need some clarification
Thanks Troy for the helpful tip.
I'm still confused by the "as<>" symbol. I
On Thu, Apr 1, 2010 at 1:32 PM, Michele De Stefano
wrote:
> So, as shown into the doxygen example, you have to program a wrapper
> like this one:
>
> foo_wrap(boost::python::object pyfile) {
>
> mds_utils::python::oFileObj fobj(py_file);
>
> foo(fobj);
> }
That's clever. I wonder ho
On Thu, Apr 1, 2010 at 7:11 PM, Ralf W. Grosse-Kunstleve wrote:
>> Is it necessary to explicitly invoke the streambuf object from python?
>
> Yes. I could be different and in fact was different in the initial
> implementation (if you look back in the svn history). But there were
> a few subtle pro
On Tue, Mar 30, 2010 at 11:33 AM, Ralf W. Grosse-Kunstleve
wrote:
> http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/boost_adaptbx/python_streambuf.h?view=markup
I have not seen this cctbx product before. It especially interesting
to me, since I am performing molecular computations, and also
On Tue, Mar 30, 2010 at 12:02 AM, Michele De Stefano
wrote:
> there is a much easier way to treat a FILE* as a C++ stream. The easy
> way is to use my open source library (mds-utils,
> http://code.google.com/p/mds-utils/).
If I have a C++ api like:
void foo(ostream& os);
using mds-utils, would
I am trying to coax boost.python to automatically convert python files
to C++ std::ostreams, for methods that take arguments of type
"std::ostream&". I have made some progress, and I could use some
advice on how to go further.
I created a derived class of std::ostream, called FilestarOstream,
whi
On Thu, Mar 25, 2010 at 2:20 PM, Roman Yakovenko
wrote:
>...
> Is this an option to "drop" base classes:
>...
> If not, then there is one more option, but you definitely not going to
> like it - to manipulate code creators tree.
>...
Thanks for the in depth explanation. I am glad to learn that t
010 at 8:34 PM, Christopher Bruns
> wrote:
>> ...
>> //## foo.h ###
>> struct Foo1 { struct Foo2; };
>> struct Foo3 : public Foo1 {};
>> struct Foo1::Foo2 : public Foo3 {};
>> ...
>
> I am pretty sure Py++ doesn't export such hierar
Py++ has produced for me over 97,000 lines of beautiful boost.python
wrapping code on my project, using less than 2500 lines of python.
But I am still experiencing some minor troubles that prevent me from
completing my project.
Suppose I wish to wrap the following:
//## foo.h ###
stru
Below is a simplified example of a tricky wrapping problem I have
encountered. The example remains somewhat complicated, but further
simplification results in a file that causes no trouble.
I get a compile error when I try to build the boost python code
generated by the following case:
test_
Roman Yakovenko wrote:
> On Wed, Sep 30, 2009 at 6:18 PM, Christopher Bruns
> wrote:
> > I suspect I can manually adjust the implicitly_convertible tag
> > generation using the "allow_implicit_conversion" flag in pyplusplus.
> > Is there a way to tell
Single-argument C++ constructors in pyplusplus seem to generate a
boost::python::implicitly_convertible tag, even when the constructor
is declared "explicit" in C++. That doesn't sound right to me.
Shouldn't a pair of types that are not implicitly convertible in C++,
also not be implicitly convert
Please help. I am just a beginner with pyplusplus and am not smart
enough to see how to create certain complex rules.
How would I create a pyplusplus rule for setting the return policy to
"return internal reference" for all member functions that meet the
following criteria:
* method name begins
15 matches
Mail list logo