[pygccxml-commit] SF.net SVN: pygccxml: [411] pyplusplus_dev/docs
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-08-16 08:44:39
|
Revision: 411 Author: roman_yakovenko Date: 2006-08-16 01:44:16 -0700 (Wed, 16 Aug 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=411&view=rev Log Message: ----------- updating docs - removing white spaces, inserted by MS Word Modified Paths: -------------- pyplusplus_dev/docs/documentation/how_to.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest pyplusplus_dev/docs/documentation/tutorials/tutorials.rest pyplusplus_dev/docs/examples/examples.rest pyplusplus_dev/docs/history/history.rest pyplusplus_dev/docs/peps/peps_index.rest pyplusplus_dev/docs/pyplusplus.rest pyplusplus_dev/docs/quotes.rest Removed Paths: ------------- pyplusplus_dev/docs/peps/indexing_suite.rest Modified: pyplusplus_dev/docs/documentation/how_to.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/documentation/how_to.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -110,9 +110,9 @@ That's all. ------------------------------------------------------------- +------------------------------------------------------------- Fatal error C1204:Compiler limit: internal structure overflow ------------------------------------------------------------- +------------------------------------------------------------- If you get this error, that the generated file is too big. You will have to split it to few files. Well, not you but `Py++`_ you will only have to tell that Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -8,18 +8,20 @@ What is Py++? ------------- -.. include:: ./../../../definition.rest +.. include:: ./../../../definition.rest -------- Preamble -------- I guess you decided to try `Py++`_ API. Good! Lets start. First of all, -please take a look on two files: +please take a look on two files: + * `hello_world.hpp`_ - C++ source code, that we want to export to Python - -* `generate_code.py`_ - Python code, that uses `Py++`_ to export + + +* `generate_code.py`_ - Python code, that uses `Py++`_ to export declarations from the source file .. _`hello_world.hpp` : ./hello_world.html @@ -30,10 +32,10 @@ ---------------- `Py++`_ is built from a few packages, but there is only one package, you -should really to be familiar with - ``module_builder``. This package is some kind -of facade to low level API. It provides simple and intuitive API. The main -class within this package is ``module_builder_t``. The instance of this class will -guide you through the whole process. Next few paragraphs will tell you more about +should really to be familiar with - ``module_builder``. This package is some kind +of facade to low level API. It provides simple and intuitive API. The main +class within this package is ``module_builder_t``. The instance of this class will +guide you through the whole process. Next few paragraphs will tell you more about this class. ------------------------- @@ -46,18 +48,18 @@ 1. ``files`` - list of all C++ source files, that declarations from them, you want to expose. This is the only required parameter. - + 2. ``gccxml_path`` - path to `GCC-XML`_ binary. If you don't supply this argument `pygccxml`_ will look for it using your environment variable ``PATH``. - -There are some other arguments: +There are some other arguments: + * additional include directories * [un]defined symbols ( macros ) * declarations cache * ... -Parsing of source files is done within this method. Post condition of this +Parsing of source files is done within this method. Post condition of this method is - all declarations has been successfully extracted from the sources files. @@ -67,7 +69,7 @@ Not all declarations should be exported! Not every declaration could be exported without human invocation! As you already saw from example, `Py++`_ provides simple and powerful declarations query interface. By default, only declarations -that belongs to files, you have asked to parse, and to files, that lies in the same +that belongs to files, you have asked to parse, and to files, that lies in the same directories as parsed files, will be exported: :: @@ -76,11 +78,11 @@ impl_a.h impl_b.h include/ - a.h //includes impl_a.h + a.h //includes impl_a.h b.h //includes impl_b.h all.h //includes a.h and b.h mb = module_builder( [ 'all.h' ] ) - + All declarations that belongs to ``include`` directory will be signed as included to exporting. All other declarations will be ignored. @@ -94,63 +96,65 @@ * to include/exclude declarations * to set call policies * ... - -I think it is critical for beginners to see what is going on, right? -``module_builder_t`` class has ``print_declarations`` method. You can print whole -declarations tree or some specific declaration. Very convenient, very useful. - + + +I think it is critical for beginners to see what is going on, right? +``module_builder_t`` class has ``print_declarations`` method. You can print whole +declarations tree or some specific declaration. Very convenient, very useful. + ----------------------------------- module_builder_t.build_code_creator ----------------------------------- -Now it is a time to create module code creator. Do you remember, in introduction -to `Py++`_, I told you that before writing code to disc, `Py++`_ will -create some kind of `AST`_. Well this is done by calling -``module_builder_t.build_code_creator`` function. Right now, the only important -argument to the function is ``module_name``. Self explained, is it? - -What is the main value of code creators? Code creators allow you to modify -code before it has been written to disk. For example one common requirement for -open source projects it to have license text within every source file. You can -do it with one line of code only: -:: - - mb.code_creator.license = your license text - -After you call this function, I recommend you not to change declarations -configuration. In most cases the change will take effect, in some cases it will -not! - -This tutorial is not cover code creators and how you should work with them. -I will write another tutorial. - -.. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree - ------------------------------ -module_builder_t.write_module ------------------------------ -You have almost created your module. The last things left is to write module -code to file(s). You can do it with - -* ``module_builder_t.write_module`` - you should provide file name, the code - will be written in. - -* ``module_builder_t.split_module`` - you should provide directory name. - For big projects it is a must to minimize compilation time. So `Py++`_ - splits your module source code to different files within the directory. - - ------- -Result ------- - -`View generated file`_ - -.. _`View generated file` : ./result.html - - -That's all. I hope you enjoyed. +Now it is a time to create module code creator. Do you remember, in introduction +to `Py++`_, I told you that before writing code to disc, `Py++`_ will create some +kind of `AST`_. Well this is done by calling ``module_builder_t.build_code_creator`` +function. Right now, the only important argument to the function is ``module_name``. +Self explained, is it? + +What is the main value of code creators? Code creators allow you to modify +code before it has been written to disk. For example one common requirement for +open source projects it to have license text within every source file. You can +do it with one line of code only: + +:: + + mb.code_creator.license = your license text + +After you call this function, I recommend you not to change declarations +configuration. In most cases the change will take effect, in some cases it will +not! + +This tutorial is not cover code creators and how you should work with them. +I will write another tutorial. + +.. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree + +----------------------------- +module_builder_t.write_module +----------------------------- + +You have almost created your module. The last things left is to write module +code to file(s). You can do it with + +* ``module_builder_t.write_module`` - you should provide file name, the code + will be written in. + +* ``module_builder_t.split_module`` - you should provide directory name. + For big projects it is a must to minimize compilation time. So `Py++`_ + splits your module source code to different files within the directory. + +------ +Result +------ + +`View generated file`_ + +.. _`View generated file` : ./result.html + +That's all. I hope you enjoyed. + .. _`Py++` : ./../../../pyplusplus.html .. _`pygccxml` : ./../../../../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/documentation/tutorials/tutorials.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -3,51 +3,57 @@ ========= .. contents:: Table of contents - + ------------- What is Py++? ------------- -.. include:: ./../../definition.rest - -------------------- -Graphical interface -------------------- - -`Py++`_ includes a `graphical interface`_. `Graphical interface`_ -is invoked with the ``pyplusplus_gui`` command, or with ``pyplusplus_gui.pyw`` -from the ``scripts`` subdirectory, of the `Python`_ installation directory. - -My advise to you - start with `graphical interface`_, because: - * you don't have to learn new API - * few clicks with mouse and you have `Boost.Python`_ code for your file(s) - * it is very easy to evaluate `Py++`_ using it - * you can check whether `GCC-XML`_ is able to compile your code or not - * you can use it as a guide to `Boost.Python`_ library - * it is able to generate `Py++`_ code for you - -.. _`graphical interface` : ./pyplusplus_demo.png -.. _`Graphical interface` : ./pyplusplus_demo.png - ---------------- -Getting started ---------------- - -I suppose you decided to do some coding with `Py++`_. `Module builder`_ -tutorials will help you. - -.. _`Module builder` : ./module_builder/module_builder.html - --------- -Advanced --------- - -To be written. I think I should cover here the usage of code creators and code -creators tree. Meanwhile you can take a look on the content of -``examples/custom_code_creator`` directory. It contains example, which shows how -to create your own code creator. To be more specific, it exposes ``get*`` and -``set*`` methods as a single property. +.. include:: ./../../definition.rest +------------------- +Graphical interface +------------------- +`Py++`_ includes a `graphical interface`_. `Graphical interface`_ is invoked +with the ``pyplusplus_gui`` command, or with ``pyplusplus_gui.pyw`` from the +``scripts`` subdirectory, of the `Python`_ installation directory. + +My advise to you - start with `graphical interface`_, because: + + * you don't have to learn new API + + * few clicks with mouse and you have `Boost.Python`_ code for your file(s) + + * it is very easy to evaluate `Py++`_ using it + + * you can check whether `GCC-XML`_ is able to compile your code or not + + * you can use it as a guide to `Boost.Python`_ library + + * it is able to generate `Py++`_ code for you + +.. _`graphical interface` : ./pyplusplus_demo.png +.. _`Graphical interface` : ./pyplusplus_demo.png + +--------------- +Getting started +--------------- + +I suppose you decided to do some coding with `Py++`_. `Module builder`_ +tutorials will help you. + +.. _`Module builder` : ./module_builder/module_builder.html + +-------- +Advanced +-------- + +To be written. I think I should cover here the usage of code creators and code +creators tree. Meanwhile you can take a look on the content of +``examples/custom_code_creator`` directory. It contains example, which shows how +to create your own code creator. To be more specific, it exposes ``get*`` and +``set*`` methods as a single property. + + .. _`Py++` : ./../../pyplusplus.html .. _`pygccxml` : ./../....//pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/examples/examples.rest =================================================================== --- pyplusplus_dev/docs/examples/examples.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/examples/examples.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -7,8 +7,9 @@ ------------------- Graphical interface ------------------- - -`Py++`_ has nice, small and simple `graphical interface`_. Please, read + + +`Py++`_ has nice, small and simple `graphical interface`_. Please, read `tutorials`_ for more information. .. _`graphical interface` : ./../tutorials/pyplusplus_demo.png @@ -16,34 +17,33 @@ --------- pyeasybmp ---------- - -`EasyBMP`_ is a small cross-platform library that provide you functionality -needed to work with Windows bitmap (BMP) image files. I took me only few minutes -to create Python bindings for the library. Read more `here`__. - -.. __ : ./easybmp/easybmp.html - ---------------- -boost libraries ---------------- - -Boost provides free peer-reviewed portable C++ source libraries. +--------- -Using `Py++`_ I created Python bindings for few libraries: +`EasyBMP`_ is a small cross-platform library that provide you functionality +needed to work with Windows bitmap (BMP) image files. I took me only few minutes +to create Python bindings for the library. Read more `here`__. +.. __ : ./easybmp/easybmp.html + +--------------- +boost libraries +--------------- + +Boost provides free peer-reviewed portable C++ source libraries. Using `Py++`_ I +created Python bindings for few libraries: + * `Boost.Date_Time`_ * `Boost.CRC`_ * `Boost.Rational`_ * `Boost.Random`_ -This is not "just another example". I went father and created new package: +This is not "just another example". I went father and created new package: `pyboost`_. This is fully working Python package, with almost all unit test from -the libraries ported to Python. For more information please read `pyboost`_ +the libraries ported to Python. For more information please read `pyboost`_ package documentation. .. _`pyboost` : ./boost/boost.html - + .. _`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 Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/history/history.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -4,7 +4,6 @@ .. contents:: Table of contents - ------------ Contributors ------------ @@ -15,48 +14,61 @@ * John Pallister * Matthias Baas * Allen Bierbaum - * Lakin Wecker + * Lakin Wecker + * Georgiy Dernovoy - ------ -0.8.1 ------ - -1. Georgiy Dernovoy contributed a patch, which allows `Py++`_ GUI to - save\\load last used header file. - -2. `Py++`_ improved a lot functionality related to providing feedback to user: - - * every package has its own logger - - * only important user messages are written to ``stdout`` - - * user messages are clear - -3. Support for Boost.Python indexing suite version 2 was implemented. - -4. Every code creator class took ``parent`` argument in ``__init__`` method. - This argument was removed. ``adopt_creator`` and ``remove_creator`` will - set\unset reference to parent. - -5. Generated code for member and free functions was changed. This changed was - introduced to fix compilation errors on msvc 7.1 compiler. - -6. `Py++`_ generates "stable" code. If header files were not changed, - `Py++`_ will not change any file. - -7. Support for huge classes was added. `Py++`_ is able to split registration - code for the class to multiple cpp files. - -8. User code could be added almost anywhere, without use of low level API. - -9. Generated source files include only header files you passes as an argument - to module builder. - -10. Bug fixes. - -11. Documentation was improved.. - + +------------ +Project name +------------ + +In version 0.8.1 project has been renamed from "pyplusplus" to "Py++". +There were few reasons to this: + +1. I like "Py++" more then "pyplusplus". + +2. "Py++" was the original name of the project: http://mail.python.org/pipermail/c++-sig/2005-July/009280.html + +3. Users always changed the name of the projects. I saw at least 6 different names. + + +----- +0.8.1 +----- + +1. Georgiy Dernovoy contributed a patch, which allows `Py++`_ GUI to + save\\load last used header file. + +2. `Py++`_ improved a lot functionality related to providing feedback to user: + + * every package has its own logger + * only important user messages are written to ``stdout`` + * user messages are clear + +3. Support for Boost.Python indexing suite version 2 was implemented. + +4. Every code creator class took ``parent`` argument in ``__init__`` method. + This argument was removed. ``adopt_creator`` and ``remove_creator`` will + set\unset reference to parent. + +5. Generated code for member and free functions was changed. This changed was + introduced to fix compilation errors on msvc 7.1 compiler. + +6. `Py++`_ generates "stable" code. If header files were not changed, + `Py++`_ will not change any file. + +7. Support for huge classes was added. `Py++`_ is able to split registration + code for the class to multiple cpp files. + +8. User code could be added almost anywhere, without use of low level API. + +9. Generated source files include only header files you passes as an argument + to module builder. + +10. Bug fixes. + +11. Documentation was improved.. + ------------- Version 0.8.0 ------------- Deleted: pyplusplus_dev/docs/peps/indexing_suite.rest =================================================================== --- pyplusplus_dev/docs/peps/indexing_suite.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/peps/indexing_suite.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -1,99 +0,0 @@ -====================== -Indexing suite support -====================== - -.. contents:: Table of contents - -------------------- -What is useful for? -------------------- - -http://boost.org/libs/python/doc/v2/indexing.html - -------------- -The way to go -------------- -The generated code should work, even if it contains usage of STD containers -classes. There are few ways to implement indexing suite support within `Py++`_. -I will describe, how I think it should be implemented and used by user. - -Generated code --------------- -All generated code will have next form: -:: - - class_< container, other class parameters >(name) - .def( concrete indexing suite class< container, proxy, derived policies >() ) - ; - -Usage example -------------- -C++ code: -:: - - #include <map> - #include <vector> - -:: - - std::vector<string> get_options(){...} - -:: - - struct my_data{...}; - std::map< int, my_data > get_data(); - -Assumption: user wants to use ``get_options`` and ``get_data`` functions. Next -steps will describe what `Py++`_ will do in this case: - -1. `Py++`_ will analyze functions return type and arguments. - -2. It will understand that ``std::vector< std::string >`` and ``std::map< int, my_data >`` - classes should be exported too. - -3. It will understand that those classes should be exported using indexing suite - functionality provided by `Boost.Python`_ library or `Py++`_ - ``code repository``. - -4. It will generate the code, which will use that functionality. - -So far, so good. Sometimes, there are use cases, when user has to change default -values, for example ``NoProxy`` or ``DerivedPolicies``. What interface `Py++`_ -will provide in order to change the defaults? Well, ``std::vector< std::string >`` -is the class that could be found in declarations tree, right? User can find the -class and change the defaults: -:: - - mb = module_builder_t( ... ) - #the next line will not work, because the real name of std::vector< std::string > - #is platform dependent and much longer. It is there for simplicity. - vector_of_strings = mb.class_( "std::vector< std::string >" ) - vector_of_strings.alias = "StringVector" - vector_of_strings.held_type = ... - vector_of_strings.indexing_suite.no_proxy = False - - -Please, pay attention to the next line: -:: - - vector_of_strings.indexing_suite.no_proxy = False - -Every class, which represents instantiation of some STD container will have -class variable ``indexing_suite``, that will be initialized with relevant -indexing suite class. - - - -.. _`Py++` : ./../pyplusplus.html -.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html -.. _`Python`: http://www.python.org -.. _`GCC-XML`: http://www.gccxml.org - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: - Modified: pyplusplus_dev/docs/peps/peps_index.rest =================================================================== --- pyplusplus_dev/docs/peps/peps_index.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/peps/peps_index.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -6,55 +6,52 @@ ----------- Description ------------ - -This page is an official `Py++`_ "TODO" page. - -For small features, the description of the feature and it's implementation will -be written here. Big features will get their own page. - ---------------- -Unnamed classes ---------------- -There is no technical reason why unnamed classes/structs/unions are not exported -by `Py++`_: -:: - - class Foo{ - union { - struct { - float r,g,b,a; - }; - float val[4]; - }; - }; - -Implementation details ----------------------- -As it seems to me, the only code that should be changed is -"pyplusplus/module_creator/creator.py" file. To be more specific: all code creators, -for declarations in unnamed classes, should be created under named class. - -The coding itself should take something like 4 - 5 hours, including unit test. - ---------------------- -Call wrapper policies ---------------------- - -Not all functions could be exposed to Python as is. This `document`__ will -explain how `Py++`_ will help users to create wrappers around those functions. - -.. __ : ./call_wrapper_policies.html - --------------- -Indexing suite --------------- - -`Py++`_ will expose C++ STD containers. This `document`__ will describe -how it will work. +----------- -.. __ : ./indexing_suite.html +This page is an official `Py++`_ "TODO" page. +For small features, the description of the feature and it's implementation will +be written here. Big features will get their own page. + +--------------- +Unnamed classes +--------------- + +There is no technical reason why unnamed classes/structs/unions are not exported + +by `Py++`_: + +:: + + class Foo{ + union { + struct { + float r,g,b,a; + }; + float val[4]; + }; + }; + + +Implementation details +---------------------- + +As it seems to me, the only code that should be changed is +"pyplusplus/module_creator/creator.py" file. To be more specific: all code creators, +for declarations in unnamed classes, should be created under named class. + +The coding itself should take something like 4 - 5 hours, including unit test. + +--------------------- +Call wrapper policies +--------------------- + +Not all functions could be exposed to Python as is. This `document`__ will +explain how `Py++`_ will help users to create wrappers around those functions. + +.. __ : ./call_wrapper_policies.html + + .. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/pyplusplus.rest =================================================================== --- pyplusplus_dev/docs/pyplusplus.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/pyplusplus.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -8,69 +8,72 @@ What is Py++? ------------- -.. include:: ./definition.rest +.. include:: ./definition.rest -------- Preamble -------- -This introduction will describe code generation process using Py++. +This introduction will describe code generation process using Py++. I hope, that after you finished to read it, you will understand how powerful -Py++ is. +Py++ is. ----------------------- Code generation process ----------------------- -`Boost.Python`_ library allows you to expose C++ code to `Python`_ in quick and -elegant way. Almost the whole process of exposing declarations can be automated -by use of Py++. Code generation process, using Py++ consists -from few steps. Next paragraphs will tell you more about every step. +`Boost.Python`_ library allows you to expose C++ code to `Python`_ in quick and +elegant way. Almost the whole process of exposing declarations can be automated +by use of Py++. Code generation process, using Py++ consists +from few steps. Next paragraphs will tell you more about every step. + *"read declarations"* ---------------------- +--------------------- -Py++ does not reinvent the wheel. It uses `GCC C++ compiler`_ to parse C++ -source files. To be more precise, the tool chain looks like this: - -1. source code is passed to `GCC-XML`_ -2. `GCC-XML`_ passes it to `GCC C++ compiler`_ -3. `GCC-XML`_ generates an XML description of a C++ program from GCC's internal - representation. -4. Py++ uses `pygccxml`_ package to read `GCC-XML`_ generated file. - -The bottom line - you can be sure, that all your declarations are read correctly. - -.. _`GCC C++ compiler` : http://www.gnu.org/software/gcc +Py++ does not reinvent the wheel. It uses `GCC C++ compiler`_ to parse C++ +source files. To be more precise, the tool chain looks like this: +1. source code is passed to `GCC-XML`_ + +2. `GCC-XML`_ passes it to `GCC C++ compiler`_ + +3. `GCC-XML`_ generates an XML description of a C++ program from GCC's internal + representation. + +4. Py++ uses `pygccxml`_ package to read `GCC-XML`_ generated file. + +The bottom line - you can be sure, that all your declarations are read correctly. + +.. _`GCC C++ compiler` : http://www.gnu.org/software/gcc + + *"build module"* ----------------- -Only very small and simple projects could be exported as is. Most of the projects -still require human invocation. Basically there are 2 questions that you should +Only very small and simple projects could be exported as is. Most of the projects +still require human invocation. Basically there are 2 questions that you should answer: - 1. which declarations should be exported - 2. how this specific declaration should be exported or, if I change a little - a question, what code should be written in order I get access from Python + 1. which declarations should be exported + 2. how this specific declaration should be exported or, if I change a little + a question, what code should be written in order I get access from Python to that functionality -Of course, Py++ cannot answer those question, but it provides maximum -help to implement an user requirements. - -How can Py++ help you with first question? Py++ provides very -powerful and simple query interface. +Of course, Py++ cannot answer those question, but it provides maximum help to +implement an user requirements. -For example in one line of code you can select all free functions that have -two arguments, where the first argument has type ``int &`` and the type of the -second argument is any: +How can Py++ help you with first question? Py++ provides very powerful and +simple query interface. For example in one line of code you can select all free +functions that have two arguments, where the first argument has type ``int &`` +and the type of the second argument is any: :: mb = module_builder_t( ... ) #module_builder_t is the main class that #will help you with code generation process mb.free_functions( arg_types=[ 'int &', None ] ) -An other example - the developer wants to exclude all protected functions from +An other example - the developer wants to exclude all protected functions from being exported: :: @@ -83,109 +86,110 @@ mb = module_builder_t( ... ) mb.decls( lambda decl: 'impl' in decl.name ).exclude() - -Please, note the way queries were built. You can think about those queries as -the rules, which will continue to work even after exported C++ code was changed. -It means that you don't have to change code generator source code every time. -So far, so good what about second question? Well, by default Py++ -generates a code that will satisfy almost all developers. Py++ relevant -classes could be configured in many ways to satisfy your needs. But sometimes -this is still not enough. There are use cases when you need full control over -generated code. One of the biggest problems, with code generators in general, is -modifying generated code and preserving changes. How many code generators did -you use or know, that allow you to put your code anywhere or to reorder generated -code as you wish? Py++ allows you to do that. -Py++ introduces new concept: code creator and code creators tree. You can think -about code creators tree as some kind of `AST`_. The only difference is that code -creators tree provides more specific functionality. For example ``include_t`` code -creator is responsible to create C++ ``include`` directive code. You have full -control over code creators tree, before it is written to disc. Here you +Please, note the way queries were built. You can think about those queries as +the rules, which will continue to work even after exported C++ code was changed. +It means that you don't have to change code generator source code every time. + +So far, so good what about second question? Well, by default Py++ generates a +code that will satisfy almost all developers. Py++ relevant classes could be +configured in many ways to satisfy your needs. But sometimes this is still not +enough. There are use cases when you need full control over generated code. One +of the biggest problems, with code generators in general, is modifying generated +code and preserving changes. How many code generators did you use or know, that +allow you to put your code anywhere or to reorder generated code as you wish? +Py++ allows you to do that. + +Py++ introduces new concept: code creator and code creators tree. You can think +about code creators tree as some kind of `AST`_. The only difference is that code +creators tree provides more specific functionality. For example ``include_t`` code +creator is responsible to create C++ ``include`` directive code. You have full +control over code creators tree, before it is written to disc. Here you can find UML diagram of almost all code creators: `class diagram`_. - + .. _`AST`: http://en.wikipedia.org/wiki/Abstract_syntax_tree .. _`class diagram`: ./code_creators_uml.png -At the end of this step you have code creators tree, which is ready to be written +At the end of this step you have code creators tree, which is ready to be written to disc. -*"write code to files"* +*"write code to files"* ----------------------- -During this step Py++ reads code creators tree and writes code to the -disc. The result of code generation process should not be different from the one, -that would be achieved by human. For small project writing all code into single +During this step Py++ reads code creators tree and writes code to the +disc. The result of code generation process should not be different from the one, +that would be achieved by human. For small project writing all code into single file is good approach, for big ones code should be written into multiple files. -Py++ implements both strategies. +Py++ implements both strategies. ------------- Features list ------------- * classes - + * class wrappers - + * two modes of code generation: - + * using scope - better error messages location from compiler - + * no scope - + * automatic detection of held type - + * nested classes - + * implicit conversion * functions - + * virtual methods - + * protected method, even non-virtual ones can be accessed from `Python`_. - + * overloading - + * two modes of code generation: - - * with function type - good for exporting template instantiated + + * with function type - good for exporting template instantiated functions and overloaded ones. - + * without function type - + * static methods - + * code generated for wrapped methods takes into account types of arguments - + * operators, both free and member ones - + * call policies resolver - - * enumerations + * enumerations + * variables, bit fields * namespace aliasing and using - + * writing multiple files - + * user code could be inserted almost any where * write code into file if there were changes - * user license is written at the top of every file - + * user license is written at the top of every file + * extracting documentation from source files and integrating it with generated source code - + * ... ------- License ------- -`Boost Software License`_. - +`Boost Software License`_. + .. _`Py++` : ./pyplusplus.html .. _`pygccxml` : ./../pygccxml/pygccxml.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/quotes.rest =================================================================== --- pyplusplus_dev/docs/quotes.rest 2006-08-16 08:43:25 UTC (rev 410) +++ pyplusplus_dev/docs/quotes.rest 2006-08-16 08:44:16 UTC (rev 411) @@ -1,78 +1,76 @@ -========================= -What they say about Py++? -========================= +========================= +What they say about Py++? +========================= .. 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 -actively developed. It can also do quite a few tricks pyste cannot. " - - 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 -ever wanted to do with Pyste and couldn't and then some. It is really -a great tool and I can't thank Roman enough for taking the time to -create it and make it available. " - +"... 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 +actively developed. It can also do quite a few tricks pyste cannot. " + + 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 +ever wanted to do with Pyste and couldn't and then some. It is really +a great tool and I can't thank Roman enough for taking the time to +create it and make it available. " + Allen Bierbaum, the author of `PyOpenSG`_ library - -"... This rule based approach is amazing for maintenance, as it reduces the -turnaround for binding new code. If the new Ogre API's follow similar rules and -standards as previously defined, the same set of rules will appropriately bind -the new API without any effort on the part of the maintainers. " - -" ... In general, I've really liked working with pyplusplus. I've probably spent -20-30 hours working on these bindings, and they are very close to being equivalent -to the PyOgre bindings (when I last used them). " - - Lakin Wecker, the author of `Python-OGRE`_ project - + +"... This rule based approach is amazing for maintenance, as it reduces the +turnaround for binding new code. If the new Ogre API's follow similar rules and +standards as previously defined, the same set of rules will appropriately bind +the new API without any effort on the part of the maintainers. " + +" ... In general, I've really liked working with pyplusplus. I've probably spent +20-30 hours working on these bindings, and they are very close to being equivalent +to the PyOgre bindings (when I last used them). " + + Lakin Wecker, the author of `Python-OGRE`_ project + ------------------ Who is using Py++? ------------------ -* Matthias Baas, the author of `Python Computer Graphics Kit`_ project, is using - `Py++`_ to create Python bindings for `Maya C++ SDK`__. - +* Matthias Baas, the author of `Python Computer Graphics Kit`_ project, is using + `Py++`_ to create Python bindings for `Maya C++ SDK`__. .. __ : http://www.highend3d.com/maya - -* Lakin Wecker, the author of `Python-OGRE`_ project, is using `Py++`_ to - create Python bindings for `OGRE`_. - +* Lakin Wecker, the author of `Python-OGRE`_ project, is using `Py++`_ to + create Python bindings for `OGRE`_. + * 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 + .. _`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 . .. _`Py++` : ./pyplusplus.html -.. _`Python Computer Graphics Kit` : http://cgkit.sourceforge.net/ -.. _`TnFOX`: http://www.nedprod.com/TnFOX/ -.. _`PyOpenSG`: https://realityforge.vrsource.org/view/PyOpenSG/WebHome -.. _`Python-OGRE` : http://lakin.weckers.net/index_ogre_python.html -.. _`OGRE` : http://www.ogre3d.org/index.php?option=com_content&task=view&id=19&Itemid=79 -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - End: +.. _`Python Computer Graphics Kit` : http://cgkit.sourceforge.net/ +.. _`TnFOX`: http://www.nedprod.com/TnFOX/ +.. _`PyOpenSG`: https://realityforge.vrsource.org/view/PyOpenSG/WebHome +.. _`Python-OGRE` : http://lakin.weckers.net/index_ogre_python.html +.. _`OGRE` : http://www.ogre3d.org/index.php?option=com_content&task=view&id=19&Itemid=79 +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |