[pygccxml-commit] SF.net SVN: pygccxml: [169] pygccxml_dev/docs
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-05-28 07:08:28
|
Revision: 169 Author: roman_yakovenko Date: 2006-05-28 00:08:12 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=169&view=rev Log Message: ----------- updating documentation Modified Paths: -------------- pygccxml_dev/docs/download.rest pygccxml_dev/docs/query_interface.rest pyplusplus_dev/docs/comparisons/pyste.rest pyplusplus_dev/docs/download.rest pyplusplus_dev/docs/quotes.rest Modified: pygccxml_dev/docs/download.rest =================================================================== --- pygccxml_dev/docs/download.rest 2006-05-27 20:18:49 UTC (rev 168) +++ pygccxml_dev/docs/download.rest 2006-05-28 07:08:12 UTC (rev 169) @@ -13,6 +13,13 @@ 1) get access to source code 2) get access to latest release version of pyplusplus + + +----------------- +Subversion access +----------------- + +http://sourceforge.net/svn/?group_id=118209 -------- Download @@ -20,12 +27,6 @@ https://sourceforge.net/project/showfiles.php?group_id=118209 ----------- -SVN access ----------- - -http://sourceforge.net/svn/?group_id=118209 - ------------ Installation ------------ Modified: pygccxml_dev/docs/query_interface.rest =================================================================== --- pygccxml_dev/docs/query_interface.rest 2006-05-27 20:18:49 UTC (rev 168) +++ pygccxml_dev/docs/query_interface.rest 2006-05-28 07:08:12 UTC (rev 169) @@ -75,7 +75,7 @@ recursive=None, allow_empty=None ) -As you can see, from the methods arguments you can search for member function +As you can see, from the method arguments you can search for member function by: * ``name`` @@ -105,7 +105,7 @@ mem_funcs = my_class.member_functions( return_type='int' ) - i = declarations.int_t()`` + i = declarations.int_t() ref_i = declarations.reference_t( i ) const_ref_i = declarations.const_t( ref_i ) mem_funcs = my_class.member_functions( return_type=const_ref_int ) Modified: pyplusplus_dev/docs/comparisons/pyste.rest =================================================================== --- pyplusplus_dev/docs/comparisons/pyste.rest 2006-05-27 20:18:49 UTC (rev 168) +++ pyplusplus_dev/docs/comparisons/pyste.rest 2006-05-28 07:08:12 UTC (rev 169) @@ -69,12 +69,11 @@ Carefully read `Pyste`_ definition - -"... The user specifies the classes and functions to be exported using a simple -interface file, which following the `boost.python`_'s philosophy, is simple -`Python`_ code. ..." + "... The user specifies the classes and functions to be exported using a simple + interface file, which following the `boost.python`_'s philosophy, is simple + `Python`_ code. ..." + --- Definition of `Pyste`_. - Simple interface file is an advantage and a disadvantage at the same time. The advantage is obvious: it is easy to start to use. The disadvantage is less obvious - you can not work on whole exported library at once. @@ -92,10 +91,10 @@ You should understand `Pyste`_ implementation details. Third example is solvable if you are lucky and ready to write few `Python`_\\shell scripts. -"... AllFromHeader is broken in some cases. Until it is fixed, use at you own -risk. ..." + "... AllFromHeader is broken in some cases. Until it is fixed, use at you own + risk. ..." --- `Pyste`_ documentation. + ---`Pyste`_ documentation. I have more examples, but I think you've got the idea. @@ -157,8 +156,8 @@ ---------- One of the biggest weaknesses of `Pyste`_ is a lack of good `GCC-XML`_ front-end -and this fact cause `Pyste`_ to generate wrong or not optimal code. I will prove -this later. In order to avoid such weakness, before I have created `pyplusplus`_, +and this fact cause `Pyste`_ to generate not optimal code. I will prove this +later. In order to avoid such weakness, before I have created `pyplusplus`_, I created `pygccxml`_. `pygccxml`_ is a stand alone project, that provides few things: @@ -183,23 +182,26 @@ `boost.type_traits`_ library has been implemented. `pyplusplus`_ makes an extensive use of them: - * find out call policies algorithm + * identify "call policies" algorithm * code creator that generates body of "overridden" virtual functions: - - | *struct expensive_to_copy{...};* - | *...* - | *virtual void* - | *do_smth(expensive_to_copy\* x, const expensive_to_copy& y){* - | *//Pyste generates next code* - | *//call_method< void >(self, "do_smth", x, y);* - | *//pyplusplus generates better code* - | *this->get_override("do_smth")( boost::python::ptr(x), boost::ref(y) );* - | *}* + :: + + struct expensive_to_copy{...}; + + void do_smth( expensive_to_copy* x, const expensive_to_copy& y ){...} + + void + do_smth(expensive_to_copy* x, const expensive_to_copy& y){ + //Pyste generates next code + //call_method< void >(self, "do_smth", x, y); + //pyplusplus generates next code + *this->get_override("do_smth")( boost::python::ptr(x), boost::ref(y) ); + //------------------------------^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^ + } - Do you see the difference? I think that this code is better and correct. - This is a prove to the point I made earlier: `Pyste`_ generates wrong - or not optimal code. + Do you see the difference? This is a prove to the point I made earlier: + `Pyste`_ generates not optimal code. + Do you remember first 3 problems, I talked about? @@ -210,9 +212,11 @@ 3. Maintenance. Every time you add new file\\class to your project you should modify\\create `Pyste`_ interface files. - They are solved by `pygccxml`_ package. + They are solved by `pygccxml`_ package. Please take a look on `pygccxml`_ + `query intrface`__ documentation. + +.. __ : ./../../pygccxml/query_interface.html - Now about mistakes. There is a gold rule: one class, one responsibility. `Pyste`_ breaks this rule. One more time *Exporter* class responsibilities: @@ -281,12 +285,10 @@ Features list ------------- `pyplusplus`_ supports almost all features `Pyste`_ implements. `pyplusplus`_, -version 0.5.1, does not implements next functionality, implemented by `Pyste`_: +version 0.8.0, does not implements next functionality, implemented by `Pyste`_: * *pow* operator - - * templates - + * good documentation Here you can find the complete features list of `pyplusplus`_. @@ -324,37 +326,42 @@ those directories into account. * To define namespace alias. + :: - | *namespace dt = boost::date_time;* + namespace dt = boost::date_time; - All code, that is generated after this statement, will use *dt* instead of - *boost::date_time*. This allows `pyplusplus`_ to create user friendly code. + All code, that is generated after this statement, will use ``dt`` instead of + ``boost::date_time``. This allows `pyplusplus`_ to create user friendly code. * Classes and functions support 2 modes of code generation. Example: + :: + + struct world{ + void set(std::string msg) { this->msg = msg; } + std::string greet() { return msg; } + std::string msg; + }; - | *struct world{* - | *void set(std::string msg) { this->msg = msg; }* - | *std::string greet() { return msg; }* - | *std::string msg;* - | *};* - First mode: - - | *class_<world>("world")* - | *.def("greet", &world::greet)* - | *.def("set", &world::set)* - | *;* + :: + class_<world>("world") + .def("greet", &world::greet) + .def("set", &world::set) + ; + + Second mode: + :: + + if( true ){ + typedef class_<world> world_exposer_t; + world_exposer_t world_exposer; + boost::python::scope world_scope( exposer ); + world_exposer.def( "greet", ( std::string ( world::* )() )( &world::greet ) ); + world_exposer.def( "set", ( void ( world::* )(std::string) )( &world::set ) ); + } - | *if( true ){* - | *typedef class_<world> world_exposer_t;* - | *world_exposer_t world_exposer;* - | *boost::python::scope world_scope( exposer );* - | *world_exposer.def( "greet", ( std::string ( world::\* )() )( &world::greet ) );* - | *world_exposer.def( "set", ( void ( world::\* )(std::string) )( &world::set ) );* - | *}* - Second mode is better then first, because: 1. It is easier to understand compilation error. @@ -410,7 +417,7 @@ .. _`screenshot` : ./../pyplusplus_demo.png .. _`pyplusplus` : ./../pyplusplus.html -.. _`pygccxml` : http://pygccxml.sourceforge.net +.. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Pyste`: http://www.boost.org/libs/python/doc/index.html .. _`boost.python`: http://www.boost.org/libs/python/doc/index.html .. _`SourceForge`: http://sourceforge.net/index.php Modified: pyplusplus_dev/docs/download.rest =================================================================== --- pyplusplus_dev/docs/download.rest 2006-05-27 20:18:49 UTC (rev 168) +++ pyplusplus_dev/docs/download.rest 2006-05-28 07:08:12 UTC (rev 169) @@ -13,6 +13,13 @@ 1) get access to source code 2) get access to latest release version of pyplusplus + + +----------------- +Subversion access +----------------- + +http://sourceforge.net/svn/?group_id=118209 -------- Download @@ -20,12 +27,6 @@ https://sourceforge.net/project/showfiles.php?group_id=118209 ----------- -SVN access ----------- - -http://sourceforge.net/svn/?group_id=118209 - ------------ Installation ------------ Modified: pyplusplus_dev/docs/quotes.rest =================================================================== --- pyplusplus_dev/docs/quotes.rest 2006-05-27 20:18:49 UTC (rev 168) +++ pyplusplus_dev/docs/quotes.rest 2006-05-28 07:08:12 UTC (rev 169) @@ -1,6 +1,12 @@ =============================== What they say about pyplusplus? =============================== + +.. contents:: Table of contents + +----------------- +What do they say? +----------------- "... If you can, use pyplusplus over pyste. I say that for ALL users of pyste, pyplusplus is now mature enough to be useful as well as being @@ -8,7 +14,7 @@ Niall Douglas, the author of `TnFOX`_ library - + "... On a related note, I highly suggest that any users out there that have tried/used Pyste but have found it to be too lacking in power should really give pyplusplus a try. It has allowed me to do everything I @@ -18,8 +24,32 @@ Allen Bierbaum, the author of `PyOpenSG`_ library - - +------------------------ +Who is using pyplusplus? +------------------------ + +* Matthias Baas, the author of `Python Computer Graphics Kit`_ project, is using + `pyplusplus`_ to create Python bindings for `Maya C++ SDK`__. + + + .. __ : http://www.highend3d.com/maya + +* I am :-). I created Python bindings for next libraries: + + * `boost.date_time`_ + * `boost.crc`_ + * `boost.rational`_ + * `boost.random`_ + +.. _`boost.date_time` : http://boost.org/doc/html/date_time.html +.. _`boost.crc` : http://boost.org/libs/crc/index.html +.. _`boost.rational` : http://boost.org/libs/rational/index.html +.. _`boost.random` : http://boost.org/libs/random/index.html + + You can download the bindings from https://sourceforge.net/project/showfiles.php?group_id=118209 . + +.. _`pyplusplus` : ./pyplusplus.html +.. _`Python Computer Graphics Kit` : http://cgkit.sourceforge.net/ .. _`TnFOX`: http://www.nedprod.com/TnFOX/ .. _`PyOpenSG`: https://realityforge.vrsource.org/view/PyOpenSG/WebHome This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |