[pygccxml-commit] SF.net SVN: pygccxml: [328] pyplusplus_dev/docs
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-07-20 07:01:23
|
Revision: 328 Author: roman_yakovenko Date: 2006-07-20 00:01:05 -0700 (Thu, 20 Jul 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=328&view=rev Log Message: ----------- moving tutorials to "documentation" directory Added Paths: ----------- pyplusplus_dev/docs/documentation/tutorials/ pyplusplus_dev/docs/documentation/tutorials/module_builder/ pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.html pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.html pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/result.html pyplusplus_dev/docs/documentation/tutorials/module_builder/www_configuration.py pyplusplus_dev/docs/documentation/tutorials/pyplusplus_demo.png pyplusplus_dev/docs/documentation/tutorials/tutorials.rest pyplusplus_dev/docs/documentation/tutorials/www_configuration.py Removed Paths: ------------- pyplusplus_dev/docs/tutorials/ Added: pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.html =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.html (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.html 2006-07-20 07:01:05 UTC (rev 328) @@ -0,0 +1,101 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>generate_code.py</title> +<meta name="GENERATOR" content="SciTE - www.Scintilla.org" /> +<style type="text/css"> +.S0 { + color: #808080; + background: #FFFFFF; +} +.S1 { + font-family: 'Courier New'; + color: #007F00; + background: #FFFFFF; + font-size: 9pt; +} +.S4 { + font-family: 'Courier New'; + color: #7F007F; + background: #FFFFFF; + font-size: 10pt; +} +.S5 { + font-weight: bold; + color: #00007F; + background: #FFFFFF; +} +.S10 { + font-weight: bold; + color: #000000; + background: #FFFFFF; +} +.S12 { + color: #7F7F7F; + background: #FFFFFF; +} +span { + font-family: 'Courier New'; + color: #000000; + background: #FFFFFF; + font-size: 10pt; +} +</style> +</head> +<body bgcolor="#FFFFFF"> +<span><span class="S1">#! /usr/bin/python</span><br /> +<span class="S1"># Copyright 2004 Roman Yakovenko.</span><br /> +<span class="S1"># Distributed under the Boost Software License, Version 1.0. (See</span><br /> +<span class="S1"># accompanying file LICENSE_1_0.txt or copy at</span><br /> +<span class="S1"># http://www.boost.org/LICENSE_1_0.txt)</span><br /> +<br /> +<span class="S5">import</span><span class="S0"> </span>os<br /> +<span class="S5">import</span><span class="S0"> </span>sys<br /> +sys<span class="S10">.</span>path<span class="S10">.</span>append<span class="S10">(</span><span class="S0"> </span><span class="S4">'../..'</span><span class="S0"> </span><span class="S10">)</span><br /> +<span class="S5">from</span><span class="S0"> </span>environment<span class="S0"> </span><span class="S5">import</span><span class="S0"> </span>gccxml<br /> +<span class="S5">from</span><span class="S0"> </span>pyplusplus<span class="S0"> </span><span class="S5">import</span><span class="S0"> </span>module_builder<br /> +<br /> +mb<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>module_builder<span class="S10">.</span>module_builder_t<span class="S10">(</span><br /> +<span class="S0"> </span>files<span class="S10">=[</span><span class="S4">'hello_world.hpp'</span><span class="S10">]</span><br /> +<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span>gccxml_path<span class="S10">=</span>gccxml<span class="S10">.</span>executable<span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><span class="S1">#path to gccxml executable</span><br /> +<br /> +<span class="S1">#rename enum Color to color</span><br /> +Color<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>mb<span class="S10">.</span>enum<span class="S10">(</span><span class="S0"> </span><span class="S4">'color'</span><span class="S0"> </span><span class="S10">)</span><br /> +Color<span class="S10">.</span>rename<span class="S10">(</span><span class="S4">'Color'</span><span class="S10">)</span><br /> +<br /> +<span class="S1">#Set call policies to animal::get_name_ptr</span><br /> +animal<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>mb<span class="S10">.</span>class_<span class="S10">(</span><span class="S0"> </span><span class="S4">'animal'</span><span class="S0"> </span><span class="S10">)</span><br /> +get_name_ptr<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>animal<span class="S10">.</span>member_function<span class="S10">(</span><span class="S0"> </span><span class="S4">'get_name_ptr'</span><span class="S10">,</span><span class="S0"> </span>recursive<span class="S10">=</span>False<span class="S0"> </span><span class="S10">)</span><br /> +get_name_ptr<span class="S10">.</span>call_policies<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>module_builder<span class="S10">.</span>call_policies<span class="S10">.</span>return_internal_reference<span class="S10">()</span><br /> +<br /> +<span class="S1">#next code has same effect</span><br /> +get_name_ptr<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>mb<span class="S10">.</span>member_function<span class="S10">(</span><span class="S0"> </span><span class="S4">'get_name_ptr'</span><span class="S0"> </span><span class="S10">)</span><br /> +get_name_ptr<span class="S10">.</span>call_policies<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>module_builder<span class="S10">.</span>call_policies<span class="S10">.</span>return_internal_reference<span class="S10">()</span><br /> +<br /> +<span class="S1">#I want to exclude all classes with name starts with impl</span><br /> +impl_classes<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>mb<span class="S10">.</span>classes<span class="S10">(</span><span class="S0"> </span><span class="S5">lambda</span><span class="S0"> </span>decl<span class="S10">:</span><span class="S0"> </span>decl<span class="S10">.</span>name<span class="S10">.</span>startswith<span class="S10">(</span><span class="S0"> </span><span class="S4">'impl'</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><span class="S10">)</span><br /> +impl_classes<span class="S10">.</span>exclude<span class="S10">()</span><br /> +<br /> +<span class="S1">#I want to exclude all functions that returns pointer to int</span><br /> +ptr_to_int<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>mb<span class="S10">.</span>free_functions<span class="S10">(</span><span class="S0"> </span>return_type<span class="S10">=</span><span class="S4">'int *'</span><span class="S0"> </span><span class="S10">)</span><br /> +ptr_to_int<span class="S10">.</span>exclude<span class="S10">()</span><br /> +<br /> +<span class="S1">#I can print declarations to see what is going on</span><br /> +mb<span class="S10">.</span>print_declarations<span class="S10">()</span><br /> +<br /> +<span class="S1">#I can print single declaration</span><br /> +mb<span class="S10">.</span>print_declarations<span class="S10">(</span><span class="S0"> </span>animal<span class="S0"> </span><span class="S10">)</span><br /> +<br /> +<span class="S1">#Now it is the time to give a name to our module</span><br /> +mb<span class="S10">.</span>build_code_creator<span class="S10">(</span><span class="S0"> </span>module_name<span class="S10">=</span><span class="S4">'hw'</span><span class="S0"> </span><span class="S10">)</span><br /> +<br /> +<span class="S1">#It is common requirement in software world - each file should have license</span><br /> +mb<span class="S10">.</span>code_creator<span class="S10">.</span>license<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">'//Boost Software License( http://boost.org/more/license_info.html )'</span><br /> +<br /> +<span class="S1">#I don't want absolute includes within code</span><br /> +mb<span class="S10">.</span>code_creator<span class="S10">.</span>user_defined_directories<span class="S10">.</span>append<span class="S10">(</span><span class="S0"> </span>os<span class="S10">.</span>path<span class="S10">.</span>abspath<span class="S10">(</span><span class="S4">'.'</span><span class="S10">)</span><span class="S0"> </span><span class="S10">)</span><br /> +<br /> +<span class="S1">#And finally we can write code to the disk</span><br /> +mb<span class="S10">.</span>write_module<span class="S10">(</span><span class="S0"> </span>os<span class="S10">.</span>path<span class="S10">.</span>join<span class="S10">(</span><span class="S0"> </span>os<span class="S10">.</span>path<span class="S10">.</span>abspath<span class="S10">(</span><span class="S4">'.'</span><span class="S10">),</span><span class="S0"> </span><span class="S4">'hello_world.py.cpp'</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><span class="S10">)</span></span> +</body> +</html> Added: pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.html =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.html (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.html 2006-07-20 07:01:05 UTC (rev 328) @@ -0,0 +1,97 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>hello_world.hpp</title> +<meta name="GENERATOR" content="SciTE - www.Scintilla.org" /> +<style type="text/css"> +.S0 { + color: #808080; + background: #FFFFFF; +} +.S2 { + font-family: 'Courier New'; + color: #007F00; + background: #FFFFFF; + font-size: 9pt; +} +.S3 { + font-family: 'Courier New'; + color: #3F703F; + background: #FFFFFF; + font-size: 9pt; +} +.S4 { + color: #007F7F; + background: #FFFFFF; +} +.S5 { + font-weight: bold; + color: #00007F; + background: #FFFFFF; +} +.S6 { + color: #7F007F; + background: #FFFFFF; +} +.S9 { + color: #7F7F00; + background: #FFFFFF; +} +.S10 { + font-weight: bold; + color: #000000; + background: #FFFFFF; +} +span { + font-family: 'Courier New'; + color: #000000; + background: #FFFFFF; + font-size: 10pt; +} +</style> +</head> +<body bgcolor="#FFFFFF"> +<span><span class="S2">// Copyright 2004 Roman Yakovenko.</span><br /> +<span class="S2">// Distributed under the Boost Software License, Version 1.0. (See</span><br /> +<span class="S2">// accompanying file LICENSE_1_0.txt or copy at</span><br /> +<span class="S2">// http://www.boost.org/LICENSE_1_0.txt)</span><br /> +<br /> +<span class="S9">#ifndef __hello_world_hpp__</span><br /> +<span class="S9">#define __hello_world_hpp__</span><br /> +<br /> +<span class="S9">#include <string></span><br /> +<br /> +<span class="S2">//I want to rename color to Color</span><br /> +<span class="S5">enum</span><span class="S0"> </span>color<span class="S10">{</span><span class="S0"> </span>red<span class="S10">,</span><span class="S0"> </span>green<span class="S10">,</span><span class="S0"> </span>blue<span class="S0"> </span><span class="S10">};</span><br /> +<br /> +<span class="S5">struct</span><span class="S0"> </span>animal<span class="S10">{</span><br /> +<span class="S0"> </span><br /> +<span class="S0"> </span>animal<span class="S10">(</span><span class="S0"> </span><span class="S5">const</span><span class="S0"> </span>std<span class="S10">::</span>string<span class="S10">&</span><span class="S0"> </span>name<span class="S10">=</span><span class="S6">""</span><span class="S0"> </span><span class="S10">)</span><br /> +<span class="S0"> </span><span class="S10">:</span><span class="S0"> </span>m_name<span class="S10">(</span><span class="S0"> </span>name<span class="S0"> </span><span class="S10">)</span><br /> +<span class="S0"> </span><span class="S10">{}</span><br /> +<span class="S0"> </span><br /> +<span class="S0"> </span><span class="S2">//I need to set call policies to the function</span><br /> +<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span>std<span class="S10">::</span>string<span class="S10">*</span><span class="S0"> </span>get_name_ptr<span class="S10">()</span><span class="S0"> </span><span class="S5">const</span><br /> +<span class="S0"> </span><span class="S10">{</span><span class="S0"> </span><span class="S5">return</span><span class="S0"> </span><span class="S10">&</span>m_name<span class="S10">;</span><span class="S0"> </span><span class="S10">}</span><br /> +<br /> +<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span>std<span class="S10">::</span>string<span class="S10">&</span><span class="S0"> </span>name<span class="S10">()</span><span class="S0"> </span><span class="S5">const</span><br /> +<span class="S0"> </span><span class="S10">{</span><span class="S0"> </span><span class="S5">return</span><span class="S0"> </span>m_name<span class="S10">;</span><span class="S0"> </span><span class="S10">}</span><br /> +<span class="S0"> </span><br /> +<span class="S5">private</span><span class="S10">:</span><span class="S0"> </span><br /> +<span class="S0"> </span>std<span class="S10">::</span>string<span class="S0"> </span>m_name<span class="S10">;</span><br /> +<br /> +<span class="S10">};</span><br /> +<br /> +<span class="S2">//I want to exclude next declarations:</span><br /> +<span class="S5">struct</span><span class="S0"> </span>impl1<span class="S10">{};</span><br /> +<span class="S5">struct</span><span class="S0"> </span>impl2<span class="S10">{};</span><br /> +<br /> +<span class="S5">inline</span><span class="S0"> </span><span class="S5">int</span><span class="S10">*</span><span class="S0"> </span>get_int_ptr<span class="S10">(){</span><span class="S0"> </span><span class="S5">return</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;}</span><span class="S0"> </span><br /> +<span class="S5">inline</span><span class="S0"> </span><span class="S5">int</span><span class="S10">*</span><span class="S0"> </span>get_int_ptr<span class="S10">(</span><span class="S5">int</span><span class="S10">){</span><span class="S0"> </span><span class="S5">return</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;}</span><br /> +<span class="S5">inline</span><span class="S0"> </span><span class="S5">int</span><span class="S10">*</span><span class="S0"> </span>get_int_ptr<span class="S10">(</span><span class="S5">double</span><span class="S10">){</span><span class="S0"> </span><span class="S5">return</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;}</span><br /> +<span class="S0"> </span><br /> +<span class="S9">#endif</span><span class="S2">//__hello_world_hpp__</span><br /> +<br /> +<span class="S0"></span></span> +</body> +</html> Added: pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-07-20 07:01:05 UTC (rev 328) @@ -0,0 +1,167 @@ +==================== +pyplusplus tutorials +==================== + +.. contents:: Table of contents + +------------------- +What is pyplusplus? +------------------- + +.. include:: ./../../../definition.rest + +-------- +Preamble +-------- + +I guess you decided to try `pyplusplus`_ API. Good! Lets start. First of all, +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 `pyplusplus`_ to export + declarations from the source file + +.. _`hello_world.hpp` : ./hello_world.html +.. _`generate_code.py` : ./generate_code.html + +---------------- +module_builder_t +---------------- + +`pyplusplus`_ 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 +this class. + +------------------------- +module_builder_t.__init__ +------------------------- + +First of all, what is needed in order to create an instance of the class? + +``module_builder_t.__init__`` methods takes few arguments: + +1. ``files`` - list of all C++ source files, that declarations from them you want + to export. 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 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 +method is - all declarations has been successfully extracted from the sources +files. + +-------------------------- +Declarations customization +-------------------------- +Not all declarations should be exported! Not every declaration could be exported +without human invocation! As you already saw from example, `pyplusplus`_ 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 +directories as parsed files, will be exported: +:: + + project_root/ + details/ + impl_a.h + impl_b.h + include/ + 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. + +You can change the set of exported declarations by calling ``exclude`` or +``include`` methods, on declarations. + +Basically, this is a second step of code generation process. During this step +you could/should/may change `pyplusplus`_ defaults: + +* to rename exposed declarations +* to include/exclude declarations +* to set call policies +* ... + +I think it is critical for beginers 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 convinient, very useful. + +----------------------------------- +module_builder_t.build_code_creator +----------------------------------- + +Now it is a time to create module code creator. Do you remember, in inroduction +to `pyplusplus`_, I told you that before writing code to disc, `pyplusplus`_ 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 tutorials is not cover code creators and how you should work with them. +I will write an other 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 `pyplusplus`_ + 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. + +.. _`pyplusplus` : ./../../../pyplusplus.html +.. _`pygccxml` : ./../../../../pygccxml/pygccxml.html +.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`SourceForge`: http://sourceforge.net/index.php +.. _`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: Added: pyplusplus_dev/docs/documentation/tutorials/module_builder/result.html =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/result.html (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/result.html 2006-07-20 07:01:05 UTC (rev 328) @@ -0,0 +1,78 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>hello_world.py.cpp</title> +<meta name="GENERATOR" content="SciTE - www.Scintilla.org" /> +<style type="text/css"> +.S0 { + color: #808080; + background: #FFFFFF; +} +.S2 { + font-family: 'Courier New'; + color: #007F00; + background: #FFFFFF; + font-size: 9pt; +} +.S4 { + color: #007F7F; + background: #FFFFFF; +} +.S5 { + font-weight: bold; + color: #00007F; + background: #FFFFFF; +} +.S6 { + color: #7F007F; + background: #FFFFFF; +} +.S9 { + color: #7F7F00; + background: #FFFFFF; +} +.S10 { + font-weight: bold; + color: #000000; + background: #FFFFFF; +} +span { + font-family: 'Courier New'; + color: #000000; + background: #FFFFFF; + font-size: 10pt; +} +</style> +</head> +<body bgcolor="#FFFFFF"> +<span><span class="S2">// This file has been generated by pyplusplus.</span><br /> +<br /> +<span class="S2">//Boost Software License( http://boost.org/more/license_info.html )</span><br /> +<br /> +<span class="S9">#include "boost/python.hpp"</span><br /> +<br /> +<span class="S9">#include "hello_world.hpp"</span><br /> +<br /> +<span class="S5">namespace</span><span class="S0"> </span>bp<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>boost<span class="S10">::</span>python<span class="S10">;</span><br /> +<br /> +BOOST_PYTHON_MODULE<span class="S10">(</span>hw<span class="S10">){</span><br /> +<span class="S0"> </span>bp<span class="S10">::</span>enum_<span class="S10"><</span>color<span class="S10">>(</span><span class="S6">"Color"</span><span class="S10">)</span><br /> +<span class="S0"> </span><span class="S10">.</span>value<span class="S10">(</span><span class="S6">"blue"</span><span class="S10">,</span><span class="S0"> </span>blue<span class="S10">)</span><br /> +<span class="S0"> </span><span class="S10">.</span>value<span class="S10">(</span><span class="S6">"green"</span><span class="S10">,</span><span class="S0"> </span>green<span class="S10">)</span><br /> +<span class="S0"> </span><span class="S10">.</span>value<span class="S10">(</span><span class="S6">"red"</span><span class="S10">,</span><span class="S0"> </span>red<span class="S10">)</span><br /> +<span class="S0"> </span><span class="S10">.</span>export_values<span class="S10">()</span><br /> +<span class="S0"> </span><span class="S10">;</span><br /> +<br /> +<span class="S0"> </span>bp<span class="S10">::</span>class_<span class="S10"><</span><span class="S0"> </span>animal<span class="S10">,</span><span class="S0"> </span>boost<span class="S10">::</span>noncopyable<span class="S0"> </span><span class="S10">>(</span><span class="S0"> </span><span class="S6">"animal"</span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>init<span class="S10"><</span><span class="S0"> </span>bp<span class="S10">::</span>optional<span class="S10"><</span><span class="S0"> </span>std<span class="S10">::</span>string<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">&</span><span class="S0"> </span><span class="S10">></span><span class="S0"> </span><span class="S10">>((</span><span class="S0"> </span>bp<span class="S10">::</span>arg<span class="S10">(</span><span class="S6">"name"</span><span class="S10">)=</span><span class="S6">""</span><span class="S0"> </span><span class="S10">))</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><br /> +<span class="S0"> </span><span class="S10">.</span>def<span class="S10">(</span><span class="S6">"get_name_ptr"</span><br /> +<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span><span class="S10">&::</span>animal<span class="S10">::</span>get_name_ptr<br /> +<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>return_internal_reference<span class="S10"><</span><span class="S0"> </span><span class="S4">1</span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>default_call_policies<span class="S0"> </span><span class="S10">>()</span><span class="S0"> </span><span class="S10">)</span><span class="S0"> </span><br /> +<span class="S0"> </span><span class="S10">.</span>def<span class="S10">(</span><span class="S6">"name"</span><br /> +<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span><span class="S10">&::</span>animal<span class="S10">::</span>name<br /> +<span class="S0"> </span><span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>return_value_policy<span class="S10"><</span><span class="S0"> </span>bp<span class="S10">::</span>copy_const_reference<span class="S10">,</span><span class="S0"> </span>bp<span class="S10">::</span>default_call_policies<span class="S0"> </span><span class="S10">>()</span><span class="S0"> </span><span class="S10">);</span><br /> +<br /> +<span class="S0"> </span>bp<span class="S10">::</span>implicitly_convertible<span class="S10"><</span><span class="S0"> </span>std<span class="S10">::</span>string<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">&,</span><span class="S0"> </span>animal<span class="S0"> </span><span class="S10">>();</span><br /> +<span class="S10">}</span><br /> +<span class="S0"></span></span> +</body> +</html> Added: pyplusplus_dev/docs/documentation/tutorials/module_builder/www_configuration.py =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/www_configuration.py (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/www_configuration.py 2006-07-20 07:01:05 UTC (rev 328) @@ -0,0 +1 @@ +name = 'module builder' \ No newline at end of file Added: pyplusplus_dev/docs/documentation/tutorials/pyplusplus_demo.png =================================================================== (Binary files differ) Property changes on: pyplusplus_dev/docs/documentation/tutorials/pyplusplus_demo.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pyplusplus_dev/docs/documentation/tutorials/tutorials.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/tutorials.rest (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-07-20 07:01:05 UTC (rev 328) @@ -0,0 +1,64 @@ +========= +tutorials +========= + +.. contents:: Table of contents + +------------------- +What is pyplusplus? +------------------- + +.. include:: ./../definition.rest + +------------------- +Graphical interface +------------------- + +`pyplusplus`_ 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 `pyplusplus`_ 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 `pyplusplus`_ code for you + +.. _`graphical interface` : ./pyplusplus_demo.png +.. _`Graphical interface` : ./pyplusplus_demo.png + +--------------- +Getting started +--------------- + +I suppose you decided to do some coding with `pyplusplus`_. `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 +creator's tree. Meanwhile you can take a look on the content of +``examples/custom_code_creator`` directory. It contains example, that shows how +to create your own code creator. To be more specific, it exposes ``get*`` and +``set*`` methods as a single property. + +.. _`pyplusplus` : ./../../pyplusplus.html +.. _`pygccxml` : ./../....//pygccxml/pygccxml.html +.. _`boost.python`: http://www.boost.org/libs/python/doc/index.html +.. _`SourceForge`: http://sourceforge.net/index.php +.. _`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: Added: pyplusplus_dev/docs/documentation/tutorials/www_configuration.py =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/www_configuration.py (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/www_configuration.py 2006-07-20 07:01:05 UTC (rev 328) @@ -0,0 +1 @@ +name = 'tutorials' \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |