[C++-sig] interfacing headle binary file library, raw pointer and buffer

2010-06-19 Thread heroxbd
Dear all, I am trying to interface a binary file library using py++. There is a function in the library like int read(void* buffer, size_t len) which is hard to wrap. It read a piece (size len) of the file, and store it in buffer, and then return the buffer length (most likely equal to le

Re: [C++-sig] interfacing headle binary file library, raw pointer and buffer

2010-06-20 Thread heroxbd
Hello, I have just found this thread interesting http://thread.gmane.org/gmane.comp.python.c++/12912/focus=12913 the pointers are PyString_FromStringAndSize PyArg_ParseTuple* and http://docs.python.org/c-api/buffer.html How can those fit in py++ and boost.python? Cheers, -- XU Benda Rese

Re: [C++-sig] interfacing headle binary file library, raw pointer and buffer

2010-06-21 Thread heroxbd
Allo Nat, Thank you very much for your reply. I didn't realized I could have this flexibility with py++ generated code. Now I could interface these functions. Cheers! Benda Nat Goodspeed writes: > You want to write a C++ wrapper function something like this: > > std::string wrapped_read(size_

[C++-sig] numpy integration with boost.python

2013-12-04 Thread heroxbd
Dear all, This is a cross post of stackoverflow[0]. I am interfacing a C++ data intense library with Python by py++[1]/boost.python[2]. After profiling my program, I find 70% of run time is spent on code like this: ni = range(v2o.getHits()) tau = np.array([v2o.TofCorrectedTime[i] for i i

Re: [C++-sig] numpy integration with boost.python

2013-12-06 Thread heroxbd
Dear all, [email protected] writes: > This is a cross post of stackoverflow[0]. > > [0]: > http://stackoverflow.com/questions/20376021/exchange-numpy-array-with-boost-python-pyublas-or-boost-numpy Feedback as a happy user. Jim has answered on stackoverflow. I decided to go with Boost.NumPy.