pygccxml-development Mailing List for C++ Python language bindings (Page 6)
Brought to you by:
mbaas,
roman_yakovenko
You can subscribe to this list here.
2006 |
Jan
|
Feb
(6) |
Mar
(160) |
Apr
(96) |
May
(152) |
Jun
(72) |
Jul
(99) |
Aug
(189) |
Sep
(161) |
Oct
(110) |
Nov
(9) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(13) |
Feb
(48) |
Mar
(35) |
Apr
(7) |
May
(37) |
Jun
(8) |
Jul
(15) |
Aug
(8) |
Sep
(2) |
Oct
(1) |
Nov
(2) |
Dec
(38) |
2008 |
Jan
(11) |
Feb
(29) |
Mar
(17) |
Apr
(3) |
May
|
Jun
(64) |
Jul
(49) |
Aug
(51) |
Sep
(18) |
Oct
(22) |
Nov
(9) |
Dec
(9) |
2009 |
Jan
(28) |
Feb
(15) |
Mar
(2) |
Apr
(11) |
May
(6) |
Jun
(2) |
Jul
(3) |
Aug
(34) |
Sep
(5) |
Oct
(7) |
Nov
(13) |
Dec
(14) |
2010 |
Jan
(39) |
Feb
(3) |
Mar
(3) |
Apr
(14) |
May
(11) |
Jun
(8) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(7) |
Apr
|
May
|
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2016 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2021 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
From: Roman Y. <rom...@gm...> - 2009-12-06 14:34:57
|
On Sun, Dec 6, 2009 at 4:23 PM, Romain CHANU <rom...@gm...> wrote: > Hi, > I am using Py++ to generate the bindings for a C++ class using a vector of > objects (i.e std::vector<MyObject>) > I got this error: > "the next line of code will not compile, because "::MyObject" does not have > operator== !" > Could anyone tell me why I need to define this boolean operator? Do you use indexing suite, that comes with boost? If so, you need this operator for "contains", "index" and other functionality. You can switch to indexing suite v2 and than you will not have to define the operator. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Romain C. <rom...@gm...> - 2009-12-06 14:23:24
|
Hi, I am using Py++ to generate the bindings for a C++ class using a vector of objects (i.e std::vector<MyObject>) I got this error: "the next line of code will not compile, because "::MyObject" does not have operator== !" Could anyone tell me why I need to define this boolean operator? Cheers, Romain |
From: Berserker <ber...@ho...> - 2009-11-30 08:57:50
|
Roman Yakovenko wrote: > Yes. Take a look on pyplusplus/creators_factory/sort_algorithms.py > > You can write the following code: > > import pyplusplus.creators_factory.sort_algorithm as sort_algs > sort_algs.sort_classes = << your function >> > > Also the code sits in the "implementation directory", it belongs to > "public interface" and some day I will move it there. Thanks Roman, I managed to sort classes using this method :) _________________________________________________________________ Facile, veloce, sicuro: scarica Internet Explorer 8 per MSN http://www.microsoft.com/italy/windows/internet-explorer/msn.aspx |
From: Roman Y. <rom...@gm...> - 2009-11-29 19:18:24
|
On Fri, Nov 27, 2009 at 4:47 PM, Berserker <ber...@ho...> wrote: Sorry for late response, I was very busy for a few days. > I have read this link in the documentation: > http://language-binding.net/pyplusplus/documentation/functions/default_args.html#registration-order-problem > > I'd like to not switch to macros because of the three issues reported there. > Is it possible to "customize" the registration order of a class/type in > Py++? Yes. Take a look on pyplusplus/creators_factory/sort_algorithms.py You can write the following code: import pyplusplus.creators_factory.sort_algorithm as sort_algs sort_algs.sort_classes = << your function >> Also the code sits in the "implementation directory", it belongs to "public interface" and some day I will move it there. > I'm thinking to something like a simple "int" property (default None) > that defines the registration order of the classes or a similar solution. It seems, that I am too tired and can't see how this will help you to solve the problem. If you are able to define the classes order, then I am sure we can improve "built-in" Py++ algorithm to handle with such situation. Where I am wrong? -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Berserker <ber...@ho...> - 2009-11-27 14:48:01
|
I have read this link in the documentation: http://language-binding.net/pyplusplus/documentation/functions/default_args.html#registration-order-problem I'd like to not switch to macros because of the three issues reported there. Is it possible to "customize" the registration order of a class/type in Py++? I'm thinking to something like a simple "int" property (default None) that defines the registration order of the classes or a similar solution. Bye _________________________________________________________________ Carica e scarica in un clic. Fino a 25 GB su SkyDrive http://www.windowslive.it/skyDrive.aspx |
From: Roman Y. <rom...@gm...> - 2009-11-20 19:26:13
|
2009/11/20 Roman Yakovenko <rom...@gm...>: > 2009/11/20 Michał Nowotka <mm...@gm...>: >>> If you can change code. >> I can't. > > :-( > >>> Let me know, if you need help with the second solution. >> Yes I need. > > What GCCXML version you are using? I just your example with the latest > gccxml version and it works just fine. ( On Ubuntu 9.10 ) > >> I just don't feel this solution. What value should I assign to ULONG_MAX? > > UINT_MAX :-) > >> Where actually should I redefine it and how (the compiler will yield >> at me because of redefinition)? > > http://language-binding.net/pygccxml/apidocs/parser.html > > mb = module_builder_t( gccxml_config=gccxml_configuration_t( .... ), ... ) > > gc = gccxml_configuration_t( define_symbols=["ULONG_MAX=432524"], ... ) > >> And this is just dirty hack - note that i use tester class from >> pyplusplus unittests. This first invokes gccxml and later gcc in order >> to expose some code to python. Both tools gccxml and gcc works on the >> same code and this is done automatically. Redefining some constant >> just for gccxml is problematic. > > It could be, I agree with you, but in the scenario you gave. I wanted to write "but NOT in the scenario you gave. " -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Roman Y. <rom...@gm...> - 2009-11-20 19:25:09
|
2009/11/20 Michał Nowotka <mm...@gm...>: >> If you can change code. > I can't. :-( >> Let me know, if you need help with the second solution. > Yes I need. What GCCXML version you are using? I just your example with the latest gccxml version and it works just fine. ( On Ubuntu 9.10 ) > I just don't feel this solution. What value should I assign to ULONG_MAX? UINT_MAX :-) > Where actually should I redefine it and how (the compiler will yield > at me because of redefinition)? http://language-binding.net/pygccxml/apidocs/parser.html mb = module_builder_t( gccxml_config=gccxml_configuration_t( .... ), ... ) gc = gccxml_configuration_t( define_symbols=["ULONG_MAX=432524"], ... ) > And this is just dirty hack - note that i use tester class from > pyplusplus unittests. This first invokes gccxml and later gcc in order > to expose some code to python. Both tools gccxml and gcc works on the > same code and this is done automatically. Redefining some constant > just for gccxml is problematic. It could be, I agree with you, but in the scenario you gave. GCCXML reports only declarations - it doesn't dump a C++ expression. So, it should be safe to "redefine" some pieces to cause it to compile the code. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Roman Y. <rom...@gm...> - 2009-11-19 06:34:34
|
2009/11/19 Michał Nowotka <mm...@gm...>: > Ok, test case is very simple... > > #include <climits> > > class test > { > public: > unsigned int b; > test() :b(ULONG_MAX){} > }; > > And thats all. I don't know whats special in climits and ULONG_MAX > constant but this causes an error. Hmm. It looks like a real bug. Take a look on the following table: http://www.ibm.com/developerworks/library/l-port64.html . If you can change code: you can move the code to cpp file and to use std::numeric_limits If you can't : a quick work around could be to redefine the ULONG_MAX value Let me know, if you need help with the second solution. P.S. The mail was sent to the mailing list too -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Roman Y. <rom...@gm...> - 2009-11-18 05:59:15
|
2009/11/18 Michał Nowotka <mm...@gm...>: > Hello > I have following problem: in my project I use pyplusplus and pygccxml. > I want my application to be standalone so pyplusplus_dev, pygccxml_bin > and gccxml_bin directories are embedded in my root directory (via > svn:externals). This project requires also boost (frozen 1.39 is > embedded too). When i launch my build script on 64 bit ubuntu 8.10 > with gcc 4.3 and python 2.5 I get following errors: > > gccxml_runtime_error_t: Error occured while running GCC-XML: In file > included from /home/mnowotka/Pulpit/fasthapl/impl/pyplusplus_dev/../boost/include/boost-1_39/boost/detail/lcast_precision.hpp:16 > (...) > /home/mnowotka/Pulpit/fasthapl/impl/pyplusplus_dev/../boost/include/boost-1_39/boost/integer_traits.hpp:155: > error: integer constant is too large for 'long' type > In file included from > /home/mnowotka/Pulpit/fasthapl/impl/pyplusplus_dev/../boost/include/boost-1_39/boost/lexical_cast.hpp:31, > (...) > /home/mnowotka/Pulpit/fasthapl/impl/pyplusplus_dev/../boost/include/boost-1_39/boost/detail/lcast_precision.hpp:85: > error: integer constant is too large for 'long' type > > > This is strange because on other computer (32 bits kubuntu 9.4 gcc4.3 > python 2.5) this just works fine. I thought binaries in gccxml_bin > should work on any linux just to try unit tests out of box (by the way > - not all unit test are passed). If I remember right, gccxml is based on GCC 4.2 compiler, so it is possible that such errors will happen. > Maybe I can just set some flags or > attach some config file to solve this problem? Can you help me? I could try: create small example that reproduce the problem and post it here. I will take a look on it. > My project can be found here: > svn checkout svn://koral.ise.pw.edu.pl/fasthapl (yes, it's quite large > because of third parties) > > to build it just run python build.py in impl directory. Unfortunately, I don't have enough resources to investigate the problem on your project. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Michał N. <mm...@gm...> - 2009-11-17 22:56:30
|
Hello I have following problem: in my project I use pyplusplus and pygccxml. I want my application to be standalone so pyplusplus_dev, pygccxml_bin and gccxml_bin directories are embedded in my root directory (via svn:externals). This project requires also boost (frozen 1.39 is embedded too). When i launch my build script on 64 bit ubuntu 8.10 with gcc 4.3 and python 2.5 I get following errors: gccxml_runtime_error_t: Error occured while running GCC-XML: In file included from /home/mnowotka/Pulpit/fasthapl/impl/pyplusplus_dev/../boost/include/boost-1_39/boost/detail/lcast_precision.hpp:16 (...) /home/mnowotka/Pulpit/fasthapl/impl/pyplusplus_dev/../boost/include/boost-1_39/boost/integer_traits.hpp:155: error: integer constant is too large for 'long' type In file included from /home/mnowotka/Pulpit/fasthapl/impl/pyplusplus_dev/../boost/include/boost-1_39/boost/lexical_cast.hpp:31, (...) /home/mnowotka/Pulpit/fasthapl/impl/pyplusplus_dev/../boost/include/boost-1_39/boost/detail/lcast_precision.hpp:85: error: integer constant is too large for 'long' type This is strange because on other computer (32 bits kubuntu 9.4 gcc4.3 python 2.5) this just works fine. I thought binaries in gccxml_bin should work on any linux just to try unit tests out of box (by the way - not all unit test are passed). Maybe I can just set some flags or attach some config file to solve this problem? Can you help me? My project can be found here: svn checkout svn://koral.ise.pw.edu.pl/fasthapl (yes, it's quite large because of third parties) to build it just run python build.py in impl directory. -- Regards Michał Nowotka |
From: Roman Y. <rom...@gm...> - 2009-11-17 19:41:40
|
On Tue, Nov 17, 2009 at 4:31 PM, Gustavo Carneiro <gjc...@gm...> wrote: > It looks like type_traits.impl_details.find_value_type is what I need. It > seems to work fine for my needs, i.e. template arguments are user classes. > > I am only concerned about two things: > > - I'm not too fond of using "implementation details" :-). I don't have tests for this functionality. I checked that it works for me ( extracting element, value types from sdt containers ). If you submit a test for it, I will be glad to make this functionality "public". > - The function is relatively slow (almost half a second each query, and I have a few dozen queries) :-( Unfortunately I don't have a use case, which could stress this function performance. Can you run the code under profile and send me the data? > But other than that, I guess my problem is solved. > > Thanks! :-) You are welcome. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Gustavo C. <gjc...@gm...> - 2009-11-17 14:31:51
|
2009/11/15 Roman Yakovenko <rom...@gm...> > On Sun, Nov 15, 2009 at 6:22 PM, Gustavo Carneiro <gjc...@gm...> > wrote: > > Hi, I have a problem here that I do not know where to begin to solve. I > use > > pygccxml.declarations.templates.split(), but it returns a list of > template > > parameters as strings, while I need to declarations of the classes listed > as > > template arguments (long story, but I really do). > > Been there, done it :-) > > > Is there a simple API in > > pygccxml that would allow me to go from a string like > > "ns3::dot11s::IeBeaconTimingUnit" to the actual declaration of the class? > > Or any other method rather than templates.split() that would give me the > > template args already as declarations? > > May be, lets see. > > In general I found 2 different ways to solve this problem. > > The first one is deterministic - if you have template instantiated > class in your hands and it has typedef for its template parameters, > then you can use this fact: > > template< class T> > struct Wrapper{ > typedef T value_type; > ... > }; > > pygccxml provides "internal_type_traits.get_by_name" method to get > reference to "type_t" > > The second way: start parsing and searching :-). > > I suggest you to take a look on container_traits.py module. It tries > to extract [value|element] type from std::[container]. It treats 2 use > cases: > * the input is class definition - so using typedef's defined in the > container class, it finds the actual template parameter type > * the input is class declaration ( in case in code was written forward > declaration ) - in this case the parsing of arguments is done and then > global namespace is searched. Take a look on > type_traits.impl_details.find_value_type method. > It looks like type_traits.impl_details.find_value_type is what I need. It seems to work fine for my needs, i.e. template arguments are user classes. I am only concerned about two things: - I'm not too fond of using "implementation details" - The function is relatively slow (almost half a second each query, and I have a few dozen queries) But other than that, I guess my problem is solved. Thanks! :-) > The second way works most of the time, when it doesn't you have few > choices: > * create dummy type (dummy_type_t), which will return parameter string > as-is. In some of my cases, I use meta-programming to select the > desired functionality > * raise an exception and ask user to specify the type explicitly - > good error message will solve you headache and simplify a few things > for the user :-) > > HTH > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > -- Gustavo J. A. M. Carneiro INESC Porto, Telecommunications and Multimedia Unit "The universe is always one step beyond logic." -- Frank Herbert |
From: Roman Y. <rom...@gm...> - 2009-11-15 19:15:29
|
On Sun, Nov 15, 2009 at 6:22 PM, Gustavo Carneiro <gjc...@gm...> wrote: > Hi, I have a problem here that I do not know where to begin to solve. I use > pygccxml.declarations.templates.split(), but it returns a list of template > parameters as strings, while I need to declarations of the classes listed as > template arguments (long story, but I really do). Been there, done it :-) > Is there a simple API in > pygccxml that would allow me to go from a string like > "ns3::dot11s::IeBeaconTimingUnit" to the actual declaration of the class? > Or any other method rather than templates.split() that would give me the > template args already as declarations? May be, lets see. In general I found 2 different ways to solve this problem. The first one is deterministic - if you have template instantiated class in your hands and it has typedef for its template parameters, then you can use this fact: template< class T> struct Wrapper{ typedef T value_type; ... }; pygccxml provides "internal_type_traits.get_by_name" method to get reference to "type_t" The second way: start parsing and searching :-). I suggest you to take a look on container_traits.py module. It tries to extract [value|element] type from std::[container]. It treats 2 use cases: * the input is class definition - so using typedef's defined in the container class, it finds the actual template parameter type * the input is class declaration ( in case in code was written forward declaration ) - in this case the parsing of arguments is done and then global namespace is searched. Take a look on type_traits.impl_details.find_value_type method. The second way works most of the time, when it doesn't you have few choices: * create dummy type (dummy_type_t), which will return parameter string as-is. In some of my cases, I use meta-programming to select the desired functionality * raise an exception and ask user to specify the type explicitly - good error message will solve you headache and simplify a few things for the user :-) HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Gustavo C. <gjc...@gm...> - 2009-11-15 16:22:37
|
Hi, I have a problem here that I do not know where to begin to solve. I use pygccxml.declarations.templates.split(), but it returns a list of template parameters as strings, while I need to declarations of the classes listed as template arguments (long story, but I really do). Is there a simple API in pygccxml that would allow me to go from a string like "ns3::dot11s::IeBeaconTimingUnit" to the actual declaration of the class? Or any other method rather than templates.split() that would give me the template args already as declarations? Thanks in advance. Regards, -- Gustavo J. A. M. Carneiro INESC Porto, Telecommunications and Multimedia Unit "The universe is always one step beyond logic." -- Frank Herbert |
From: Roman Y. <rom...@gm...> - 2009-11-02 21:51:24
|
On Mon, Nov 2, 2009 at 12:17 PM, Berserker <ber...@ho...> wrote: >> May be, may be not. I just checked-in a working example: >> http://pygccxml.svn.sourceforge.net/viewvc/pygccxml?view=rev&revision=1771 >> >> I also attached the generated code. It works for me :-). >> >> In order to be more productive, I suggest to send small, self >> contained and complete example, of what you are trying to do and >> can't. >> >> I will be glad to fix another bug in FT functionllity. > > I think that I found the problem: it simply doesn't works for protected > methods (statics and not statics). As I already mentioned in another post ( http://sourceforge.net/mailarchive/forum.php?forum_name=pygccxml-development&max_rows=25&style=nested&viewmonth=200908&viewday=11 ) - function transformation feature was implemented for public and free functions only. This is a huge amount of work to implement it for anything else. You can open a feature request, but I can't promise you that it will be implemented in a near feature ( hint: patches are welcome :-) ). -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Roman Y. <rom...@gm...> - 2009-10-28 20:41:16
|
On Wed, Oct 28, 2009 at 4:21 PM, Berserker <ber...@ho...> wrote: > In my previous message I forgot this question: is it possibile to "force" > the registration of shared_ptr in a class? I mean something like: > ::boost::python::register_ptr_to_python< boost::shared_ptr<::MyClass>>(); Basically, Py++ should find out by itself, that you use shared_ptr and generate the needed code. If it doesn't work for you, it could be nice, if you could submit the example. I will be glad to fix it. Meanwhile, I can propose you work around: http://language-binding.net/pyplusplus/documentation/inserting_code.html#insert-code-to-class Another thing, you can try to play with class_t.held_type. HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Roman Y. <rom...@gm...> - 2009-10-28 20:24:24
|
On Wed, Oct 28, 2009 at 12:18 PM, Berserker <ber...@ho...> wrote: > Hi, I'm continuing my "embedding experience" with Python and Py++ > but I'm not able to add custom code in static member functions. > Actually I'm calling: > > mfuns = my_module.mem_funs() > mfuns.add_default_precall_code("// my code") > > (this works fine for all non static methods) > Any suggestion? Well, the required functionality is not implemented. The way to solve this problem is to create function transformation. > Another problem is that free_function_t doesn't > support add_default_precall_code. The reason is similar: static member functions and free functions doesn't need additional wrappers. I believe, the right way, to add such functionality is to create custom function transformation. It should not be too difficult. > I'd like to contribute in the documentation for embedding Python > with Py++ but I'm very busy in these days. Would be helpful if > I release all the sources of my Python plugin (with Py++ scripts)? > They will not compile "standalone" but I think it would be easy > to document the embedding issues with them. In my opinion - it could be useful. If you submit, will I have permissions to change the code, and break it to smaller, self contained parts? -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Berserker <ber...@ho...> - 2009-10-28 14:21:22
|
In my previous message I forgot this question: is it possibile to "force" the registration of shared_ptr in a class? I mean something like: ::boost::python::register_ptr_to_python< boost::shared_ptr<::MyClass>>(); _________________________________________________________________ Nuovo Windows 7: trova il PC più adatto alle tue esigenze. Scopri di più. http://windows.microsoft.com/shop |
From: Berserker <ber...@ho...> - 2009-10-28 10:19:10
|
Hi, I'm continuing my "embedding experience" with Python and Py++ but I'm not able to add custom code in static member functions. Actually I'm calling: mfuns = my_module.mem_funs() mfuns.add_default_precall_code("// my code") (this works fine for all non static methods) Any suggestion? Another problem is that free_function_t doesn't support add_default_precall_code. I'd like to contribute in the documentation for embedding Python with Py++ but I'm very busy in these days. Would be helpful if I release all the sources of my Python plugin (with Py++ scripts)? They will not compile "standalone" but I think it would be easy to document the embedding issues with them. _________________________________________________________________ Nuovo Windows 7: trova il PC più adatto alle tue esigenze. Scopri di più. http://windows.microsoft.com/shop |
From: Benoît L. <ben...@gm...> - 2009-10-27 23:13:13
|
>> First, thanks for the great py++/pygccxml packages. I'm pretty new to >> it, so please forgive my newbieness... >> >> I'll soon be using Py++ for the binding of a large c++ library, and >> I'm trying to detect and automatize as much as possible the binding. >> >> One thing I could not figure out is a way to detect that a function >> has an array passed as one of its arguments. The type of the argument >> is a pointer to some type, but there's no mention to the fact that >> it's an array, or to the size of this array. >> I did some tests with pygccxml and got the same result: only the fact >> that the argument is a pointer can be extracted. >> >> So it's up to the user to manually add the input_static_array >> transformation with the correct size, which I'd like to avoid. >> Is there a simple way to do this? > > Yes and no. Obviously you can't extract this information from function > definition, but may be you can use the following information: > * coding convention > * documentation/comments > * naming convention Mmm ok this is what I thought. Not easy though to use coding/naming conventions to suggest an array type and the size. Of course documentation/comments can help, as long as they are followed by other developers and maintained... > > You can "re-parse" the source code and extract it. Not easy to do by hand. It would mean re-implement parts of gccxml... getting the source file and line number from gccxml would help for sure, instead of re-parsing the entire source tree... Anyway, if I really need this problem addressed I'll try to figure out the best solution. As I said, I'm currently trying to get an overview of the package, so..wait and see... Thanks for the quick answer! I'm going back to my learning of the package... Ben |
From: Roman Y. <rom...@gm...> - 2009-10-26 06:59:42
|
2009/10/26 Benoît Leveau <ben...@gm...>: > Hello, Good morning > First, thanks for the great py++/pygccxml packages. I'm pretty new to > it, so please forgive my newbieness... > > I'll soon be using Py++ for the binding of a large c++ library, and > I'm trying to detect and automatize as much as possible the binding. > > One thing I could not figure out is a way to detect that a function > has an array passed as one of its arguments. The type of the argument > is a pointer to some type, but there's no mention to the fact that > it's an array, or to the size of this array. > I did some tests with pygccxml and got the same result: only the fact > that the argument is a pointer can be extracted. > > So it's up to the user to manually add the input_static_array > transformation with the correct size, which I'd like to avoid. > Is there a simple way to do this? Yes and no. Obviously you can't extract this information from function definition, but may be you can use the following information: * coding convention * documentation/comments * naming convention You can "re-parse" the source code and extract it. > > P.S. If this is not the correct place to ask such questions, let me know. This is the place :-) -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Benoît L. <ben...@gm...> - 2009-10-26 00:23:32
|
Hello, First, thanks for the great py++/pygccxml packages. I'm pretty new to it, so please forgive my newbieness... I'll soon be using Py++ for the binding of a large c++ library, and I'm trying to detect and automatize as much as possible the binding. One thing I could not figure out is a way to detect that a function has an array passed as one of its arguments. The type of the argument is a pointer to some type, but there's no mention to the fact that it's an array, or to the size of this array. I did some tests with pygccxml and got the same result: only the fact that the argument is a pointer can be extracted. So it's up to the user to manually add the input_static_array transformation with the correct size, which I'd like to avoid. Is there a simple way to do this? Thanks! Benoit P.S. If this is not the correct place to ask such questions, let me know. |
From: Roman Y. <rom...@gm...> - 2009-09-22 18:47:21
|
2009/9/22 Roman Yakovenko <rom...@gm...>: > 2009/9/22 Pertti Kellomäki <per...@tu...>: >> Sorry to bother you again Roman, > > Don't worry > >> but here is another case where compilation of bindings fails when FT is used. > > I will try to fix it this evening. http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1760&view=rev The bug should be fixed. If you have more cases that doesn't behave as expected, please report them - I will try to fix as much as possible. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Roman Y. <rom...@gm...> - 2009-09-22 11:14:42
|
2009/9/22 Pertti Kellomäki <per...@tu...>: > Sorry to bother you again Roman, Don't worry > but here is another case where compilation of bindings fails when FT is used. I will try to fix it this evening. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Pertti K. <per...@tu...> - 2009-09-22 11:11:28
|
Sorry to bother you again Roman, but here is another case where compilation of bindings fails when FT is used. -- Pertti |