Re: [C++-sig] Let pyhton deside which data it recieves...

2012-12-13 Thread Roman Yakovenko
On Tue, Dec 11, 2012 at 8:14 PM, Hendrik van Arragon wrote: > Hi, > > I've made a little class for serial communication, which i want to export > from c++ to python. My problem is, that this class does not know what data > it's receiving. The layer above the protocol knows how to handle the data

Re: [C++-sig] Indexing suite v2 multiple module problem

2012-07-25 Thread Roman Yakovenko
On Wed, Jul 25, 2012 at 11:03 AM, John Reid wrote: > Hi, > > I'm using a version of the indexing suite I believe I copied from > Roman's codebase some time ago. I've recently refactored my project into > multiple modules and now I'm have some runtime errors when iterating > over sequences in pytho

Re: [C++-sig] Injecting void* and HWND handling code from Py++

2012-05-29 Thread Roman Yakovenko
On Mon, May 28, 2012 at 6:37 AM, Suresh Joshi wrote: > Hello all! > > I had a question about how to handle void* and HWNDs from within Python > using Boost::Python and Py++. Reading through the Py++ documentation, I'm > loving how I can slice and dice my classes/wrappers and seemingly do > whateve

Re: [C++-sig] Boost.Python: How to fill a passed in buffer in Python

2012-05-01 Thread Roman Yakovenko
On Tue, May 1, 2012 at 10:53 PM, Ehsan Pi wrote: > In Python, the output of the GetAddress is a void * to the memory address: > >     >>> import MyWrapper >     >>> foo = MyWrapper.Foo(100) >     >>> address = foo.GetAddress() >     >>> print address >     >     >>> > > My question is can I fill

Re: [C++-sig] Wrapping and Passing HWND with Boost.Python

2012-05-01 Thread Roman Yakovenko
On Tue, May 1, 2012 at 5:25 PM, Ehsan Pi wrote: > Thanks Roman, > > I believe these are not specific to py++ but boost.python, correct? Yes > What I > mean is whether it can be automated through the py++ wrapper, or do I have > to manually alter the py++ generated cpp file? Yes. py++ supports o

Re: [C++-sig] Wrapping and Passing HWND with Boost.Python

2012-04-30 Thread Roman Yakovenko
On Mon, Apr 30, 2012 at 9:54 PM, Ehsan Pi wrote: > Thanks Roman for your quick reply, > > That's what confuses me. HWND is essentially a pointer to an int to hold the > window handle. How can to convert them to each other? I am not sure that you are right, but in case you are, use make_constructo

Re: [C++-sig] Wrapping and Passing HWND with Boost.Python

2012-04-30 Thread Roman Yakovenko
On Mon, Apr 30, 2012 at 9:11 PM, Ehsan Pi wrote: > In python I get the not-match error: > >     >>> import MyWrapper >     >>> import win32gui >     >>> hwnd = win32gui.GetDesktopWindow() >     >>> foo = MyWrapper.Foo(hwnd) >     Traceback (most recent call last): >       File "", line 1, in >  

Re: [C++-sig] EXTERNAL: Re: pygccxml KeyError

2011-12-21 Thread Roman Yakovenko
On Wed, Dec 21, 2011 at 2:44 AM, Davidson, Josh wrote: > I did run into a couple subtle problems with this approach.  Depending on > where I put the header file, Py++ doesn't generate pypp.hpp/pypp.cpp files > that actually register the data structures.  Everything shows up in the > exposed_dec

Re: [C++-sig] Complaint about missing call policies, when they are in fact specified

2011-12-19 Thread Roman Yakovenko
On Mon, Dec 19, 2011 at 9:01 PM, Davidson, Josh wrote: > I'm adding return value call policies to methods of a class as follows: >        mb.class_("SerialStore").member_functions(lambda decl: > decl.name.startswith("getSim")).call_policies = \ >            call_policies.return_internal_reference

Re: [C++-sig] EXTERNAL: Re: pygccxml KeyError

2011-12-19 Thread Roman Yakovenko
On Mon, Dec 19, 2011 at 10:24 PM, Davidson, Josh wrote: > Actually, it is using a source_reader_t by default.  __parse_declarations > invokes __parse_file_by_file, which uses a source_reader_t (line 236) to > parse each file.  It then bombs out after parsing all of the files when it > calls _jo

Re: [C++-sig] pygccxml KeyError

2011-12-19 Thread Roman Yakovenko
On Sat, Dec 17, 2011 at 2:23 AM, Davidson, Josh wrote: > Hopefully, there’s enough information in the traceback, but if not I can try > to sanitize an example.  I’m on rev 1856. More or less. Sorry for late response, I was pretty busy. >   File "c:\Python26\lib\site-packages\pygccxml\parser\proj

Re: [C++-sig] [Boost.Python v3] Features and Scope

2011-08-27 Thread Roman Yakovenko
On Sat, Aug 27, 2011 at 2:39 AM, Jim Bosch wrote: > I am aware of Py++ and the extensions associated with it, and some of that > could definitely go into Boost.Python proper (and I think I've heard Roman > state that he wouldn't have a problem with someone else doing the work to > make it so, and

Re: [C++-sig] [Py++] shared_ptr registration

2011-05-21 Thread Roman Yakovenko
On Thu, May 19, 2011 at 4:23 PM, Kirill Lapshin wrote: > Fair enough, it is not a big deal and easy to handle in client code. I > don't necessarily agree with your point though. To me the whole wrapper > business is implementation detail. Unless I'm missing something it doesn't > really matter ho

Re: [C++-sig] [Py++] Bug in balanced file writer

2011-05-21 Thread Roman Yakovenko
On Thu, May 19, 2011 at 4:27 PM, Kirill Lapshin wrote: > Hi Roman/all, > > Today I've found what I believe a bug in balanced file writer. > > Suppose you have 24 class_creators and trying to split them into 10 > buckets. What it currently does is: > - how many creators per bucket? 24/10 = 2. uhm,

Re: [C++-sig] [Py++] shared_ptr registration

2011-05-18 Thread Roman Yakovenko
On Wed, May 18, 2011 at 5:06 PM, Kirill Lapshin wrote: > On 18/05/2011 04:27, Roman Yakovenko wrote: >> >> Many years ago, I submitted a patch to this mailing list which adds >> support for boost::shared_ptr< const T > to Boost.Python. It looks like >> it was not

Re: [C++-sig] [Py++] shared_ptr registration

2011-05-17 Thread Roman Yakovenko
On Tue, May 17, 2011 at 4:48 PM, Kirill Lapshin wrote: > Hello Roman/All, > Hello. > I used Py++ before, and was very happy with it, now I'm working on a new > project and trying to introduce Py++ here as well. Naturally I decided to > get a latest version (was using a bit outdated version bef

Re: [C++-sig] py++ site down? Project moved?

2011-05-17 Thread Roman Yakovenko
On Tue, May 17, 2011 at 5:04 PM, Holger Joukl wrote: > > Hi, > > has py++ moved somewhere else? > > This seems to be unreachable: > > http://language-binding.net/pyplusplus/pyplusplus.html I just redirected "language-binding.net" to http://sourceforge.net/projects/pygccxml/ . It will take some

Re: [C++-sig] help on abstract class export

2011-04-29 Thread Roman Yakovenko
On Fri, Apr 29, 2011 at 10:14 AM, zeb wrote: > Hi, I'm trying to export the following code to python, but failed. Please > help me! > Here is the code: > -- > c++ code: > -- > class IWorker { > public: >        virtual int getData() = 0; > }; > > class Worker : public IWork

Re: [C++-sig] language-binding.net website not available

2011-03-25 Thread Roman Yakovenko
erything you need on http://sourceforge.net/projects/pygccxml/ page - documentation, bug tracking, mailing list, source and etc. > I also haven't seen Roman Yakovenko posting here recently. > There were 0 posts related to py++ :-). The project is aliv

Re: [C++-sig] problems with typedef void *

2010-12-14 Thread Roman Yakovenko
On Tue, Dec 14, 2010 at 11:03 PM, Jacob Davis wrote: > > > On Sun, Dec 12, 2010 at 3:04 PM, Jim Bosch wrote: > >> I think you'll want to define a custom wrapper class for each of these >> typedefs with a distinct type. From your example, it looks like many of >> these might be similar enough th

Re: [C++-sig] pygccxml and template classes

2010-12-08 Thread Roman Yakovenko
On Wed, Dec 8, 2010 at 9:40 AM, Davidson, Josh wrote: > I'm having some trouble getting pyccxml to parse specialized classes. > Consider the following simple header file: > > > #ifndef TEMPLATECLASS_HPP_ > #define TEMPLATECLASS_HPP_ > > template > class TemplateClass { > ... > }; > > #endif

Re: [C++-sig] pygccxml and inner classes

2010-11-29 Thread Roman Yakovenko
On Mon, Nov 29, 2010 at 8:36 AM, Davidson, Josh wrote: > I'm wondering if this behavior is correct when using pygccxml. Consider > the following two sets of simple class definitions: > > -- SET 1 -- > class inner { > protected: >unsigned a; >unsigned b; >

Re: [C++-sig] pyplusplus bug related to boost::equality_comparable (and possibly other operators as well)

2010-09-09 Thread Roman Yakovenko
he one to know best?) I may try. I don't think fixing py++ is the right approach. > I'm also considering a workaround of > checking bases for all the classes and add missing "self != self" for all > those which derive from equality_comparable; > Perhaps there is the

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

2010-06-21 Thread Roman Yakovenko
to create a function transformation for them. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] problem exposing iterators

2010-06-19 Thread Roman Yakovenko
ion where I can expose iterators(some kind > of support available for iterators). No need to reinvent the wheel: * http://www.boost.org/doc/libs/1_43_0/libs/python/doc/v2/iterator.html - this functionality is not supported by py++ * http://language-binding.net/pyplusplus/documentation/inde

Re: [C++-sig] How to add new constructor in a class

2010-06-19 Thread Roman Yakovenko
ppose a constructor is declared as private can I change it's access as > a public (or can I overwrite it somehow)? #define private public #include this ugly trick will allow you to achieve what you want, but it may not work on some compilers/classes. You will have to check

Re: [C++-sig] How to search constructors with namespace

2010-06-01 Thread Roman Yakovenko
> and it is working fine. > > Thanks can someone, please let me know the reason why :: (scope operator) is > required in the start of the argument. I tried really hard to make this functionality more "user friendly", but failed. Take a look on http://pygccxml.svn.sourcef

Re: [C++-sig] The declaration is unexposed

2010-05-28 Thread Roman Yakovenko
ould be the reason behind it, and what could I do > to include those class (for example class myName). I don't know, may be father code excludes it, may be the class is private, may be bug in py++, may be bug in your "find_out_dependency-include" loop. I really can't say you. You

Re: [C++-sig] The declaration is unexposed

2010-05-27 Thread Roman Yakovenko
t; INFO Parsing source file "./a.h" ... > INFO gccxml cmd: /usr/local/bin/gccxml  -I"."   "./a.h" > -fxml="/tmp/tmpB13bTu.xml" > INFO GCCXML version - 0.9( 1.132 ) > > WARNING: someClassB [class] >> execution error W1040: The declarat

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-25 Thread Roman Yakovenko
us; >        Result const result; >     //   boost::optional const result; > }; May be I miss something, but this class has "const member variable" and doesn't have user define copy constructor ( it is commented out ). In this case the class indeed noncopyable. Am I wrong? -

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread Roman Yakovenko
+ wrong, you can always override its decision: > >>mb = module_builder_t( ... ) >>mb.class_(...).noncopyable = False > > Thanks again it is helpful for us. It seems, that py++ was wrong :-(. Can you specify gccxml version, OS and your compiler? Do you mind to submit a small test case that repro

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread Roman Yakovenko
e used py++ (latest version) for code generation Please post a small and complete code directly to the mailing list. Did you try to remove "noncopyable" from the generated code? If so what happened? If you think, that py++ wrong, you can always override its decision: mb = module_build

Re: [C++-sig] [Py++] Undefined symbols for static const int member of class

2010-05-21 Thread Roman Yakovenko
ggest you to take a look on Py++ unittests, especially on "statics_tester.py" and "statics_to_be_exported.[c|h]pp" files. They deal with exactly your use case -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] single-declaration code generation in Py++

2010-05-09 Thread Roman Yakovenko
neration-engine ), especially "code creators" sections. Then take a look on 'pyplusplus/file_writers/( single_file.py and multiple_files.py ) modules. pyplusplus/code_creators/algorithm.py has some code, that helps to work with "code creators tree&q

Re: [C++-sig] How to use functionality of list.

2010-05-06 Thread Roman Yakovenko
y > .def( "push_back", &mylist_push_back ) ... >From Python, your user will not see any difference: alist = AList() alist.push_back|( ) HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/

Re: [C++-sig] How to use functionality of list.

2010-05-05 Thread Roman Yakovenko
Both indexing suites provides interface very similar to Python containers. So the user will not have to learn new API, but if you insists, you can rename/introduce new method from Python AList.push_back = AList.append -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ _

Re: [C++-sig] How to use functionality of list.

2010-05-05 Thread Roman Yakovenko
his topic is covered in the following document: http://language-binding.net/pyplusplus/documentation/containers.html HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Problems with boost tuples to python conversion

2010-04-29 Thread Roman Yakovenko
ss_( 'null_type' ).include() > > the warning disapeared but the module still couldn't be loaded. I attach the generated code from my test, which is based on your files, so you can study it. It works fine for me ( Ubuntu 10.04, gcc 4.4.3 and I think Boost SVN ). HTH -- Roman Yakov

Re: [C++-sig] Problems with boost tuples to python conversion

2010-04-29 Thread Roman Yakovenko
and verified that the proposed solution actually works. I will try to add "boost::tuple" support to py++ next week. Let me know, if you need more help with this issue. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Problems with boost tuples to python conversion

2010-04-29 Thread Roman Yakovenko
the last time. > But now... there's some problem with pygccxml I think :| This is indeed a huge progress, I will take a look on this error today. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing l

Re: [C++-sig] Problems with boost tuples to python conversion

2010-04-28 Thread Roman Yakovenko
On Thu, Apr 29, 2010 at 2:24 AM, Maciej Sitarz wrote: > On 28.03.2010 11:53, Roman Yakovenko wrote: >> >> On Sun, Mar 28, 2010 at 4:53 AM, Maciej Sitarz  > >> So that would be a big problem, because that's a C++ API for a library >> which >>> >>&

Re: [C++-sig] Wrapping a pure virtual method with multiple arguments

2010-04-16 Thread Roman Yakovenko
gt; /usr/local/boost_1_42_0/boost/python/object/value_holder.hpp:137: error: no > matching function for call to > ‘ms_mascotresults_wrapper::ms_mascotresults_wrapper(matrix_science::ms_mascotresfile&, > const unsigned int&, const double&, const int&, const char* const&, const > char* const&)’ > > > ms_mascotresults.cpp:12: note: candidates are: > ms_mascotresults_wrapper::ms_mascotresults_wrapper(const > ms_mascotresults_wrapper&) > > > ms_mascotresults.cpp:12: note: > ms_mascotresults_wrapper::ms_mascotresults_wrapper() > > > > > > If I comment the virtual function getPeptide in the .hpp, it builds > perfectly with this constructor : > >         class_("ms_mascotresults", init  &, const unsigned int, double, int, const char *,const char *>()) > > This is the first time I use Boost.Python so I don't really know what > happens inside, I don't understand this errors of candidates given the fact > that there is only one constructor in the .hpp ... > > > Thanks in advance for your help. > > Fallino > > > > ___ > Cplusplus-sig mailing list > Cplusplus-sig@python.org > http://mail.python.org/mailman/listinfo/cplusplus-sig > -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] std::auto_ptr<> in constructor

2010-04-14 Thread Roman Yakovenko
On Thu, Apr 15, 2010 at 7:17 AM, Roman Yakovenko wrote: > On Thu, Apr 15, 2010 at 1:08 AM, Tomasz Mikolajczyk > wrote: >> Hi, >> >> I'm a new user of boost::python art. I started to play a bit with the >> code and the py++ generator and encountered diffic

Re: [C++-sig] std::auto_ptr<> in constructor

2010-04-14 Thread Roman Yakovenko
ut I don't know what to do to avoid it. I will take a look on this issue today. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] How to make use of -> (dereferncing) operator in pyplusplus

2010-04-14 Thread Roman Yakovenko
ave to "configure" py++ to produce such code. You can take a look on PyOgre project, as it does this. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] How to make use of -> (dereferncing) operator in pyplusplus

2010-04-14 Thread Roman Yakovenko
working example. You can download it and study. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] How to make use of -> (dereferncing) operator in pyplusplus

2010-04-14 Thread Roman Yakovenko
"operator*" and "operator->". The following example ( http://language-binding.net/pyplusplus/troubleshooting_guide/smart_ptrs/smart_ptrs.html ) should help you. Also, in the past there were a lot of discussions on this subject, so using Google will definitely help

Re: [C++-sig] "operator++" is not supported

2010-04-09 Thread Roman Yakovenko
support for these operators. and pyplusplus is failing to > generate wrapper code for these operator. Are there any work around or some > functionality available in py++ to handle these. If you will create small and complete example of what your are trying to do, then may be I would be ab

Re: [C++-sig] Conversion of python files to C++ ostreams

2010-04-04 Thread Roman Yakovenko
of free time these days, nevertheless I will be glad to test your changes, when they will be ready. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/ma

Re: [C++-sig] custom r-value converters

2010-03-29 Thread Roman Yakovenko
;t have one at this point - make_getter/setter is creating it. What > am I doing wrong here? I am not sure. What py++ version do you use? Can you post small and complete example, of what you are trying to do? -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Problems with boost tuples to python conversion

2010-03-28 Thread Roman Yakovenko
nage to investigate how did > they do it. I sent the question to PyOgre main developer. When the answer will be available, I will publish it here. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-

Re: [C++-sig] Problems with boost tuples to python conversion

2010-03-27 Thread Roman Yakovenko
2.4/site-packages/pygccxml/parser/source_reader.py", > line 231, in read_gccxml_file > pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured while > running GCC-XML: /home/macieks/boost/boost_1_42_0/boost/mpl/bool_fwd.hpp:21: > sorry, unimplemented: call_expr cannot be mang

Re: [C++-sig] examples for add_override_precall_code?

2010-03-25 Thread Roman Yakovenko
uses "BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS" macro ( see Boost.Python reference for explanation ). I guess what you want to use/change is the function alias: mb = module_builder_t ( ) connection = mb.class_( 'Connection' ) for callback in connection.mem_

Re: [C++-sig] [Py++] Registration order corner case

2010-03-25 Thread Roman Yakovenko
uot; ); bp::class_< foo1_t::foo2_t, bp::bases< foo3_t > >( "foo2_t", "documentation" ); } } There is another problem with that code: class foo3_t is exposed under class foo1_t. You can fix this using a simple Python code: foo3_t = .foo1_t.foo3_t The only

Re: [C++-sig] [Py++] Registration order corner case

2010-03-25 Thread Roman Yakovenko
) sorted = pypp_sort_classes( classes, include_vars ) < put class X before class Y > return sorted pyplusplus/creators_factory/sort_algorithms.sort_classes = my_sort_classes If you have even less time, you always can modified file by hands, create the patch and apply it e

Re: [C++-sig] [Py++] boost::shared_ptr casting

2010-03-21 Thread Roman Yakovenko
e. In any case, without virtual table you can't expect the "desired functionality" to work. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Py++ module for code with protected operator=

2010-03-21 Thread Roman Yakovenko
shouldn't it? 1. I would talk with developers to understand the reasons for such interface 2. create wrapper function, which takes regular python list and creates a vector from it and expose this function, instead of the original one -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] [Py++] boost::shared_ptr casting

2010-03-20 Thread Roman Yakovenko
but with the following class definition class Base { public: virtual ~Base(){} }; class Derived : public Base { }; -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@pyt

Re: [C++-sig] Py++ module for code with protected operator=

2010-03-20 Thread Roman Yakovenko
{} int value; protected: item_t& operator=( const item_t& other ); }; int main( int argc, const char** argv ){ std::vector< item_t > values( 10, item_t( 12 )); for( size_t i = 0; i < values.size(); ++i ){ values[ i ].value = i; } } -- R

Re: [C++-sig] Py++ module for code with protected operator=

2010-03-20 Thread Roman Yakovenko
On Sat, Mar 20, 2010 at 10:12 PM, Maciej Sitarz wrote: > On 20.03.2010 20:47, Roman Yakovenko wrote: > Em... but the example main() compiles and works... unless I want to > 'push_back' object to the vector. This is exactly my point >> I think, you will have to chan

Re: [C++-sig] Py++ module for code with protected operator=

2010-03-20 Thread Roman Yakovenko
On Sat, Mar 20, 2010 at 9:15 PM, Maciej Sitarz wrote: > On 20.03.2010 19:12, Roman Yakovenko wrote: >> >> On Fri, Mar 19, 2010 at 6:42 PM, Maciej Sitarz  wrote: > The compile errors are still the same: > generated.cpp:40:   instantiated from here > test.h:6: er

Re: [C++-sig] Py++ - one header file including all project header files

2010-03-20 Thread Roman Yakovenko
On Fri, Mar 19, 2010 at 1:27 AM, Maciej Sitarz wrote: > On 17.03.2010 08:52, Roman Yakovenko wrote: >> >> Nothing, really. >> >> Please take a look on the following document: >> >> http://language-binding.net/pyplusplus/documentation/tutorials/module_b

Re: [C++-sig] Py++ module for code with protected operator=

2010-03-20 Thread Roman Yakovenko
u can not use such classes with Boost.Python indexing suite. I suggest you to switch to the indexing suite that comes with Py++: http://language-binding.net/pyplusplus/documentation/containers.html . I am pretty sure it will work out of the box. You will not have to specify "noncopyable=True"

Re: [C++-sig] Py++ - one header file including all project header files

2010-03-17 Thread Roman Yakovenko
nguage-binding.net/pyplusplus/documentation/tutorials/module_builder/module_builder.html#declarations-customization and let me know whether is makes sense to you. If not come back and we will resolve the issue -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/

Re: [C++-sig] ubuntu/gcc/gccxml

2010-03-15 Thread Roman Yakovenko
is working at all? I am using and testing py++ and pygccxml on Ubuntu 9.10 32/64 architectures with gcc-4.4.1 as the default compiler. pygccxml svn contains compiled gccxml for those architectures ( http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/gccxml_bin/v09/ ) and us

Re: [C++-sig] [Boost.Python] Wrapping C library functions

2010-02-15 Thread Roman Yakovenko
.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/examples/gmplib_dev/ HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] [Py++] Indexing suite 2: missing methods

2010-02-15 Thread Roman Yakovenko
On Mon, Feb 15, 2010 at 1:30 PM, peoro wrote: > On Sun, Feb 14, 2010 at 8:39 PM, Roman Yakovenko >> Can you create small and complete example? ( C++ code, Py++ script and >> Py++ generated code )? >> >> Thanks >> > > Sure: > > # main.cpp > #inc

Re: [C++-sig] [Boost.Python] Wrapping C library functions

2010-02-14 Thread Roman Yakovenko
You will get pure-Python solution. There are even few code generators out there, that will happily generate initial ctypes code for you. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig ma

Re: [C++-sig] [Py++] Indexing suite 2: missing methods

2010-02-14 Thread Roman Yakovenko
On Sun, Feb 14, 2010 at 6:22 PM, peoro wrote: > On Sat, Feb 13, 2010 at 8:05 PM, Roman Yakovenko > wrote: >> Did you try len( x )? >> > > Yes, I tried and it isn't working. > ... > I've been trying with SVN revisions 1814 and 1824. Can you create sm

Re: [C++-sig] [Py++] Indexing suite 2: missing methods

2010-02-13 Thread Roman Yakovenko
hat,  in my opinion, should be provided. It is provided. > Is this a feature or a bug? And in the former case, how would I be > supposed to get a set's size? explicitly exposing a `size' function > for it? Did you try len( x )? -- Roman Yakovenko C++ Python

Re: [C++-sig] [Py++] C++ containers and Python sequences

2010-02-02 Thread Roman Yakovenko
xml-development > I've been trying to play with pyplusplus.module_builder, but cannot > find a way to allow native conversions, and google isn't being of help > either. > Is it possible to achieve native conversions, and, if it is, why is it > not done by defaul

Re: [C++-sig] Python Exported Method that Takes a Boost::Function Object

2010-02-01 Thread Roman Yakovenko
l recurring = false ){ createTimer( interval, boost::function( callback_wrapper_t( function ) ), recurring ) } 3. Register the createTimerWrapper I think this could work. May be there is a better way. If you have a lot of functions like this and the idea works, I can help you to generat

Re: [C++-sig] Using code generated by Py++ as a Python extension

2010-01-31 Thread Roman Yakovenko
FIX='' , SHLIBSUFFIX='.so' ) Since your code generator written in Python, you can continue where Py++ stops and generate your favorite "make" file. You can go even father. Py++ tests generate the code, compile, load new module and test the functionality. All this is done in a single, stand alone process. HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Py++/boost::python: How to correctly wrap libraries (DLLs) with dependencies on each other.

2010-01-20 Thread Roman Yakovenko
xplain how to solve this issue with > Py++ and boost::python. Take a look on http://language-binding.net/pyplusplus/documentation/multi_module_development.html . The document describes the situation you have. If you need a good example take a look on Python-Ogre project. It uses "multi modu

[C++-sig] A nice Boost.Python and Py++ usage example

2010-01-13 Thread Roman Yakovenko
http://frontiersin.org/psychology/psychology/paper/10.3389/neuro.11/011.2009/html/ The articles talks about some science fiction ( for me:-) ), but also has few paragraphs related to Boost.Python and Py++. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net

Re: [C++-sig] Conversion problem

2010-01-13 Thread Roman Yakovenko
i ){ ... } and expose it. Another solution would be to use ctypes module to call those functions. In both cases Py++ can help you: http://language-binding.net/pyplusplus/documentation/functions/transformation/transformation.html -- Roman Yakovenko C++ Python language bin

Re: [C++-sig] [boost.python] How can I wrap operator==?

2010-01-12 Thread Roman Yakovenko
n Document__EqualWrap. If I understand you right, you need: 1. define new global function, which takes Document& as the first argument bool Document_EqualWrap( const Document& x, const Document& y ){...} 2. Expose it: ... .def( "__eq__", &Document_EqualWrap ) Is not

Re: [C++-sig] Member function bp::optional? Or workaround?

2010-01-12 Thread Roman Yakovenko
"bar" , (int ( ::overloads_macro::Foo::* )( ::overloads_macro::X const &,::overloads_macro::Y const * ) )( &::overloads_macro::Foo::bar ) , ( bp::arg("arg0"), bp::arg("arg1")=bp::object() ) ); as you can see ( and try ) the generated

Re: [C++-sig] [boost.python] How can I wrap operator==?

2010-01-12 Thread Roman Yakovenko
piled... > > How can I do? It is not clear what you are asking for. If the "Document" class has special function for comparison, than may be you can define few global operators ( == and != ). -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ _

Re: [C++-sig] [Py++] Export #define directives to ctypes

2009-12-28 Thread Roman Yakovenko
False ) #will add code to the bottom of the module mb.add_module_code( "#bottom", tail=True ) Even if it doesn't solve you the current issue, it can help you with PyLint. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/

Re: [C++-sig] [Py++] Export #define directives to ctypes

2009-12-28 Thread Roman Yakovenko
Y_NONOPT -2 ./fuse_opt.h:144:#define FUSE_OPT_KEY_KEEP -3 ./fuse_opt.h:152:#define FUSE_OPT_KEY_DISCARD -4 ./fuse_opt.h:261:#endif /* _FUSE_OPT_H_ */ Search completed with 63 matches. I could be wrong, but a proposed solution successfully handles (

Re: [C++-sig] [Py++] Export #define directives to ctypes

2009-12-27 Thread Roman Yakovenko
_builder_t( ... ) for file_path in pygccxml.declarations.declaration_files( mb.global_ns ): if file_path is not under "fuse" source code directory: continue else: use simple regex to search for "#define FUSE_*" expression, extract its value and add it to

Re: [C++-sig] [Py++] Don't transform char* to c_char_p

2009-12-27 Thread Roman Yakovenko
ws to generate POINTER( c_char ) instead of c_char_p. The relevant commit are: * http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1786&view=rev * http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1790&view=rev The functionality should be used like: mb = ctypes_module_builder_t( ... ) mb.t

Re: [C++-sig] [Py++] ctypes generator ignores bit fields

2009-12-27 Thread Roman Yakovenko
On Sun, Dec 27, 2009 at 10:10 AM, Roman Yakovenko wrote: > On Sun, Dec 27, 2009 at 2:46 AM, Nikolaus Rath wrote: >> Hi, >> >> Thanks for looking into this. I'm afraid the fix for the CFUNCTYPE vs >> POINTER(CFUNCTYPE) issue is not completely working though. >

Re: [C++-sig] [Py++] ctypes generator ignores bit fields

2009-12-27 Thread Roman Yakovenko
types.POINTER( ctypes.CFUNCTYPE( None, ctypes.c_void_p, > ctypes.POINTER( fuse_conn_info ) ) )), >    ("destroy", ctypes.POINTER( ctypes.CFUNCTYPE( None, ctypes.c_void_p >    ) )), > [...] :-(. I will take a look on this today. -- Roman Yakovenko C++ Python language binding http://www.lan

Re: [C++-sig] [Py++] ctypes generator ignores bit fields

2009-12-26 Thread Roman Yakovenko
On Sat, Dec 26, 2009 at 10:57 AM, Roman Yakovenko wrote: > Thanks. I will try to fix the problems you reported this evening and > will let you know. Nikolaus, I fixed both issues you reported: * http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1784&view=rev * http://pygccxml.svn.sourc

Re: [C++-sig] [Py++] ctypes generator ignores bit fields

2009-12-26 Thread Roman Yakovenko
'padding', ctypes.c_uint, 29), >        ('fh', ctypes.c_uint64), >        ('lock_owner', ctypes.c_uint64)] > > Best, > >   -Nikolaus > > -- >  »Time flies like an arrow, fruit flies like a Banana.« > >  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD

Re: [C++-sig] [Py++] ctypes generator produces wrong Python code for function pointers in structs

2009-12-26 Thread Roman Yakovenko
g=7 > do_callback called with flag=7 > Segmentation fault > > > Please let me know if you can reproduce the problem. It took me quite > some time to figure this out. > > > Best, > >   -Nikolaus > > -- >  »Time flies like an arrow, fruit flies like a Banana

Re: [C++-sig] [Py++] Don't transform char* to c_char_p

2009-12-23 Thread Roman Yakovenko
s.python.org/issue7569 ). I think it is a good think. I have only one problem: in Py++( pygccxml) types are "singletones". What is the best interface for the user to customize such thing? Should Py++ generate POINTER(c_char) in all cases by default? I would like to know your opinio

Re: [C++-sig] [Py++] Include additional code with ctypes code generator

2009-12-22 Thread Roman Yakovenko
ile and I will let you you when I implement the feature. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] [Py++] Missing struct

2009-12-15 Thread Roman Yakovenko
most cases it will do exactly what is needed. I prefer to explicitly select the desired declarations. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] [Py++] Missing struct

2009-12-15 Thread Roman Yakovenko
variables, which are pointers to functions and pygccxml failed in this case. I committed the fix. You will need to update pygccxml and Py++ projects. I also attached the generated file. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ # This file has been generat

Re: [C++-sig] Boost Python - How to export boost::shared_ptr

2009-12-15 Thread Roman Yakovenko
ter" could help you ( http://www.boost.org/doc/libs/1_41_0/libs/python/doc/v2/faq.html#custom_string ), but I never tried it on such use case. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ ___ Cplusplus-si

Re: [C++-sig] [Py++] Generate Python code for ctypes?

2009-12-14 Thread Roman Yakovenko
On Tue, Dec 15, 2009 at 12:35 AM, Nikolaus Rath wrote: > Roman Yakovenko writes: >>> Certainly all the exported symbols should already be available from >>> parsing the header file... Is it possible to omit the symbols file >>> and generate code based only on the h

Re: [C++-sig] [Py++] Missing struct

2009-12-14 Thread Roman Yakovenko
On Tue, Dec 15, 2009 at 12:40 AM, Nikolaus Rath wrote: > Roman Yakovenko writes: >> May be you should take a look on >> "module_builder/ctypes_decl_dependencies.py" module. It contains >> "find_out_dependencies" functionality. As input it takes a set o

Re: [C++-sig] [Py++] Missing struct

2009-12-14 Thread Roman Yakovenko
epends on? mb = ctypes_module_builder_t( ... ) mb.global_ns.exclude() fuse_lowlevel_ops = mb.class_( ' 'fuse_lowlevel_ops' ) for d in find_out_dependencies( [fuse_lowlevel_ops] ): d.include() I can't test the code right now, but it should look very similar to this. HTH --

Re: [C++-sig] [Py++] Include additional code with ctypes code generator

2009-12-14 Thread Roman Yakovenko
On Mon, Dec 14, 2009 at 9:33 PM, Roman Yakovenko wrote: > On Mon, Dec 14, 2009 at 4:00 PM, Nikolaus Rath wrote: >> Hello, >> >> Is there a way to add additional code to the output generated by the >> ctypes code generator? Specifically, I would like to add some special

Re: [C++-sig] what do I need to correctly port boost python extensions

2009-12-14 Thread Roman Yakovenko
interpreters it also can help you to see what python*.so will be actually used. > 3) import the module in python interpreter. > > Do I need to do something else (define some other variables or make some > other changes) in order to make my module work? In case you have few mo

Re: [C++-sig] [Py++] Generate Python code for ctypes?

2009-12-14 Thread Roman Yakovenko
; only on the headers? I don't think so( it didn't worked in my use case ) but you can try. Start to comment out code in ctypes_builder.py and post the result :-) -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/

Re: [C++-sig] [Py++] Include additional code with ctypes code generator

2009-12-14 Thread Roman Yakovenko
_config=gccxml_cfg ) > mb.build_code_creator(shared_library_file) > mb.add_registration_code( '#...@pydevcodeanalysisignore', False ) > > yields > > AttributeError: 'ctypes_module_builder_t' object has no attribute > 'add_registration_code' > Rig

  1   2   >