pygccxml-commit Mailing List for C++ Python language bindings (Page 48)
Brought to you by:
mbaas,
roman_yakovenko
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(190) |
Apr
(166) |
May
(170) |
Jun
(75) |
Jul
(105) |
Aug
(131) |
Sep
(99) |
Oct
(84) |
Nov
(67) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(66) |
Feb
(49) |
Mar
(25) |
Apr
(62) |
May
(21) |
Jun
(34) |
Jul
(9) |
Aug
(21) |
Sep
(5) |
Oct
|
Nov
(63) |
Dec
(34) |
2008 |
Jan
(10) |
Feb
(42) |
Mar
(26) |
Apr
(25) |
May
(6) |
Jun
(40) |
Jul
(18) |
Aug
(29) |
Sep
(6) |
Oct
(32) |
Nov
(14) |
Dec
(56) |
2009 |
Jan
(127) |
Feb
(52) |
Mar
(2) |
Apr
(10) |
May
(29) |
Jun
(3) |
Jul
|
Aug
(16) |
Sep
(4) |
Oct
(11) |
Nov
(8) |
Dec
(14) |
2010 |
Jan
(31) |
Feb
(1) |
Mar
(7) |
Apr
(9) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(8) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <rom...@us...> - 2006-10-18 21:23:28
|
Revision: 672 http://svn.sourceforge.net/pygccxml/?rev=672&view=rev Author: roman_yakovenko Date: 2006-10-18 14:23:08 -0700 (Wed, 18 Oct 2006) Log Message: ----------- changing the way project works with manifest files Modified Paths: -------------- developer_scripts/clean_source_dir.py Added Paths: ----------- developer_scripts/create_manifests.py pydsc_dev/MANIFEST.readme pygccxml_dev/MANIFEST.readme pyplusplus_dev/MANIFEST.readme Removed Paths: ------------- pydsc_dev/MANIFEST.in pygccxml_dev/MANIFEST.in pyplusplus_dev/MANIFEST.in Modified: developer_scripts/clean_source_dir.py =================================================================== --- developer_scripts/clean_source_dir.py 2006-10-18 21:22:05 UTC (rev 671) +++ developer_scripts/clean_source_dir.py 2006-10-18 21:23:08 UTC (rev 672) @@ -8,7 +8,7 @@ to_be_deleted_file_exts = [ '*.pyc' - , '*.py~' + , '*.py~' , '*.so' , '*.os' , '*.cpp~' Added: developer_scripts/create_manifests.py =================================================================== --- developer_scripts/create_manifests.py (rev 0) +++ developer_scripts/create_manifests.py 2006-10-18 21:23:08 UTC (rev 672) @@ -0,0 +1,85 @@ +import os +from file_system_iter import files_iterator, folders_iterator +from clean_source_dir import to_be_deleted_file_exts, to_be_deleted_files + +CURRENT_DIR = os.path.abspath( os.getcwd() ) +if 'developer_scripts' != os.path.split( CURRENT_DIR )[1]: + raise RuntimeError( "This script should be run from developer_scripts directory!" ) + +class manifest_creator_t: + def __init__( self, root ): + self.root = root + + def include_dir( self, dir_path ): + raise NotImplementedError() + + def __proceed_files( self, dir_path, manifest ): + for file_path in files_iterator( dir_path, is_recursive=False ): + file_name = os.path.split( file_path )[1] + if file_name in to_be_deleted_files: + continue + if file_name in [ 'www_configuration.py', 'MANIFEST.readme' ]: + continue + file_ext = os.path.splitext( file_name )[1] + if file_ext in to_be_deleted_file_exts: + continue + if file_ext.endswith( '~' ): + continue + manifest.write( file_path[ len( self.root ) + 1 : ] + os.linesep ) + + def __call__( self ): + manifest = file( os.path.join( self.root, 'MANIFEST' ), 'w+' ) + self.__proceed_files( self.root, manifest ) + for dir_path in folders_iterator( self.root ): + dir_name = os.path.split( dir_path )[1] + if '.svn' in dir_path: + continue + if dir_path == os.path.join( self.root, 'dist' ): + continue #exlude directory built by distutils + if not self.include_dir( dir_path ): + continue + self.__proceed_files( dir_path, manifest ) + manifest.close() + +class pydsc_creator_t( manifest_creator_t ): + def __init__( self ): + global CURRENT_DIR + root = os.path.normpath( os.path.join( CURRENT_DIR, '..', 'pydsc_dev' ) ) + manifest_creator_t.__init__( self, root ) + + def include_dir( self, dir_path ): + return True + +class pygccxml_creator_t( manifest_creator_t ): + def __init__( self ): + global CURRENT_DIR + root = os.path.normpath( os.path.join( CURRENT_DIR, '..', 'pygccxml_dev' ) ) + manifest_creator_t.__init__( self, root ) + + def include_dir( self, dir_path ): + return os.path.split( dir_path )[1] not in [ 'temp' ] + +class pyplusplus_creator_t( manifest_creator_t ): + def __init__( self ): + global CURRENT_DIR + root = os.path.normpath( os.path.join( CURRENT_DIR, '..', 'pyplusplus_dev' ) ) + manifest_creator_t.__init__( self, root ) + + def include_dir( self, dir_path ): + if os.path.split( dir_path )[1] in [ 'temp', 'osdc2006' ]: + return False + if 'pyboost' in dir_path and 'generated' in dir_path: + return False + return True + +if __name__ == '__main__': + print 'creating pydsc manifest' + pydsc_creator_t()() + print 'creating pydsc manifest - done' + print 'creating pygccxml manifest' + pygccxml_creator_t()() + print 'creating pygccxml manifest - done' + print 'creating Py++ manifest' + pyplusplus_creator_t()() + print 'creating Py++ manifest - done' + \ No newline at end of file Deleted: pydsc_dev/MANIFEST.in =================================================================== --- pydsc_dev/MANIFEST.in 2006-10-18 21:22:05 UTC (rev 671) +++ pydsc_dev/MANIFEST.in 2006-10-18 21:23:08 UTC (rev 672) @@ -1,8 +0,0 @@ -include LICENSE_1_0.txt -include MANIFEST.in -include unittests/*.py -include unittests/do_not_check/*.py -recursive-include docs/apidocs *.css -recursive-include docs/apidocs *.html -include docs/*.rest -prune docs/*/.svn Added: pydsc_dev/MANIFEST.readme =================================================================== --- pydsc_dev/MANIFEST.readme (rev 0) +++ pydsc_dev/MANIFEST.readme 2006-10-18 21:23:08 UTC (rev 672) @@ -0,0 +1 @@ +In order to create MANIFEST file you should run create_manifests.py script. \ No newline at end of file Deleted: pygccxml_dev/MANIFEST.in =================================================================== --- pygccxml_dev/MANIFEST.in 2006-10-18 21:22:05 UTC (rev 671) +++ pygccxml_dev/MANIFEST.in 2006-10-18 21:23:08 UTC (rev 672) @@ -1,13 +0,0 @@ -include LICENSE_1_0.txt -include MANIFEST.in -include unittests/*.py -include unittests/data/*.hpp -include unittests/data/*.xml -include unittests/data/*.txt -recursive-include docs/apidocs *.css -recursive-include docs/apidocs *.html -include docs/*.rest -include docs/*.png -include docs/example/* -include docs/history/* -prune docs/*/.svn \ No newline at end of file Added: pygccxml_dev/MANIFEST.readme =================================================================== --- pygccxml_dev/MANIFEST.readme (rev 0) +++ pygccxml_dev/MANIFEST.readme 2006-10-18 21:23:08 UTC (rev 672) @@ -0,0 +1 @@ +In order to create MANIFEST file you should run create_manifests.py script. \ No newline at end of file Deleted: pyplusplus_dev/MANIFEST.in =================================================================== --- pyplusplus_dev/MANIFEST.in 2006-10-18 21:22:05 UTC (rev 671) +++ pyplusplus_dev/MANIFEST.in 2006-10-18 21:23:08 UTC (rev 672) @@ -1,54 +0,0 @@ -include LICENSE_1_0.txt -include MANIFEST.in -include unittests/*.py -include unittests/data/*.hpp -include unittests/data/*.cpp -recursive-include docs/apidocs *.css -recursive-include docs/apidocs *.html -include docs/*.rest -include docs/*.png -include docs/*.html -include docs/comparisons/* -recursive-include docs/examples * -include docs/history/* -include docs/logos/* -include docs/tutorials/* -prune docs/*/.svn -prune docs/*/*/.svn - -prune examples/custom_code_creator/*/.svn -prune examples/custom_code_creator/generated/*/.svn -prune examples/custom_code_creator/unittests/*/.svn -prune examples/pyboost_dev/*/.svn -prune examples/pyboost_dev/dev/*/.svn -prune examples/pyboost_dev/dev/boost_random/*/.svn -prune examples/pyboost_dev/dev/crc/*/.svn -prune examples/pyboost_dev/dev/date_time/*/.svn -prune examples/pyboost_dev/dev/date_time/include/*/.svn -prune examples/pyboost_dev/dev/rational/*/.svn -prune examples/pyboost_dev/pyboost/*/.svn -prune examples/pyboost_dev/pyboost/boost_random/*/.svn -prune examples/pyboost_dev/pyboost/crc/*/.svn -prune examples/pyboost_dev/pyboost/date_time/*/.svn -prune examples/pyboost_dev/pyboost/rational/*/.svn -prune examples/pyboost_dev/unittestst/boost_random/*/.svn -prune examples/pyboost_dev/unittestst/crc/*/.svn -prune examples/pyboost_dev/unittestst/date_time/*/.svn -prune examples/pyboost_dev/unittestst/date_time/include/*/.svn -prune examples/pyboost_dev/unittestst/rational/*/.svn -prune examples/pyeasybmp_dev/*/.svn -prune examples/pyeasybmp_dev/pyeasybmp/*/.svn -prune examples/pyeasybmp_dev/pyeasybmp/generated/*/.svn -prune examples/pyeasybmp_dev/unittests/*/.svn - -prune examples/indexing_suite_v2/*/.svn -prune examples/indexing_suite_v2/docs/*/.svn -prune examples/indexing_suite_v2/docs/indexing_suite_v2_files/*/.svn -prune examples/indexing_suite_v2/indexing/*/.svn -prune examples/indexing_suite_v2/src/*/.svn -prune examples/indexing_suite_v2/src/indexing/*/.svn -prune examples/indexing_suite_v2/unittests/*/.svn - - -recursive-include examples * -recursive-include contrib *.py *.txt Added: pyplusplus_dev/MANIFEST.readme =================================================================== --- pyplusplus_dev/MANIFEST.readme (rev 0) +++ pyplusplus_dev/MANIFEST.readme 2006-10-18 21:23:08 UTC (rev 672) @@ -0,0 +1 @@ +In order to create MANIFEST file you should run create_manifests.py script. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-18 21:22:12
|
Revision: 671 http://svn.sourceforge.net/pygccxml/?rev=671&view=rev Author: roman_yakovenko Date: 2006-10-18 14:22:05 -0700 (Wed, 18 Oct 2006) Log Message: ----------- adding new test case for indexing suite v2 Modified Paths: -------------- pyplusplus_dev/unittests/data/indexing_suites2_to_be_exported.hpp pyplusplus_dev/unittests/indexing_suites2_tester.py Modified: pyplusplus_dev/unittests/data/indexing_suites2_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/indexing_suites2_to_be_exported.hpp 2006-10-18 18:54:05 UTC (rev 670) +++ pyplusplus_dev/unittests/data/indexing_suites2_to_be_exported.hpp 2006-10-18 21:22:05 UTC (rev 671) @@ -1,21 +1,21 @@ -// Copyright 2004 Roman Yakovenko. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef __indexing_suites2_to_be_exported_hpp__ -#define __indexing_suites2_to_be_exported_hpp__ +// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef __indexing_suites2_to_be_exported_hpp__ +#define __indexing_suites2_to_be_exported_hpp__ + #include <vector> -#include <string> +#include <string> #include <map> - -namespace indexing_suites2 { - -typedef std::vector< std::string > strings_t; - -inline void do_nothing( const strings_t& ){} +namespace indexing_suites2 { + +typedef std::vector< std::string > strings_t; + +inline void do_nothing( const strings_t& ){} + struct item_t{ item_t() : value( -1 ){} @@ -28,11 +28,16 @@ } int value; -}; +}; - -typedef std::vector<item_t> items_t; +typedef std::vector<item_t> items_t; + +typedef std::vector<item_t*> items_ptr_t; +inline items_ptr_t create_items_ptr(){ + return items_ptr_t(); +} + inline item_t get_value( const std::vector<item_t>& vec, unsigned int index ){ return vec.at(index); } @@ -41,10 +46,10 @@ vec.at(index); vec[index] = value; } - -typedef std::vector<float> fvector; -fvector empty_fvector(){ return fvector(); } +typedef std::vector<float> fvector; +fvector empty_fvector(){ return fvector(); } + typedef std::map< std::string, std::string > name2value_t; inline std::string get_first_name( name2value_t const * names ){ if( !names ){ @@ -54,7 +59,7 @@ return names->begin()->first; } } - -} - -#endif//__indexing_suites2_to_be_exported_hpp__ + +} + +#endif//__indexing_suites2_to_be_exported_hpp__ \ No newline at end of file Modified: pyplusplus_dev/unittests/indexing_suites2_tester.py =================================================================== --- pyplusplus_dev/unittests/indexing_suites2_tester.py 2006-10-18 18:54:05 UTC (rev 670) +++ pyplusplus_dev/unittests/indexing_suites2_tester.py 2006-10-18 21:22:05 UTC (rev 671) @@ -27,6 +27,10 @@ fvector.indexing_suite.disable_method( 'extend' ) fvector.indexing_suite.disable_methods_group( 'reorder' ) #fvector.indexing_suite.call_policies = module_builder.call_policies.default_call_policies() + items_ptr = generator.global_ns.typedef( 'items_ptr_t' ) + items_ptr = declarations.remove_declarated( items_ptr.type ) + items_ptr.indexing_suite.call_policies = module_builder.call_policies.return_internal_reference() + def run_tests( self, module): fv = module.fvector() @@ -43,7 +47,10 @@ name2value = module.name2value_t() name2value[ "x" ] = "y" self.failUnless( "x" == module.get_first_name( name2value ) ) - + items_ptr = module.items_ptr_t() + items_ptr.append( item ) + self.failUnless( items_ptr[0].value == 1977 ) + print 'xx' def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-18 18:54:15
|
Revision: 670 http://svn.sourceforge.net/pygccxml/?rev=670&view=rev Author: roman_yakovenko Date: 2006-10-18 11:54:05 -0700 (Wed, 18 Oct 2006) Log Message: ----------- removing logos directory, new logo is needed Removed Paths: ------------- pyplusplus_dev/docs/logos/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-18 18:52:41
|
Revision: 669 http://svn.sourceforge.net/pygccxml/?rev=669&view=rev Author: roman_yakovenko Date: 2006-10-18 11:52:30 -0700 (Wed, 18 Oct 2006) Log Message: ----------- removing logos directory, new logo is needed Removed Paths: ------------- pygccxml_dev/docs/logos/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-18 14:53:52
|
Revision: 668 http://svn.sourceforge.net/pygccxml/?rev=668&view=rev Author: roman_yakovenko Date: 2006-10-18 07:53:36 -0700 (Wed, 18 Oct 2006) Log Message: ----------- changing version in history.rest files Modified Paths: -------------- pygccxml_dev/docs/history/history.rest pyplusplus_dev/docs/history/history.rest Modified: pygccxml_dev/docs/history/history.rest =================================================================== --- pygccxml_dev/docs/history/history.rest 2006-10-18 14:46:11 UTC (rev 667) +++ pygccxml_dev/docs/history/history.rest 2006-10-18 14:53:36 UTC (rev 668) @@ -19,7 +19,7 @@ * Gottfried Ganssauge ------------- -Version 0.8.* +Version 0.8.2 ------------- 1. Few small bug fix and unit tests have been introduced on 64 Bit platform. Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2006-10-18 14:46:11 UTC (rev 667) +++ pyplusplus_dev/docs/history/history.rest 2006-10-18 14:53:36 UTC (rev 668) @@ -33,7 +33,7 @@ ------------- -Version 0.8.* +Version 0.8.2 ------------- 1. Interface changes: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-18 14:46:24
|
Revision: 667 http://svn.sourceforge.net/pygccxml/?rev=667&view=rev Author: roman_yakovenko Date: 2006-10-18 07:46:11 -0700 (Wed, 18 Oct 2006) Log Message: ----------- fixing compilation bug on MSVC 7.1 Modified Paths: -------------- pyplusplus_dev/unittests/member_functions_tester.py Modified: pyplusplus_dev/unittests/member_functions_tester.py =================================================================== --- pyplusplus_dev/unittests/member_functions_tester.py 2006-10-17 15:03:57 UTC (rev 666) +++ pyplusplus_dev/unittests/member_functions_tester.py 2006-10-18 14:46:11 UTC (rev 667) @@ -39,6 +39,7 @@ get_value = env.member_function( 'get_value', return_type='int' ) get_value.alias = 'get_value_int' get_value.name = get_value.demangled_name + get_value.create_with_signature = True mb.run_query_optimizer() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-17 15:04:21
|
Revision: 666 http://svn.sourceforge.net/pygccxml/?rev=666&view=rev Author: roman_yakovenko Date: 2006-10-17 08:03:57 -0700 (Tue, 17 Oct 2006) Log Message: ----------- updating documentation Modified Paths: -------------- pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/bindings.cpp pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/classes.hpp pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/sconstruct pyplusplus_dev/docs/documentation/functions/call_policies.rest pyplusplus_dev/docs/documentation/functions/default_args.rest pyplusplus_dev/docs/documentation/functions/functions.rest pyplusplus_dev/docs/documentation/functions/overloading.rest Modified: pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/bindings.cpp =================================================================== --- pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/bindings.cpp 2006-10-16 21:24:52 UTC (rev 665) +++ pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/bindings.cpp 2006-10-17 15:03:57 UTC (rev 666) @@ -1,8 +1,3 @@ -// Copyright 2004 Roman Yakovenko. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - #include "boost/python.hpp" #include "classes.hpp" @@ -11,11 +6,13 @@ namespace boost{ namespace python{ //We need to tell Boost.Python how to work with your smart pointer. + //Short explanation: + // "get_pointer" extracts the pointer to the object it manages. + // "pointee" extracts the type of the object, smart pointer manages. + //You can read more about this functionality in the reference manual: //http://boost.org/libs/python/doc/v2/pointee.html . - //In general - // get_pointer extracts the pointer to the object it manages. - // pointee extracts the type of the object smart pointer manages. + template<class T> inline T * get_pointer(smart_ptr_t<T> const& p){ return p.get(); @@ -86,8 +83,9 @@ //Register implicit conversion between smart pointers. Boost.Python library //can not discover relationship between classes.This will allow Boost.Python - //to treat right functions, which expect to get as argument smart_ptr_t< base_i > - //class instance. + //to treat right the functions, which expect to get as argument + //smart_ptr_t< base_i > class instance, when smart_ptr_t< derived from base_i > + //class instance is passed. //For more information about implicitly_convertible see the documentation: //http://boost.org/libs/python/doc/v2/implicit.html . bp::implicitly_convertible< smart_ptr_t< base_wrapper_t >, smart_ptr_t< base_i > >(); @@ -103,7 +101,7 @@ //in Python, which derive from the derived_t class. .def( "get_value", &derived_t::get_value, &derived_wrapper_t::default_get_value ); - //Nothing special, just registering all existing conversion. + //Now register all existing conversion: bp::implicitly_convertible< smart_ptr_t< derived_wrapper_t >, smart_ptr_t< derived_t > >(); bp::implicitly_convertible< smart_ptr_t< derived_t >, smart_ptr_t< base_i > >(); bp::implicitly_convertible< derived_ptr_t, smart_ptr_t< derived_t > >(); Modified: pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/classes.hpp =================================================================== --- pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/classes.hpp 2006-10-16 21:24:52 UTC (rev 665) +++ pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/classes.hpp 2006-10-17 15:03:57 UTC (rev 666) @@ -1,7 +1,6 @@ #ifndef classes_11_11_2006 #define classes_11_11_2006 - #include "smart_ptr.h" struct base_i{ @@ -68,14 +67,16 @@ } -//Next function could be exposed, but it could not be solved +//Next function could be exposed, but it could not be called from Python, when +//the argument is instance of derived class. +// //This is the explanation David Abrahams gave: -//Naturally; there is no instance of smart_ptr_t<base_i> anywhere in the -//Python object for the reference to bind to. The rules are the same as in C++: +// Naturally; there is no instance of smart_ptr_t<base_i> anywhere in the +// Python object for the reference to bind to. The rules are the same as in C++: // -// int f(smart_ptr_t<base>& x) { return 0; } +// int f(smart_ptr_t<base>& x); // smart_ptr_t<derived> y; -// int z = f(y); // fails to compile +// int z = f(y); // fails to compile inline int ref_get_value( smart_ptr_t< base_i >& a ){ Modified: pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/sconstruct =================================================================== --- pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/sconstruct 2006-10-16 21:24:52 UTC (rev 665) +++ pyplusplus_dev/docs/bpl_lessons_learned/smart_ptrs/sconstruct 2006-10-17 15:03:57 UTC (rev 666) @@ -1,3 +1,4 @@ +#scons build script SharedLibrary( target=r'custom_sptr' , source=[ r'bindings.cpp' ] , LIBS=[ r"boost_python" ] @@ -3,5 +4,4 @@ , LIBPATH=[ r"/home/roman/boost_cvs/bin",r"" ] , CPPPATH=[ r"/home/roman/boost_cvs",r"/usr/include/python2.4" ] - , CCFLAGS=[ '-DBOOST_PYTHON_TRACE_REGISTRY' ] , SHLIBPREFIX='' , SHLIBSUFFIX='.so' Modified: pyplusplus_dev/docs/documentation/functions/call_policies.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies.rest 2006-10-16 21:24:52 UTC (rev 665) +++ pyplusplus_dev/docs/documentation/functions/call_policies.rest 2006-10-17 15:03:57 UTC (rev 666) @@ -8,11 +8,11 @@ Introduction ------------ -`Boost.Python`_ has a `nice introduction`__ in the tutorials about call policies. -Also you can find more formal definition - `CallPolicies Concept`_ . +`Boost.Python`_ has a `nice introduction`__ to call policies. `"Call policies concept"`_ +document will provide you with formal definition. .. __ : http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies -.. _`CallPolicies Concept` : http://boost.org/libs/python/doc/v2/CallPolicies.html#CallPolicies-concept +.. _`"Call policies concept"` : http://boost.org/libs/python/doc/v2/CallPolicies.html#CallPolicies-concept ------ Syntax @@ -60,51 +60,54 @@ mb = module_builder.module_builder_t( ... ) mb.free_function( 'return_second_arg' ).call_policies = call_policies.return_arg( 2 ) + #---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mb.member_function( 'do_smth' ).call_policies = call_policies.return_self() + #-------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - mb.calldef( 'get_opaque' ).call_policies \ + mb.calldef( 'get_opaque' ).call_policies = call_policies.return_value_policy( call_policies.return_opaque_pointer ) -------- Defaults -------- -`Py++`_ is able to "guess" few call policies, base on analysis of return type: +`Py++`_ is able to "guess" few call policies, base on analysis of return type +and\\or operator name: * ``default_call_policies``: - * `Python`_ immutable type by value: C++ fundamental types, ``std::string``, enumerations + * `Python`_ immutable type returned by value: C++ fundamental types, ``std::string``, enumerations - * user defined type ( class ) by value + * user-defined type ( class ) returned by value - * ``const char*`` + * return type is ``const char*`` * ``return_value_policy`` * ``return_opaque_pointer`` - * ``void*`` + * return type is ``void*`` - * ``const void*`` + * return type is ``const void*`` * ``copy_const_reference`` - * ``const T&`` + * return type is ``const T&`` * for member ``operator[]`` that returns const reference to immutable type * ``return_by_value`` - * ``const wchar_t*`` + * return type is ``const wchar_t*`` * ``copy_non_const_reference`` - * ``T&``, for member ``operator[]`` that returns reference to immutable type + * return type is ``T&``, for member ``operator[]`` that returns reference to immutable type * ``return_internal_reference`` - * ``T&``, for member ``operator[]`` + * return type is ``T&``, for member ``operator[]`` --------------------- Missing call policies @@ -131,9 +134,9 @@ ------------ ``return_value_policy( return_opaque_pointer )`` is a special policy for `Boost.Python`_. -In this case, it requieres from an user to define specializations for the +In this case, it requieres from you to define specialization for the ``boost::python::type_id`` function on the type pointed to by returned pointer. -`Py++`_ will generate the requiered code. +`Py++`_ will generate the required code. For more information about the call policy please refer to `Boost.Python`_ `documentation`_. @@ -141,8 +144,6 @@ .. _`documentation` : http://boost.org/libs/python/doc/v2/return_opaque_pointer.html - - .. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/documentation/functions/default_args.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/default_args.rest 2006-10-16 21:24:52 UTC (rev 665) +++ pyplusplus_dev/docs/documentation/functions/default_args.rest 2006-10-17 15:03:57 UTC (rev 666) @@ -39,8 +39,8 @@ , ( bp::arg("a")=(int)(12) ) ); } -This approach brings another additional value: keyword arguments. Your users -will be able to call function ``f`` like this: +The additional value of the approach is keyword arguments. You will be able to +call function ``f`` like this: .. code-block:: Python @@ -52,17 +52,24 @@ ---------------------------- ``BOOST_PYTHON_FUNCTION_OVERLOADS`` and ``BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS`` -macros help to deal with default values. You can turn ``use_overload_macro`` -to ``True`` as shown in `overloading`_ document. +macros can help to deal with default values too. You can turn ``use_overload_macro`` +to ``True``: -.. _`overloading` : ./overloading.html +.. code-block:: Python + import module_builder + + mb = module_builder.module_builder_t( ... ) + x = mb.class_( "X" ) + x.member_function( "f" ).use_overload_macro = True + #------------------------^^^^^^^^^^^^^^^^^^^^^^^^^ + -------------------------- Registration order problem -------------------------- -There are different trades-off between these approaches. In general you should -use the first one, untill you have "registration order" problem: +There is different trades-off between these approaches. In general you should +use the first one, until you have "registration order" problem: .. code-block:: C++ @@ -88,30 +95,51 @@ } -These module could not be loaded, because the expression ``arg("s1")=S1()`` -requieres ``S1`` struct to be registered. `GCC-XML`_ reports default arguments -as strings. `Py++`_ doesn't have enough information to generate code with the -right class registration order. +The good news is that it is very easy to identify the problem: the module could +not be loaded. The main reason is that expression ``arg("s1")=S1()`` requires +``S1`` struct to be registered. `GCC-XML`_ reports default arguments as strings. +`Py++`_ doesn't have enough information to generate code with the right class +registration order. In this case you have to instruct `Py++`_ to use macros: +.. code-block:: Python -Unfortunatelly these macros have some limitations: + import module_builde + + mb = module_builder.module_builder_t( ... ) + s2 = mb.class_( "S2" ) + s2.member_function( "do_smth" ).use_overload_macro = True -1. The overloaded functions must have a common sequence of initial arguments. +When you switch to macros, than: -2. You will not be able to override virtual functions in `Python`_. +* You will not be able to override virtual functions in `Python`_. -3. You will not be able to use "named" arguments. +* You will not be able to use "named" arguments. -4. You will not be able to set the functions documentation. +* You will not be able to set the functions documentation. -Nevertheless these limitations the macros becomes very useful when you have -"registration order" problem with default arguments. +Special case +------------ +Class constructors are special case: +.. code-block:: C++ + struct S1; + struct S2; + + struct S1{ + S1( S2* s2=0 ); + }; + + struct S2{ + S2( S1 s1=S1() ); + }; -`Py++`_ needs your help to generate right code: +You cannot use same work around and `Py++`_ ( version 0.8.2 ) could not help you. +The use case presented here is a little bit esoteric. If you have such use case +and you cannot change the source code, consider contacting `Py++`_ developers. +I am sure we will be able to help you. .. _`Py++` : ./../pyplusplus.html Modified: pyplusplus_dev/docs/documentation/functions/functions.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/functions.rest 2006-10-16 21:24:52 UTC (rev 665) +++ pyplusplus_dev/docs/documentation/functions/functions.rest 2006-10-17 15:03:57 UTC (rev 666) @@ -10,7 +10,7 @@ `Boost.Python`_ provides very rich interface to expose functions and operators. This section of documentation will explain how to configure `Py++`_ in order -to export your code using desired `Boost.Python`_ functionality. +to export your functions, using desired `Boost.Python`_ functionality. .. _`Py++` : ./../pyplusplus.html Modified: pyplusplus_dev/docs/documentation/functions/overloading.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/overloading.rest 2006-10-16 21:24:52 UTC (rev 665) +++ pyplusplus_dev/docs/documentation/functions/overloading.rest 2006-10-17 15:03:57 UTC (rev 666) @@ -8,7 +8,7 @@ Introduction ------------ -Things get a little bit complex, when you should export overloaded functions. +Things get a little bit complex, when you have to export overloaded functions. In general the solution is to explicitly say to compiler what function you want to export, by specifying its type. Before we proceed, please take a look on next class: @@ -37,7 +37,7 @@ .. __ : http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.overloading -There are few approaches, which you can use in order to exort the functions. +There are few approaches, which you can use in order to export the functions. ------------------- Do nothing approach @@ -66,9 +66,6 @@ , ( bp::arg("a"), bp::arg("b"), bp::arg("c") ) ); } -From my experience, this approach works pretty well and in most cases the only -customization you should do on exported function is to setup right call policies. - -------------------------------- "create_with_signature" approach -------------------------------- @@ -79,15 +76,12 @@ Overloaded template function ---------------------------- -I am sure you already know next facts, but still I want to remind them: +I am sure you already know next fact, but still I want to remind it: -1. `GCC-XML`_ doesn't report about uninstantiated templates +* `GCC-XML`_ doesn't report about un-instantiated templates -2. `Boost.Python`_ is able to export only template instantiation +It is very important to understand it. Lets take a look on next source code: -It is very important to understand the first fact. Lets take a look on next source -code: - .. code-block:: C++ struct Y{ @@ -101,7 +95,7 @@ If you didn't instantiate( use ) ``do_smth`` member function, than `GCC-XML`_ will not report it. As a result, `Py++`_ will not be aware of the fact that -``do_smth`` is an overloaded function. To make the long story short the generated +``do_smth`` is an overloaded function. To make the long story short, the generated code will not compile. You have to instruct `Py++`_ to generate code, which contains function type: @@ -125,11 +119,19 @@ Code modification - the weakness of the "do nothing" approach. We live in the dynamic world. You can create bindings for a project, but a month letter, the project developers will add a new function to the exported class. Lets assume -that the function will introduce overloading. If ``create_with_signature`` has -``False`` as a value, than the previously generated code will not compile. My -advise to you: explicitly set ``create_with_signature`` to ``True``. It will -save your time in future. +that the new function will introduce overloading. If ``create_with_signature`` +has ``False`` as a value, than the previously generated code will not compile +and you will have to run code generator one more time. +Consider to explicitly set ``create_with_signature`` to ``True``. It will save +your and your users time in future. + +.. code-block:: Python + + mb = module_builder_t( ... ) + mb.calldefs().create_with_signature = True + + ------------------------ Overloading using macros ------------------------ @@ -141,7 +143,7 @@ * ``BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS`` -`Boost.Python`_ tutorials contains an `explanation`_ about this macros. +`Boost.Python`_ tutorials contain an `explanation`_ about this macros. .. _`explanation` : http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.auto_overloading This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-16 21:25:03
|
Revision: 665 http://svn.sourceforge.net/pygccxml/?rev=665&view=rev Author: roman_yakovenko Date: 2006-10-16 14:24:52 -0700 (Mon, 16 Oct 2006) Log Message: ----------- preventing default call policies from being generated Modified Paths: -------------- pyplusplus_dev/pyplusplus/decl_wrappers/call_policies.py Modified: pyplusplus_dev/pyplusplus/decl_wrappers/call_policies.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/call_policies.py 2006-10-16 18:47:03 UTC (rev 664) +++ pyplusplus_dev/pyplusplus/decl_wrappers/call_policies.py 2006-10-16 21:24:52 UTC (rev 665) @@ -87,9 +87,8 @@ def _create_impl( self, function_creator ): args = self._get_args(function_creator) - base_policy_code = self._base.create( function_creator, CREATION_POLICY.AS_TEMPLATE_ARGUMENT ) - if base_policy_code: - args.append( base_policy_code ) + if not self._base.is_default(): + args.append( self._base.create( function_creator, CREATION_POLICY.AS_TEMPLATE_ARGUMENT ) ) name = algorithm.create_identifier( function_creator, self._get_name(function_creator) ) return declarations.templates.join( name, args ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-16 18:47:18
|
Revision: 664 http://svn.sourceforge.net/pygccxml/?rev=664&view=rev Author: roman_yakovenko Date: 2006-10-16 11:47:03 -0700 (Mon, 16 Oct 2006) Log Message: ----------- change ssize_t to index_type Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_repository/convenience.py Modified: pyplusplus_dev/pyplusplus/code_repository/convenience.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/convenience.py 2006-10-16 17:14:55 UTC (rev 663) +++ pyplusplus_dev/pyplusplus/code_repository/convenience.py 2006-10-16 18:47:03 UTC (rev 664) @@ -25,6 +25,10 @@ namespace pyplusplus{ namespace convenience{ +//TODO: Replace index_type with Boost.Python defined ssize_t type. +// This should be done by checking Python and Boost.Python version. +typedef int index_type; + inline void raise_error( PyObject *exception, const char *message ){ PyErr_SetString(exception, message); @@ -32,14 +36,14 @@ } inline void -ensure_sequence( boost::python::object seq, boost::python::ssize_t expected_length=-1 ){ +ensure_sequence( boost::python::object seq, index_type expected_length=-1 ){ PyObject* seq_impl = seq.ptr(); if( !PySequence_Check( seq_impl ) ){ raise_error( PyExc_TypeError, "Sequence expected" ); } - boost::python::ssize_t length = PySequence_Length( seq_impl ); + index_type length = PySequence_Length( seq_impl ); if( expected_length != -1 && length != expected_length ){ std::stringstream err; err << "Expected sequence length is " << expected_length << ". " @@ -49,11 +53,11 @@ } template< class ExpectedType > -void ensure_uniform_sequence( boost::python::object seq, boost::python::ssize_t expected_length=-1 ){ +void ensure_uniform_sequence( boost::python::object seq, index_type expected_length=-1 ){ ensure_sequence( seq, expected_length ); - boost::python::ssize_t length = boost::python::len( seq ); - for( boost::python::ssize_t index = 0; index < length; ++index ){ + index_type length = boost::python::len( seq ); + for( index_type index = 0; index < length; ++index ){ boost::python::object item = seq[index]; boost::python::extract<ExpectedType> type_checker( item ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mb...@us...> - 2006-10-16 17:15:02
|
Revision: 663 http://svn.sourceforge.net/pygccxml/?rev=663&view=rev Author: mbaas Date: 2006-10-16 10:14:55 -0700 (Mon, 16 Oct 2006) Log Message: ----------- Fixed the handling of requested include files and made the function transformers request the convenience header (instead of the code creator). Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py pyplusplus_dev/pyplusplus/function_transformers/arg_policies.py Modified: pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py 2006-10-16 09:44:27 UTC (rev 662) +++ pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py 2006-10-16 17:14:55 UTC (rev 663) @@ -67,6 +67,7 @@ # Create the substitution manager sm = function_transformers.substitution_manager_t(function, transformers=function.function_transformers) + sm.init_funcs() self._subst_manager = sm # def is_free_function(self): @@ -169,6 +170,13 @@ answer.append( '}' ) return os.linesep.join( answer ) + def get_required_headers(self): + """Return a list of required header file names.""" + res = [] + res += self._subst_manager.virtual_func.get_required_headers() + res += self._subst_manager.wrapper_func.get_required_headers() + return res + def _create_impl(self): answer = self.create_function() @@ -244,6 +252,7 @@ # Create the substitution manager sm = function_transformers.substitution_manager_t(function, transformers=function.function_transformers) + sm.init_funcs() self._subst_manager = sm # Stores the name of the variable that holds the override @@ -501,7 +510,7 @@ def get_required_headers(self): """Return a list of required header file names.""" - res = [code_repository.gil_guard.file_name, code_repository.convenience.file_name ] + res = [code_repository.gil_guard.file_name] res += self._subst_manager.virtual_func.get_required_headers() res += self._subst_manager.wrapper_func.get_required_headers() return res Modified: pyplusplus_dev/pyplusplus/function_transformers/arg_policies.py =================================================================== --- pyplusplus_dev/pyplusplus/function_transformers/arg_policies.py 2006-10-16 09:44:27 UTC (rev 662) +++ pyplusplus_dev/pyplusplus/function_transformers/arg_policies.py 2006-10-16 17:14:55 UTC (rev 663) @@ -17,6 +17,7 @@ """ import os from pygccxml import declarations +from pyplusplus import code_repository # output_t class output_t: @@ -236,6 +237,9 @@ # Replace the input parameter with the C array sm.wrapper_func.input_params[self.idx-1] = self.carray + # Request the convenience header + sm.wrapper_func.require_header(code_repository.convenience.file_name) + def wrapper_pre_call(self, sm): """Wrapper function code. """ @@ -327,6 +331,10 @@ # Declare an int which is used for the loop self.virtual_ivar = sm.virtual_func.declare_local("i", "int", default=0) + # Request the convenience header + sm.virtual_func.require_header(code_repository.convenience.file_name) + + def wrapper_post_call(self, sm): res = "" res += "// Copy the sequence '%s' into '%s'...\n"%(self.wrapper_cval, self.wrapper_pyval) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-16 09:44:33
|
Revision: 662 http://svn.sourceforge.net/pygccxml/?rev=662&view=rev Author: roman_yakovenko Date: 2006-10-16 02:44:27 -0700 (Mon, 16 Oct 2006) Log Message: ----------- removing automatic import of gui package Modified Paths: -------------- pyplusplus_dev/pyplusplus/__init__.py Modified: pyplusplus_dev/pyplusplus/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/__init__.py 2006-10-15 19:21:55 UTC (rev 661) +++ pyplusplus_dev/pyplusplus/__init__.py 2006-10-16 09:44:27 UTC (rev 662) @@ -26,7 +26,6 @@ import code_creators import file_writers import module_creator -import gui import code_repository import utils import decl_wrappers This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-15 19:22:07
|
Revision: 661 http://svn.sourceforge.net/pygccxml/?rev=661&view=rev Author: roman_yakovenko Date: 2006-10-15 12:21:55 -0700 (Sun, 15 Oct 2006) Log Message: ----------- adding functions documentation Modified Paths: -------------- pyplusplus_dev/docs/documentation/containers.rest pyplusplus_dev/docs/documentation/functions/www_configuration.py Added Paths: ----------- pyplusplus_dev/docs/documentation/functions/default_args.rest pyplusplus_dev/docs/documentation/functions/overloading.rest Modified: pyplusplus_dev/docs/documentation/containers.rest =================================================================== --- pyplusplus_dev/docs/documentation/containers.rest 2006-10-12 14:59:28 UTC (rev 660) +++ pyplusplus_dev/docs/documentation/containers.rest 2006-10-15 19:21:55 UTC (rev 661) @@ -51,10 +51,12 @@ .. _`documentation` : ./indexing_suite_v2.html .. _`post` : http://mail.python.org/pipermail/c++-sig/2003-October/005802.html - ------------------------- -Py++ and indexing suites ------------------------- + + +------------------------ +Py++ and indexing suites +------------------------ + `Py++`_ implements support for both indexing suites. More over, you can freely mix indexing suites. For example you can expose ``std::vector<int>`` using `Boost.Python`_ built-in indexing suite and ``std::map< int, std::string>`` using Added: pyplusplus_dev/docs/documentation/functions/default_args.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/default_args.rest (rev 0) +++ pyplusplus_dev/docs/documentation/functions/default_args.rest 2006-10-15 19:21:55 UTC (rev 661) @@ -0,0 +1,128 @@ +================= +Default arguments +================= + +.. contents:: Table of contents + +------------ +Introduction +------------ + +There is more than one way to export function with default arguments. Before we +proceed, please take a look on next class: + +.. code-block:: C++ + + struct X + { + bool f(int a=12) + { + return true; + } + }; + +------------------- +Do nothing approach +------------------- + +By default `Py++`_ exposes function with its default arguments. + +.. code-block:: C++ + + namespace bp = boost::python; + + BOOST_PYTHON_MODULE(pyplusplus){ + bp::class_< X >( "X" ) + .def( + "f" + , &::X::f + , ( bp::arg("a")=(int)(12) ) ); + } + +This approach brings another additional value: keyword arguments. Your users +will be able to call function ``f`` like this: + +.. code-block:: Python + + x = X() + x.f( a=13 ) + +---------------------------- +Default values, using macros +---------------------------- + +``BOOST_PYTHON_FUNCTION_OVERLOADS`` and ``BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS`` +macros help to deal with default values. You can turn ``use_overload_macro`` +to ``True`` as shown in `overloading`_ document. + +.. _`overloading` : ./overloading.html + +-------------------------- +Registration order problem +-------------------------- + +There are different trades-off between these approaches. In general you should +use the first one, untill you have "registration order" problem: + +.. code-block:: C++ + + struct S1; + struct S2; + + struct S1{ + void do_smth( S2* s2=0 ); + }; + + struct S2{ + void do_smth( S1 s1=S1() ); + }; + + BOOST_PYTHON_MODULE( ... ){ + using namespace boost::python; + + class_< S2 >( "S2" ) + .def( "do_smth", &S2::do_smth, ( arg("s1")=S1() ) ); + + class_< S1 >( "S1" ) + .def( "do_smth", &S1::do_smth, ( arg("s2")=object() ) ); + + } + +These module could not be loaded, because the expression ``arg("s1")=S1()`` +requieres ``S1`` struct to be registered. `GCC-XML`_ reports default arguments +as strings. `Py++`_ doesn't have enough information to generate code with the +right class registration order. + + +Unfortunatelly these macros have some limitations: + +1. The overloaded functions must have a common sequence of initial arguments. + +2. You will not be able to override virtual functions in `Python`_. + +3. You will not be able to use "named" arguments. + +4. You will not be able to set the functions documentation. + +Nevertheless these limitations the macros becomes very useful when you have +"registration order" problem with default arguments. + + + + +`Py++`_ needs your help to generate right code: + + + +.. _`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: Added: pyplusplus_dev/docs/documentation/functions/overloading.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/overloading.rest (rev 0) +++ pyplusplus_dev/docs/documentation/functions/overloading.rest 2006-10-15 19:21:55 UTC (rev 661) @@ -0,0 +1,179 @@ +=========== +Overloading +=========== + +.. contents:: Table of contents + +------------ +Introduction +------------ + +Things get a little bit complex, when you should export overloaded functions. +In general the solution is to explicitly say to compiler what function you +want to export, by specifying its type. Before we proceed, please take a look +on next class: + +.. code-block:: C++ + + struct X + { + bool f(int a) + { + return true; + } + + bool f(int a, double b) + { + return true; + } + + bool f(int a, double b, char c) + { + return true; + } + }; + +This class has been taken from `Boost.Python`_ `tutorials`__. + +.. __ : http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.overloading + +There are few approaches, which you can use in order to exort the functions. + +------------------- +Do nothing approach +------------------- + +I am sure you will like "do nothing" approach. `Py++`_ recognize that you want to +export an overloaded function and will generate the right code: + +.. code-block:: C++ + + namespace bp = boost::python; + + BOOST_PYTHON_MODULE(pyplusplus){ + bp::class_< X >( "X" ) + .def( + "f" + , (bool ( ::X::* )( int ) )( &::X::f ) + , ( bp::arg("a") ) ) + .def( + "f" + , (bool ( ::X::* )( int,double ) )( &::X::f ) + , ( bp::arg("a"), bp::arg("b") ) ) + .def( + "f" + , (bool ( ::X::* )( int,double,char ) )( &::X::f ) + , ( bp::arg("a"), bp::arg("b"), bp::arg("c") ) ); + } + +From my experience, this approach works pretty well and in most cases the only +customization you should do on exported function is to setup right call policies. + +-------------------------------- +"create_with_signature" approach +-------------------------------- + +Well, while previous approach is very attractive it does not work in all cases +and have a weakness. + +Overloaded template function +---------------------------- + +I am sure you already know next facts, but still I want to remind them: + +1. `GCC-XML`_ doesn't report about uninstantiated templates + +2. `Boost.Python`_ is able to export only template instantiation + +It is very important to understand the first fact. Lets take a look on next source +code: + +.. code-block:: C++ + + struct Y{ + + void do_smth( int ); + + template< class T> + void do_smth( T t ); + + }; + +If you didn't instantiate( use ) ``do_smth`` member function, than `GCC-XML`_ +will not report it. As a result, `Py++`_ will not be aware of the fact that +``do_smth`` is an overloaded function. To make the long story short the generated +code will not compile. You have to instruct `Py++`_ to generate code, which +contains function type: + +.. code-block:: Python + + from pyplusplus import module_builder + + mb = module_builder.module_builder_t( ... ) + y = mb.class_( 'Y' ) + y.member_function( 'do_smth' ).create_with_signature = True + #------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Every `Py++`_ class, which describes C++ function\\operator has ``create_with_signature`` +property. You have to set it to ``True``. Default value of the property is +computed. If the exported function is overloaded, then its value is ``True`` +otherwise it will be ``False``. + +Do nothing approach weakness +---------------------------- + +Code modification - the weakness of the "do nothing" approach. We live in the +dynamic world. You can create bindings for a project, but a month letter, the +project developers will add a new function to the exported class. Lets assume +that the function will introduce overloading. If ``create_with_signature`` has +``False`` as a value, than the previously generated code will not compile. My +advise to you: explicitly set ``create_with_signature`` to ``True``. It will +save your time in future. + +------------------------ +Overloading using macros +------------------------ + +`Boost.Python`_ provides two macros, which help you to deal with overloaded +functions: + +* ``BOOST_PYTHON_FUNCTION_OVERLOADS`` + +* ``BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS`` + +`Boost.Python`_ tutorials contains an `explanation`_ about this macros. + +.. _`explanation` : http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.auto_overloading + +You can instruct `Py++`_ to generate code, which will use the macros: + +.. code-block:: Python + + import module_builder + + mb = module_builder.module_builder_t( ... ) + x = mb.class_( "X" ) + x.member_functions( "f" ).use_overload_macro = True + #-------------------------^^^^^^^^^^^^^^^^^^^^^^^^^ + +Member and free functions declaration classes have ``use_overload_macro`` property. +The default value of the property is ``False``. + +You don't really have to use the macros, unless you have "registration order" +problem. The problem and work around described in `default arguments`_ document. + +.. _`default arguments` : ./default_args.html + + +.. _`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/documentation/functions/www_configuration.py =================================================================== --- pyplusplus_dev/docs/documentation/functions/www_configuration.py 2006-10-12 14:59:28 UTC (rev 660) +++ pyplusplus_dev/docs/documentation/functions/www_configuration.py 2006-10-15 19:21:55 UTC (rev 661) @@ -2,4 +2,5 @@ #main_html_file = 'index.html' names = { 'call_policies' : 'call policies' + , 'default_args' : 'default arguments' } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 14:59:42
|
Revision: 660 http://svn.sourceforge.net/pygccxml/?rev=660&view=rev Author: roman_yakovenko Date: 2006-10-12 07:59:28 -0700 (Thu, 12 Oct 2006) Log Message: ----------- adding documentation Added Paths: ----------- pyplusplus_dev/docs/documentation/functions/ pyplusplus_dev/docs/documentation/functions/call_policies.rest pyplusplus_dev/docs/documentation/functions/functions.rest pyplusplus_dev/docs/documentation/functions/www_configuration.py Added: pyplusplus_dev/docs/documentation/functions/call_policies.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies.rest (rev 0) +++ pyplusplus_dev/docs/documentation/functions/call_policies.rest 2006-10-12 14:59:28 UTC (rev 660) @@ -0,0 +1,157 @@ +============= +Call policies +============= + +.. contents:: Table of contents + +------------ +Introduction +------------ + +`Boost.Python`_ has a `nice introduction`__ in the tutorials about call policies. +Also you can find more formal definition - `CallPolicies Concept`_ . + +.. __ : http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies +.. _`CallPolicies Concept` : http://boost.org/libs/python/doc/v2/CallPolicies.html#CallPolicies-concept + +------ +Syntax +------ + +The call policies in `Py++`_ are named exactly as in `Boost.Python`_, only the +syntax is slightly different. For instance, this call policy: + +.. code-block:: C++ + + return_internal_reference< 1, with_custodian_and_ward<1, 2> >() + +becomes in `Py++`_ + +.. code-block:: Python + + return_internal_reference( 1, with_custodian_and_ward(1, 2) ) + +`Py++`_ supports all call policies presented in `Boost.Python`_. + +------------- +Usage example +------------- + +Every "callable" object in `Py++`_ has ``call_policies`` property. + +C++ code: + + .. code-block:: C++ + + struct data{...}; + const data& do_smth( const data& d, int x ); + + void return_second_arg( int x, int y ); + + typedef struct opaque_ *opaque_pointer; + opaque_pointer get_opaque(); + +Python code: + + .. code-block:: Python + + from pyplusplus import module_builder + from pyplusplus.module_builder import call_policies + + mb = module_builder.module_builder_t( ... ) + mb.free_function( 'return_second_arg' ).call_policies = call_policies.return_arg( 2 ) + + mb.member_function( 'do_smth' ).call_policies = call_policies.return_self() + + mb.calldef( 'get_opaque' ).call_policies \ + = call_policies.return_value_policy( call_policies.return_opaque_pointer ) + +-------- +Defaults +-------- + +`Py++`_ is able to "guess" few call policies, base on analysis of return type: + +* ``default_call_policies``: + + * `Python`_ immutable type by value: C++ fundamental types, ``std::string``, enumerations + + * user defined type ( class ) by value + + * ``const char*`` + +* ``return_value_policy`` + + * ``return_opaque_pointer`` + + * ``void*`` + + * ``const void*`` + + * ``copy_const_reference`` + + * ``const T&`` + + * for member ``operator[]`` that returns const reference to immutable type + + * ``return_by_value`` + + * ``const wchar_t*`` + + * ``copy_non_const_reference`` + + * ``T&``, for member ``operator[]`` that returns reference to immutable type + + * ``return_internal_reference`` + + * ``T&``, for member ``operator[]`` + +--------------------- +Missing call policies +--------------------- + +If you don't specify call policy for a function and it needs one, few things will +happen: + +* `Py++`_ prints a warning message + +* `Py++`_ generates code with + + .. code-block:: C++ + + /* undefined call policies */ + + comment, in place of call policy. If `Py++`_ was wrong and function doesn't + need call policy the generate code will compile fine, otherwise you will get a + compilation error. + + +------------ +Special case +------------ + +``return_value_policy( return_opaque_pointer )`` is a special policy for `Boost.Python`_. +In this case, it requieres from an user to define specializations for the +``boost::python::type_id`` function on the type pointed to by returned pointer. +`Py++`_ will generate the requiered code. + +For more information about the call policy please refer to `Boost.Python`_ +`documentation`_. + +.. _`documentation` : http://boost.org/libs/python/doc/v2/return_opaque_pointer.html + + + + +.. _`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: Added: pyplusplus_dev/docs/documentation/functions/functions.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/functions.rest (rev 0) +++ pyplusplus_dev/docs/documentation/functions/functions.rest 2006-10-12 14:59:28 UTC (rev 660) @@ -0,0 +1,27 @@ +===================== +Functions & operators +===================== + +.. contents:: Table of contents + +-------- +Preamble +-------- + +`Boost.Python`_ provides very rich interface to expose functions and operators. +This section of documentation will explain how to configure `Py++`_ in order +to export your code using desired `Boost.Python`_ functionality. + + +.. _`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: Added: pyplusplus_dev/docs/documentation/functions/www_configuration.py =================================================================== --- pyplusplus_dev/docs/documentation/functions/www_configuration.py (rev 0) +++ pyplusplus_dev/docs/documentation/functions/www_configuration.py 2006-10-12 14:59:28 UTC (rev 660) @@ -0,0 +1,5 @@ +name = 'functions & operators' +#main_html_file = 'index.html' + +names = { 'call_policies' : 'call policies' +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 11:38:49
|
Revision: 659 http://svn.sourceforge.net/pygccxml/?rev=659&view=rev Author: roman_yakovenko Date: 2006-10-12 04:38:31 -0700 (Thu, 12 Oct 2006) Log Message: ----------- fixing broken links, reported by linkchekcer Modified Paths: -------------- developer_scripts/check_links.bat pyplusplus_dev/docs/comparisons/pyste.rest pyplusplus_dev/docs/documentation/best_practices.rest pyplusplus_dev/docs/examples/examples.rest pyplusplus_dev/docs/peps/peps_index.rest Modified: developer_scripts/check_links.bat =================================================================== --- developer_scripts/check_links.bat 2006-10-12 09:57:05 UTC (rev 658) +++ developer_scripts/check_links.bat 2006-10-12 11:38:31 UTC (rev 659) @@ -1 +1 @@ -e:\python24\python.exe e:\python24\Scripts\linkchecker ..\..\language-binding\production\www\index.html +E:\Python24\Scripts\linkchecker.bat ..\..\language-binding\production\www\index.html Modified: pyplusplus_dev/docs/comparisons/pyste.rest =================================================================== --- pyplusplus_dev/docs/comparisons/pyste.rest 2006-10-12 09:57:05 UTC (rev 658) +++ pyplusplus_dev/docs/comparisons/pyste.rest 2006-10-12 11:38:31 UTC (rev 659) @@ -424,7 +424,7 @@ thought about them, long before I created `Py++`_. But unfortunately, lack of time and motivation prevents him to work on `Pyste`_. -.. _`screenshot` : ./../tutorials/pyplusplus_demo.png +.. _`screenshot` : ./../documentation/tutorials/pyplusplus_demo.png .. _`Py++` : ./../pyplusplus.html .. _`pygccxml` : ./../../pygccxml/pygccxml.html .. _`Pyste`: http://www.boost.org/libs/python/doc/index.html Modified: pyplusplus_dev/docs/documentation/best_practices.rest =================================================================== --- pyplusplus_dev/docs/documentation/best_practices.rest 2006-10-12 09:57:05 UTC (rev 658) +++ pyplusplus_dev/docs/documentation/best_practices.rest 2006-10-12 11:38:31 UTC (rev 659) @@ -23,7 +23,7 @@ few hundred of header files. `Py++`_ was born to create `Python`_ bindings for such projects. If you take a look `here`__ you will find few such projects. -.. __ : ./../../pygccxml/quotes.html +.. __ : ./../../pyplusplus/quotes.html Tips ---- Modified: pyplusplus_dev/docs/examples/examples.rest =================================================================== --- pyplusplus_dev/docs/examples/examples.rest 2006-10-12 09:57:05 UTC (rev 658) +++ pyplusplus_dev/docs/examples/examples.rest 2006-10-12 11:38:31 UTC (rev 659) @@ -12,8 +12,8 @@ `Py++`_ has nice, small and simple `graphical interface`_. Please, read `tutorials`_ for more information. -.. _`graphical interface` : ./../tutorials/pyplusplus_demo.png -.. _`tutorials` : ./../tutorials/tutorials.html +.. _`graphical interface` : ./../documentation/tutorials/pyplusplus_gui.html +.. _`tutorials` : ./../documentation/tutorials/tutorials.html --------- pyeasybmp Modified: pyplusplus_dev/docs/peps/peps_index.rest =================================================================== --- pyplusplus_dev/docs/peps/peps_index.rest 2006-10-12 09:57:05 UTC (rev 658) +++ pyplusplus_dev/docs/peps/peps_index.rest 2006-10-12 11:38:31 UTC (rev 659) @@ -49,7 +49,7 @@ 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 +.. __ : ./function_transformation.html ------------------------------------------ Domain Specific Language ( DSL ) challenge This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 09:57:14
|
Revision: 658 http://svn.sourceforge.net/pygccxml/?rev=658&view=rev Author: roman_yakovenko Date: 2006-10-12 02:57:05 -0700 (Thu, 12 Oct 2006) Log Message: ----------- small fix Modified Paths: -------------- pygccxml_dev/docs/example.py Modified: pygccxml_dev/docs/example.py =================================================================== --- pygccxml_dev/docs/example.py 2006-10-12 09:40:59 UTC (rev 657) +++ pygccxml_dev/docs/example.py 2006-10-12 09:57:05 UTC (rev 658) @@ -13,7 +13,7 @@ config = parser.config_t( gccxml_path='/home/roman/gccxml-build/bin/gccxml' ) #parsing source file -decls = parser.parse( ['core_class_hierarchy.hpp'], config ) +decls = parser.parse( ['example.hpp'], config ) global_ns = declarations.get_global_namespace( decls ) #printing all declarations found in file and its includes @@ -23,4 +23,4 @@ for class_ in global_ns.classes(): print class_.name print '\tbases: ', `[base.related_class.name for base in class_.bases]` - print '\tderived: ', `[derive.related_class.name for derive in class_.derived]` \ No newline at end of file + print '\tderived: ', `[derive.related_class.name for derive in class_.derived]` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 09:41:19
|
Revision: 657 http://svn.sourceforge.net/pygccxml/?rev=657&view=rev Author: roman_yakovenko Date: 2006-10-12 02:40:59 -0700 (Thu, 12 Oct 2006) Log Message: ----------- updating structure of pygccxml docs Modified Paths: -------------- pygccxml_dev/docs/pygccxml.rest Added Paths: ----------- pygccxml_dev/docs/example.hpp pygccxml_dev/docs/example.hpp.rest pygccxml_dev/docs/example.hpp.xml pygccxml_dev/docs/example.hpp.xml.rest pygccxml_dev/docs/example.py.rest Removed Paths: ------------- pygccxml_dev/docs/core_class_hierarchy.hpp pygccxml_dev/docs/core_class_hierarchy.hpp.xml Deleted: pygccxml_dev/docs/core_class_hierarchy.hpp =================================================================== --- pygccxml_dev/docs/core_class_hierarchy.hpp 2006-10-12 09:29:16 UTC (rev 656) +++ pygccxml_dev/docs/core_class_hierarchy.hpp 2006-10-12 09:40:59 UTC (rev 657) @@ -1,35 +0,0 @@ -// Copyright 2004 Roman Yakovenko. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef __core_class_hierarchy_hpp__ -#define __core_class_hierarchy_hpp__ - -//TODO("To add virtual inheritance case"); - -namespace core{ namespace class_hierarchy{ - -class base_t{ -public: - virtual ~base_t(){}; -}; - -class other_base_t{ -}; - -class derived_public_t : public base_t{ -}; - -class derived_protected_t : protected base_t{ -}; - -class derived_private_t : private base_t{ -}; - -class multi_derived_t : derived_private_t, protected base_t, private other_base_t{ -}; - -} } - -#endif//__core_class_hierarchy_hpp__ Deleted: pygccxml_dev/docs/core_class_hierarchy.hpp.xml =================================================================== --- pygccxml_dev/docs/core_class_hierarchy.hpp.xml 2006-10-12 09:29:16 UTC (rev 656) +++ pygccxml_dev/docs/core_class_hierarchy.hpp.xml 2006-10-12 09:40:59 UTC (rev 657) @@ -1,129 +0,0 @@ -<?xml version="1.0"?> -<GCC_XML> - <Namespace id="_1" name="::" members="_3 _4 _5 _6 _7 _8 _9 _10 _11 _12 _13 _14 _15 _16 _17 _18 _19 " mangled="_Z2::"/> - <Namespace id="_2" name="std" context="_1" members="" mangled="_Z3std"/> - <Variable id="_3" name="_ZTIN4core15class_hierarchy15multi_derived_tE" type="_20c" context="_1" location="f0:30" file="f0" line="30" extern="1" artificial="1"/> - <Variable id="_4" name="_ZTIN4core15class_hierarchy17derived_private_tE" type="_22c" context="_1" location="f0:27" file="f0" line="27" extern="1" artificial="1"/> - <Variable id="_5" name="_ZTIN4core15class_hierarchy19derived_protected_tE" type="_22c" context="_1" location="f0:24" file="f0" line="24" extern="1" artificial="1"/> - <Variable id="_6" name="_ZTIN4core15class_hierarchy16derived_public_tE" type="_24c" context="_1" location="f0:21" file="f0" line="21" extern="1" artificial="1"/> - <Variable id="_7" name="_ZTIN4core15class_hierarchy6base_tE" type="_26c" context="_1" location="f0:13" file="f0" line="13" extern="1" artificial="1"/> - <Function id="_8" name="__builtin_expect" returns="_28" context="_1" location="f1:15" file="f1" line="15" extern="1"> - <Argument type="_28"/> - <Argument type="_28"/> - </Function> - <Function id="_9" name="__builtin_prefetch" returns="_29" context="_1" location="f1:16" file="f1" line="16" extern="1"> - <Argument type="_30"/> - <Ellipsis/> - </Function> - <Function id="_10" name="__builtin_return" returns="_29" context="_1" location="f1:12" file="f1" line="12" extern="1" attributes="nothrow noreturn"> - <Argument type="_31"/> - </Function> - <Function id="_11" name="__builtin_return_address" returns="_31" context="_1" location="f1:13" file="f1" line="13" extern="1"> - <Argument type="_32"/> - </Function> - <Function id="_12" name="__builtin_frame_address" returns="_31" context="_1" location="f1:14" file="f1" line="14" extern="1"> - <Argument type="_32"/> - </Function> - <Function id="_13" name="__builtin_nansl" returns="_33" context="_1" mangled="nansl" location="f1:22" file="f1" line="22" extern="1" attributes="nothrow const"> - <Argument type="_34"/> - </Function> - <Function id="_14" name="__builtin_nansf" returns="_35" context="_1" mangled="nansf" location="f1:21" file="f1" line="21" extern="1" attributes="nothrow const"> - <Argument type="_34"/> - </Function> - <Function id="_15" name="__builtin_nans" returns="_36" context="_1" mangled="nans" location="f1:20" file="f1" line="20" extern="1" attributes="nothrow const"> - <Argument type="_34"/> - </Function> - <Function id="_16" name="__builtin_infl" returns="_33" context="_1" location="f1:19" file="f1" line="19" extern="1" attributes="nothrow const"/> - <Function id="_17" name="__builtin_inff" returns="_35" context="_1" location="f1:18" file="f1" line="18" extern="1" attributes="nothrow const"/> - <Function id="_18" name="__builtin_inf" returns="_36" context="_1" location="f1:17" file="f1" line="17" extern="1" attributes="nothrow const"/> - <Namespace id="_19" name="core" context="_1" members="_37 " mangled="_Z4core"/> - <Struct id="_20" name="__vmi_class_type_info_pseudo3" context="_1" mangled="29__vmi_class_type_info_pseudo3" location="f0:30" file="f0" line="30" members="_38 _39 _40 _41 " bases=""/> - <CvQualifiedType id="_20c" type="_20" const="1"/> - <Struct id="_22" name="__vmi_class_type_info_pseudo1" context="_1" mangled="29__vmi_class_type_info_pseudo1" location="f0:24" file="f0" line="24" members="_42 _43 _44 _45 " bases=""/> - <CvQualifiedType id="_22c" type="_22" const="1"/> - <Struct id="_24" name="__si_class_type_info_pseudo" context="_1" mangled="27__si_class_type_info_pseudo" location="f2:0" file="f2" line="0" members="" bases=""/> - <CvQualifiedType id="_24c" type="_24" const="1"/> - <Struct id="_26" name="__class_type_info_pseudo" context="_1" mangled="24__class_type_info_pseudo" location="f2:0" file="f2" line="0" members="" bases=""/> - <CvQualifiedType id="_26c" type="_26" const="1"/> - <FundamentalType id="_28" name="long int"/> - <FundamentalType id="_29" name="void"/> - <PointerType id="_30" type="_29c"/> - <PointerType id="_31" type="_29"/> - <FundamentalType id="_32" name="unsigned int"/> - <FundamentalType id="_33" name="long double"/> - <PointerType id="_34" type="_47c"/> - <FundamentalType id="_35" name="float"/> - <FundamentalType id="_36" name="double"/> - <Namespace id="_37" name="class_hierarchy" context="_19" members="_49 _50 _51 _52 _53 _54 " mangled="_ZN4core15class_hierarchyE"/> - <Field id="_38" name="" type="_55" context="_20" location="f0:30" file="f0" line="30"/> - <Field id="_39" name="" type="_56" context="_20" location="f0:30" file="f0" line="30"/> - <Field id="_40" name="" type="_56" context="_20" location="f0:30" file="f0" line="30"/> - <Field id="_41" name="" type="_57" context="_20" location="f0:30" file="f0" line="30"/> - <Field id="_42" name="" type="_55" context="_22" location="f0:24" file="f0" line="24"/> - <Field id="_43" name="" type="_56" context="_22" location="f0:24" file="f0" line="24"/> - <Field id="_44" name="" type="_56" context="_22" location="f0:24" file="f0" line="24"/> - <Field id="_45" name="" type="_58" context="_22" location="f0:24" file="f0" line="24"/> - <Class id="_49" name="multi_derived_t" context="_37" mangled="N4core15class_hierarchy15multi_derived_tE" location="f0:30" file="f0" line="30" members="_59 _60 _61 " bases="private:_50 protected:_54 private:_53 "/> - <Class id="_50" name="derived_private_t" context="_37" mangled="N4core15class_hierarchy17derived_private_tE" location="f0:27" file="f0" line="27" members="_62 _63 _64 " bases="private:_54 "/> - <Class id="_51" name="derived_protected_t" context="_37" mangled="N4core15class_hierarchy19derived_protected_tE" location="f0:24" file="f0" line="24" members="_65 _66 _67 " bases="protected:_54 "/> - <Class id="_52" name="derived_public_t" context="_37" mangled="N4core15class_hierarchy16derived_public_tE" location="f0:21" file="f0" line="21" members="_68 _69 _70 " bases="_54 "/> - <Class id="_53" name="other_base_t" context="_37" mangled="N4core15class_hierarchy12other_base_tE" location="f0:18" file="f0" line="18" members="_71 _72 " bases=""/> - <Class id="_54" name="base_t" context="_37" mangled="N4core15class_hierarchy6base_tE" location="f0:13" file="f0" line="13" members="_73 _74 _75 " bases=""/> - <Struct id="_55" name="__type_info_pseudo" context="_1" mangled="18__type_info_pseudo" location="f2:0" file="f2" line="0" members="" bases=""/> - <FundamentalType id="_56" name="int"/> - <ArrayType id="_57" min="0" max="3" type="_76"/> - <ArrayType id="_58" min="0" max="1" type="_76"/> - <Constructor id="_59" name="multi_derived_t" artificial="1" throw="" context="_49" mangled="_ZN4core15class_hierarchy15multi_derived_tC1ERKS1_ *INTERNAL* " location="f0:30" file="f0" line="30"> - <Argument name="_ctor_arg" type="_77"/> - </Constructor> - <Constructor id="_60" name="multi_derived_t" artificial="1" throw="" context="_49" mangled="_ZN4core15class_hierarchy15multi_derived_tC1Ev *INTERNAL* " location="f0:30" file="f0" line="30"/> - <Destructor id="_61" name="multi_derived_t" virtual="1" artificial="1" context="_49" mangled="_ZN4core15class_hierarchy15multi_derived_tD1Ev *INTERNAL* " location="f0:30" file="f0" line="30"> - </Destructor> - <Constructor id="_62" name="derived_private_t" artificial="1" throw="" context="_50" mangled="_ZN4core15class_hierarchy17derived_private_tC1ERKS1_ *INTERNAL* " location="f0:27" file="f0" line="27"> - <Argument name="_ctor_arg" type="_78"/> - </Constructor> - <Constructor id="_63" name="derived_private_t" artificial="1" throw="" context="_50" mangled="_ZN4core15class_hierarchy17derived_private_tC1Ev *INTERNAL* " location="f0:27" file="f0" line="27"/> - <Destructor id="_64" name="derived_private_t" virtual="1" artificial="1" context="_50" mangled="_ZN4core15class_hierarchy17derived_private_tD1Ev *INTERNAL* " location="f0:27" file="f0" line="27"> - </Destructor> - <Constructor id="_65" name="derived_protected_t" artificial="1" throw="" context="_51" mangled="_ZN4core15class_hierarchy19derived_protected_tC1ERKS1_ *INTERNAL* " location="f0:24" file="f0" line="24"> - <Argument name="_ctor_arg" type="_79"/> - </Constructor> - <Constructor id="_66" name="derived_protected_t" artificial="1" throw="" context="_51" mangled="_ZN4core15class_hierarchy19derived_protected_tC1Ev *INTERNAL* " location="f0:24" file="f0" line="24"/> - <Destructor id="_67" name="derived_protected_t" virtual="1" artificial="1" context="_51" mangled="_ZN4core15class_hierarchy19derived_protected_tD1Ev *INTERNAL* " location="f0:24" file="f0" line="24"> - </Destructor> - <Constructor id="_68" name="derived_public_t" artificial="1" throw="" context="_52" mangled="_ZN4core15class_hierarchy16derived_public_tC1ERKS1_ *INTERNAL* " location="f0:21" file="f0" line="21"> - <Argument name="_ctor_arg" type="_80"/> - </Constructor> - <Constructor id="_69" name="derived_public_t" artificial="1" throw="" context="_52" mangled="_ZN4core15class_hierarchy16derived_public_tC1Ev *INTERNAL* " location="f0:21" file="f0" line="21"/> - <Destructor id="_70" name="derived_public_t" virtual="1" artificial="1" context="_52" mangled="_ZN4core15class_hierarchy16derived_public_tD1Ev *INTERNAL* " location="f0:21" file="f0" line="21"> - </Destructor> - <Constructor id="_71" name="other_base_t" artificial="1" throw="" context="_53" mangled="_ZN4core15class_hierarchy12other_base_tC1ERKS1_ *INTERNAL* " location="f0:18" file="f0" line="18"> - <Argument name="_ctor_arg" type="_81"/> - </Constructor> - <Constructor id="_72" name="other_base_t" artificial="1" throw="" context="_53" mangled="_ZN4core15class_hierarchy12other_base_tC1Ev *INTERNAL* " location="f0:18" file="f0" line="18"/> - <Constructor id="_73" name="base_t" artificial="1" throw="" context="_54" mangled="_ZN4core15class_hierarchy6base_tC1ERKS1_ *INTERNAL* " location="f0:13" file="f0" line="13"> - <Argument name="_ctor_arg" type="_82"/> - </Constructor> - <Constructor id="_74" name="base_t" artificial="1" throw="" context="_54" mangled="_ZN4core15class_hierarchy6base_tC1Ev *INTERNAL* " location="f0:13" file="f0" line="13"/> - <Destructor id="_75" name="base_t" virtual="1" context="_54" mangled="_ZN4core15class_hierarchy6base_tD1Ev *INTERNAL* " location="f0:15" file="f0" line="15" endline="15"> - </Destructor> - <Struct id="_76" name="__base_class_type_info_pseudo" context="_1" mangled="29__base_class_type_info_pseudo" location="f2:0" file="f2" line="0" members="" bases=""/> - <ReferenceType id="_77" type="_49c"/> - <ReferenceType id="_78" type="_50c"/> - <ReferenceType id="_79" type="_51c"/> - <ReferenceType id="_80" type="_52c"/> - <ReferenceType id="_81" type="_53c"/> - <ReferenceType id="_82" type="_54c"/> - <FundamentalType id="_47" name="char"/> - <CvQualifiedType id="_47c" type="_47" const="1"/> - <CvQualifiedType id="_29c" type="_29" const="1"/> - <CvQualifiedType id="_54c" type="_54" const="1"/> - <CvQualifiedType id="_53c" type="_53" const="1"/> - <CvQualifiedType id="_52c" type="_52" const="1"/> - <CvQualifiedType id="_51c" type="_51" const="1"/> - <CvQualifiedType id="_50c" type="_50" const="1"/> - <CvQualifiedType id="_49c" type="_49" const="1"/> - <File id="f0" name="core_class_hierarchy.hpp"/> - <File id="f1" name="/usr/local/share/gccxml-0.6/GCC/3.3/gccxml_builtins.h"/> - <File id="f2" name="<internal>"/> -</GCC_XML> Copied: pygccxml_dev/docs/example.hpp (from rev 656, pygccxml_dev/docs/core_class_hierarchy.hpp) =================================================================== --- pygccxml_dev/docs/example.hpp (rev 0) +++ pygccxml_dev/docs/example.hpp 2006-10-12 09:40:59 UTC (rev 657) @@ -0,0 +1,34 @@ +// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef example_hpp_12_10_2006 +#define example_hpp_12_10_2006 + + +namespace core{ namespace class_hierarchy{ + +class base_t{ +public: + virtual ~base_t(){}; +}; + +class other_base_t{ +}; + +class derived_public_t : public base_t{ +}; + +class derived_protected_t : protected base_t{ +}; + +class derived_private_t : private base_t{ +}; + +class multi_derived_t : derived_private_t, protected base_t, private other_base_t{ +}; + +} } + +#endif//example_hpp_12_10_2006 Added: pygccxml_dev/docs/example.hpp.rest =================================================================== --- pygccxml_dev/docs/example.hpp.rest (rev 0) +++ pygccxml_dev/docs/example.hpp.rest 2006-10-12 09:40:59 UTC (rev 657) @@ -0,0 +1,3 @@ +.. code-block:: + :language: C++ + :source-file: ./example.hpp Copied: pygccxml_dev/docs/example.hpp.xml (from rev 656, pygccxml_dev/docs/core_class_hierarchy.hpp.xml) =================================================================== --- pygccxml_dev/docs/example.hpp.xml (rev 0) +++ pygccxml_dev/docs/example.hpp.xml 2006-10-12 09:40:59 UTC (rev 657) @@ -0,0 +1,97 @@ +<?xml version="1.0"?> +<GCC_XML cvs_revision="1.112"> + <Namespace id="_1" name="::" members="_3 _4 _5 _6 _7 _8 " mangled="_Z2::" demangled="::"/> + <Namespace id="_2" name="std" context="_1" members="" mangled="_Z3std" demangled="std"/> + <Variable id="_3" name="_ZTIN4core15class_hierarchy15multi_derived_tE" type="_9c" context="_1" location="f0:30" file="f0" line="30" extern="1" artificial="1"/> + <Variable id="_4" name="_ZTIN4core15class_hierarchy17derived_private_tE" type="_11c" context="_1" location="f0:27" file="f0" line="27" extern="1" artificial="1"/> + <Variable id="_5" name="_ZTIN4core15class_hierarchy19derived_protected_tE" type="_11c" context="_1" location="f0:24" file="f0" line="24" extern="1" artificial="1"/> + <Variable id="_6" name="_ZTIN4core15class_hierarchy16derived_public_tE" type="_13c" context="_1" location="f0:21" file="f0" line="21" extern="1" artificial="1"/> + <Variable id="_7" name="_ZTIN4core15class_hierarchy6base_tE" type="_15c" context="_1" location="f0:13" file="f0" line="13" extern="1" artificial="1"/> + <Namespace id="_8" name="core" context="_1" members="_17 " mangled="_Z4core" demangled="core"/> + <Struct id="_9" name="__vmi_class_type_info_pseudo3" context="_1" mangled="29__vmi_class_type_info_pseudo3" demangled="__vmi_class_type_info_pseudo3" location="f0:30" file="f0" line="30" size="384" align="32" members="_18 _19 _20 _21 " bases=""/> + <CvQualifiedType id="_9c" type="_9" const="1"/> + <Struct id="_11" name="__vmi_class_type_info_pseudo1" context="_1" mangled="29__vmi_class_type_info_pseudo1" demangled="__vmi_class_type_info_pseudo1" location="f0:24" file="f0" line="24" size="256" align="32" members="_22 _23 _24 _25 " bases=""/> + <CvQualifiedType id="_11c" type="_11" const="1"/> + <Struct id="_13" name="__si_class_type_info_pseudo" context="_1" mangled="27__si_class_type_info_pseudo" demangled="__si_class_type_info_pseudo" location="f1:0" file="f1" line="0" size="96" align="32" members="" bases=""/> + <CvQualifiedType id="_13c" type="_13" const="1"/> + <Struct id="_15" name="__class_type_info_pseudo" context="_1" mangled="24__class_type_info_pseudo" demangled="__class_type_info_pseudo" location="f1:0" file="f1" line="0" size="64" align="32" members="" bases=""/> + <CvQualifiedType id="_15c" type="_15" const="1"/> + <Namespace id="_17" name="class_hierarchy" context="_8" members="_26 _27 _28 _29 _30 _31 " mangled="_ZN4core15class_hierarchyE" demangled="core::class_hierarchy"/> + <Field id="_18" name="" type="_32" offset="0" context="_9" access="public" location="f0:30" file="f0" line="30"/> + <Field id="_19" name="" type="_33" offset="64" context="_9" access="public" location="f0:30" file="f0" line="30"/> + <Field id="_20" name="" type="_33" offset="96" context="_9" access="public" location="f0:30" file="f0" line="30"/> + <Field id="_21" name="" type="_34" offset="128" context="_9" access="public" location="f0:30" file="f0" line="30"/> + <Field id="_22" name="" type="_32" offset="0" context="_11" access="public" location="f0:24" file="f0" line="24"/> + <Field id="_23" name="" type="_33" offset="64" context="_11" access="public" location="f0:24" file="f0" line="24"/> + <Field id="_24" name="" type="_33" offset="96" context="_11" access="public" location="f0:24" file="f0" line="24"/> + <Field id="_25" name="" type="_35" offset="128" context="_11" access="public" location="f0:24" file="f0" line="24"/> + <Class id="_26" name="multi_derived_t" context="_17" mangled="N4core15class_hierarchy15multi_derived_tE" demangled="core::class_hierarchy::multi_derived_t" location="f0:30" file="f0" line="30" artificial="1" size="64" align="32" members="_36 _37 _38 " bases="private:_27 protected:_31 private:_30 "> + <Base type="_27" access="private" virtual="0" offset="0"/> + <Base type="_31" access="protected" virtual="0" offset="4"/> + <Base type="_30" access="private" virtual="0" offset="0"/> + </Class> + <Class id="_27" name="derived_private_t" context="_17" mangled="N4core15class_hierarchy17derived_private_tE" demangled="core::class_hierarchy::derived_private_t" location="f0:27" file="f0" line="27" artificial="1" size="32" align="32" members="_39 _40 _41 " bases="private:_31 "> + <Base type="_31" access="private" virtual="0" offset="0"/> + </Class> + <Class id="_28" name="derived_protected_t" context="_17" mangled="N4core15class_hierarchy19derived_protected_tE" demangled="core::class_hierarchy::derived_protected_t" location="f0:24" file="f0" line="24" artificial="1" size="32" align="32" members="_42 _43 _44 " bases="protected:_31 "> + <Base type="_31" access="protected" virtual="0" offset="0"/> + </Class> + <Class id="_29" name="derived_public_t" context="_17" mangled="N4core15class_hierarchy16derived_public_tE" demangled="core::class_hierarchy::derived_public_t" location="f0:21" file="f0" line="21" artificial="1" size="32" align="32" members="_45 _46 _47 " bases="_31 "> + <Base type="_31" access="public" virtual="0" offset="0"/> + </Class> + <Class id="_30" name="other_base_t" context="_17" mangled="N4core15class_hierarchy12other_base_tE" demangled="core::class_hierarchy::other_base_t" location="f0:18" file="f0" line="18" artificial="1" size="8" align="8" members="_48 _49 " bases=""/> + <Class id="_31" name="base_t" context="_17" mangled="N4core15class_hierarchy6base_tE" demangled="core::class_hierarchy::base_t" location="f0:13" file="f0" line="13" artificial="1" size="32" align="32" members="_50 _51 _52 " bases=""/> + <Struct id="_32" name="__type_info_pseudo" context="_1" mangled="18__type_info_pseudo" demangled="__type_info_pseudo" location="f1:0" file="f1" line="0" size="64" align="32" members="" bases=""/> + <FundamentalType id="_33" name="int" size="32" align="32"/> + <ArrayType id="_34" min="0" max="3" type="_53" size="256" align="32"/> + <ArrayType id="_35" min="0" max="1" type="_53" size="128" align="32"/> + <Constructor id="_36" name="multi_derived_t" artificial="1" throw="" context="_26" access="public" mangled="_ZN4core15class_hierarchy15multi_derived_tC1ERKS1_ *INTERNAL* " demangled="core::class_hierarchy::multi_derived_t::multi_derived_t(core::class_hierarchy::multi_derived_t const&)" location="f0:30" file="f0" line="30" inline="1"> + <Argument name="_ctor_arg" type="_54" location="f0:30" file="f0" line="30"/> + </Constructor> + <Constructor id="_37" name="multi_derived_t" explicit="1" artificial="1" throw="" context="_26" access="public" mangled="_ZN4core15class_hierarchy15multi_derived_tC1Ev *INTERNAL* " demangled="core::class_hierarchy::multi_derived_t::multi_derived_t()" location="f0:30" file="f0" line="30" inline="1"/> + <Destructor id="_38" name="multi_derived_t" virtual="1" artificial="1" context="_26" access="public" mangled="_ZN4core15class_hierarchy15multi_derived_tD1Ev *INTERNAL* " demangled="core::class_hierarchy::multi_derived_t::~multi_derived_t()" location="f0:30" file="f0" line="30" inline="1"> + </Destructor> + <Constructor id="_39" name="derived_private_t" artificial="1" throw="" context="_27" access="public" mangled="_ZN4core15class_hierarchy17derived_private_tC1ERKS1_ *INTERNAL* " demangled="core::class_hierarchy::derived_private_t::derived_private_t(core::class_hierarchy::derived_private_t const&)" location="f0:27" file="f0" line="27" inline="1"> + <Argument name="_ctor_arg" type="_55" location="f0:27" file="f0" line="27"/> + </Constructor> + <Constructor id="_40" name="derived_private_t" explicit="1" artificial="1" throw="" context="_27" access="public" mangled="_ZN4core15class_hierarchy17derived_private_tC1Ev *INTERNAL* " demangled="core::class_hierarchy::derived_private_t::derived_private_t()" location="f0:27" file="f0" line="27" inline="1"/> + <Destructor id="_41" name="derived_private_t" virtual="1" artificial="1" context="_27" access="public" mangled="_ZN4core15class_hierarchy17derived_private_tD1Ev *INTERNAL* " demangled="core::class_hierarchy::derived_private_t::~derived_private_t()" location="f0:27" file="f0" line="27" inline="1"> + </Destructor> + <Constructor id="_42" name="derived_protected_t" artificial="1" throw="" context="_28" access="public" mangled="_ZN4core15class_hierarchy19derived_protected_tC1ERKS1_ *INTERNAL* " demangled="core::class_hierarchy::derived_protected_t::derived_protected_t(core::class_hierarchy::derived_protected_t const&)" location="f0:24" file="f0" line="24" inline="1"> + <Argument name="_ctor_arg" type="_56" location="f0:24" file="f0" line="24"/> + </Constructor> + <Constructor id="_43" name="derived_protected_t" explicit="1" artificial="1" throw="" context="_28" access="public" mangled="_ZN4core15class_hierarchy19derived_protected_tC1Ev *INTERNAL* " demangled="core::class_hierarchy::derived_protected_t::derived_protected_t()" location="f0:24" file="f0" line="24" inline="1"/> + <Destructor id="_44" name="derived_protected_t" virtual="1" artificial="1" context="_28" access="public" mangled="_ZN4core15class_hierarchy19derived_protected_tD1Ev *INTERNAL* " demangled="core::class_hierarchy::derived_protected_t::~derived_protected_t()" location="f0:24" file="f0" line="24" inline="1"> + </Destructor> + <Constructor id="_45" name="derived_public_t" artificial="1" throw="" context="_29" access="public" mangled="_ZN4core15class_hierarchy16derived_public_tC1ERKS1_ *INTERNAL* " demangled="core::class_hierarchy::derived_public_t::derived_public_t(core::class_hierarchy::derived_public_t const&)" location="f0:21" file="f0" line="21" inline="1"> + <Argument name="_ctor_arg" type="_57" location="f0:21" file="f0" line="21"/> + </Constructor> + <Constructor id="_46" name="derived_public_t" explicit="1" artificial="1" throw="" context="_29" access="public" mangled="_ZN4core15class_hierarchy16derived_public_tC1Ev *INTERNAL* " demangled="core::class_hierarchy::derived_public_t::derived_public_t()" location="f0:21" file="f0" line="21" inline="1"/> + <Destructor id="_47" name="derived_public_t" virtual="1" artificial="1" context="_29" access="public" mangled="_ZN4core15class_hierarchy16derived_public_tD1Ev *INTERNAL* " demangled="core::class_hierarchy::derived_public_t::~derived_public_t()" location="f0:21" file="f0" line="21" inline="1"> + </Destructor> + <Constructor id="_48" name="other_base_t" artificial="1" throw="" context="_30" access="public" mangled="_ZN4core15class_hierarchy12other_base_tC1ERKS1_ *INTERNAL* " demangled="core::class_hierarchy::other_base_t::other_base_t(core::class_hierarchy::other_base_t const&)" location="f0:18" file="f0" line="18" inline="1"> + <Argument name="_ctor_arg" type="_58" location="f0:18" file="f0" line="18"/> + </Constructor> + <Constructor id="_49" name="other_base_t" explicit="1" artificial="1" throw="" context="_30" access="public" mangled="_ZN4core15class_hierarchy12other_base_tC1Ev *INTERNAL* " demangled="core::class_hierarchy::other_base_t::other_base_t()" location="f0:18" file="f0" line="18" inline="1"/> + <Constructor id="_50" name="base_t" artificial="1" throw="" context="_31" access="public" mangled="_ZN4core15class_hierarchy6base_tC1ERKS1_ *INTERNAL* " demangled="core::class_hierarchy::base_t::base_t(core::class_hierarchy::base_t const&)" location="f0:13" file="f0" line="13" inline="1"> + <Argument name="_ctor_arg" type="_59" location="f0:13" file="f0" line="13"/> + </Constructor> + <Constructor id="_51" name="base_t" explicit="1" artificial="1" throw="" context="_31" access="public" mangled="_ZN4core15class_hierarchy6base_tC1Ev *INTERNAL* " demangled="core::class_hierarchy::base_t::base_t()" location="f0:13" file="f0" line="13" inline="1"/> + <Destructor id="_52" name="base_t" virtual="1" context="_31" access="public" mangled="_ZN4core15class_hierarchy6base_tD1Ev *INTERNAL* " demangled="core::class_hierarchy::base_t::~base_t()" location="f0:15" file="f0" line="15" endline="15" inline="1"> + </Destructor> + <Struct id="_53" name="__base_class_type_info_pseudo" context="_1" mangled="29__base_class_type_info_pseudo" demangled="__base_class_type_info_pseudo" location="f1:0" file="f1" line="0" size="64" align="32" members="" bases=""/> + <ReferenceType id="_54" type="_26c" size="32" align="32"/> + <ReferenceType id="_55" type="_27c" size="32" align="32"/> + <ReferenceType id="_56" type="_28c" size="32" align="32"/> + <ReferenceType id="_57" type="_29c" size="32" align="32"/> + <ReferenceType id="_58" type="_30c" size="32" align="32"/> + <ReferenceType id="_59" type="_31c" size="32" align="32"/> + <CvQualifiedType id="_31c" type="_31" const="1"/> + <CvQualifiedType id="_30c" type="_30" const="1"/> + <CvQualifiedType id="_29c" type="_29" const="1"/> + <CvQualifiedType id="_28c" type="_28" const="1"/> + <CvQualifiedType id="_27c" type="_27" const="1"/> + <CvQualifiedType id="_26c" type="_26" const="1"/> + <File id="f0" name="D:/pygccxml_sources/sources/pygccxml_dev/docs/example.hpp"/> + <File id="f1" name="<internal>"/> +</GCC_XML> Added: pygccxml_dev/docs/example.hpp.xml.rest =================================================================== --- pygccxml_dev/docs/example.hpp.xml.rest (rev 0) +++ pygccxml_dev/docs/example.hpp.xml.rest 2006-10-12 09:40:59 UTC (rev 657) @@ -0,0 +1,3 @@ +.. code-block:: + :language: XML + :source-file: ./example.hpp.xml Added: pygccxml_dev/docs/example.py.rest =================================================================== --- pygccxml_dev/docs/example.py.rest (rev 0) +++ pygccxml_dev/docs/example.py.rest 2006-10-12 09:40:59 UTC (rev 657) @@ -0,0 +1,3 @@ +.. code-block:: + :language: Python + :source-file: ./example.py Modified: pygccxml_dev/docs/pygccxml.rest =================================================================== --- pygccxml_dev/docs/pygccxml.rest 2006-10-12 09:29:16 UTC (rev 656) +++ pygccxml_dev/docs/pygccxml.rest 2006-10-12 09:40:59 UTC (rev 657) @@ -36,14 +36,14 @@ Usage example ------------- First of all let's see a small and simple `example`_. This example prints all -declarations, reported by `GCC-XML`_ after parsing `core_class_hierarchy.hpp`_ -file. Also it prints all classes, and for every class it will print it's base -and derived classes. It was simple task, right? If you are still curious how it -looks "in the real life", I mean how xml file is look like, you may look at the +declarations, reported by `GCC-XML`_ after parsing `example.hpp`_ file. Also it +prints all classes, and for every class it will print it's base and derived +classes. It was simple task, right? If you are still curious how it looks +"in the real life", I mean how xml file is look like, you may look at the `original XML file`_ generated by `GCC-XML`_. -.. _`original XML file` : ./core_class_hierarchy.hpp.xml.html -.. _`core_class_hierarchy.hpp` : ./core_class_hierarchy.hpp.html +.. _`original XML file` : ./example.hpp.xml.html +.. _`example.hpp` : ./example.hpp.html .. _`example` : ./example.py.html -------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 09:29:32
|
Revision: 656 http://svn.sourceforge.net/pygccxml/?rev=656&view=rev Author: roman_yakovenko Date: 2006-10-12 02:29:16 -0700 (Thu, 12 Oct 2006) Log Message: ----------- updating structure of pygccxml docs Modified Paths: -------------- pygccxml_dev/docs/pygccxml.rest Added Paths: ----------- pygccxml_dev/docs/core_class_hierarchy.hpp pygccxml_dev/docs/core_class_hierarchy.hpp.xml pygccxml_dev/docs/example.py Removed Paths: ------------- pygccxml_dev/docs/example/ Copied: pygccxml_dev/docs/core_class_hierarchy.hpp (from rev 646, pygccxml_dev/docs/example/core_class_hierarchy.hpp) =================================================================== --- pygccxml_dev/docs/core_class_hierarchy.hpp (rev 0) +++ pygccxml_dev/docs/core_class_hierarchy.hpp 2006-10-12 09:29:16 UTC (rev 656) @@ -0,0 +1,35 @@ +// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __core_class_hierarchy_hpp__ +#define __core_class_hierarchy_hpp__ + +//TODO("To add virtual inheritance case"); + +namespace core{ namespace class_hierarchy{ + +class base_t{ +public: + virtual ~base_t(){}; +}; + +class other_base_t{ +}; + +class derived_public_t : public base_t{ +}; + +class derived_protected_t : protected base_t{ +}; + +class derived_private_t : private base_t{ +}; + +class multi_derived_t : derived_private_t, protected base_t, private other_base_t{ +}; + +} } + +#endif//__core_class_hierarchy_hpp__ Copied: pygccxml_dev/docs/core_class_hierarchy.hpp.xml (from rev 646, pygccxml_dev/docs/example/core_class_hierarchy.hpp.xml) =================================================================== --- pygccxml_dev/docs/core_class_hierarchy.hpp.xml (rev 0) +++ pygccxml_dev/docs/core_class_hierarchy.hpp.xml 2006-10-12 09:29:16 UTC (rev 656) @@ -0,0 +1,129 @@ +<?xml version="1.0"?> +<GCC_XML> + <Namespace id="_1" name="::" members="_3 _4 _5 _6 _7 _8 _9 _10 _11 _12 _13 _14 _15 _16 _17 _18 _19 " mangled="_Z2::"/> + <Namespace id="_2" name="std" context="_1" members="" mangled="_Z3std"/> + <Variable id="_3" name="_ZTIN4core15class_hierarchy15multi_derived_tE" type="_20c" context="_1" location="f0:30" file="f0" line="30" extern="1" artificial="1"/> + <Variable id="_4" name="_ZTIN4core15class_hierarchy17derived_private_tE" type="_22c" context="_1" location="f0:27" file="f0" line="27" extern="1" artificial="1"/> + <Variable id="_5" name="_ZTIN4core15class_hierarchy19derived_protected_tE" type="_22c" context="_1" location="f0:24" file="f0" line="24" extern="1" artificial="1"/> + <Variable id="_6" name="_ZTIN4core15class_hierarchy16derived_public_tE" type="_24c" context="_1" location="f0:21" file="f0" line="21" extern="1" artificial="1"/> + <Variable id="_7" name="_ZTIN4core15class_hierarchy6base_tE" type="_26c" context="_1" location="f0:13" file="f0" line="13" extern="1" artificial="1"/> + <Function id="_8" name="__builtin_expect" returns="_28" context="_1" location="f1:15" file="f1" line="15" extern="1"> + <Argument type="_28"/> + <Argument type="_28"/> + </Function> + <Function id="_9" name="__builtin_prefetch" returns="_29" context="_1" location="f1:16" file="f1" line="16" extern="1"> + <Argument type="_30"/> + <Ellipsis/> + </Function> + <Function id="_10" name="__builtin_return" returns="_29" context="_1" location="f1:12" file="f1" line="12" extern="1" attributes="nothrow noreturn"> + <Argument type="_31"/> + </Function> + <Function id="_11" name="__builtin_return_address" returns="_31" context="_1" location="f1:13" file="f1" line="13" extern="1"> + <Argument type="_32"/> + </Function> + <Function id="_12" name="__builtin_frame_address" returns="_31" context="_1" location="f1:14" file="f1" line="14" extern="1"> + <Argument type="_32"/> + </Function> + <Function id="_13" name="__builtin_nansl" returns="_33" context="_1" mangled="nansl" location="f1:22" file="f1" line="22" extern="1" attributes="nothrow const"> + <Argument type="_34"/> + </Function> + <Function id="_14" name="__builtin_nansf" returns="_35" context="_1" mangled="nansf" location="f1:21" file="f1" line="21" extern="1" attributes="nothrow const"> + <Argument type="_34"/> + </Function> + <Function id="_15" name="__builtin_nans" returns="_36" context="_1" mangled="nans" location="f1:20" file="f1" line="20" extern="1" attributes="nothrow const"> + <Argument type="_34"/> + </Function> + <Function id="_16" name="__builtin_infl" returns="_33" context="_1" location="f1:19" file="f1" line="19" extern="1" attributes="nothrow const"/> + <Function id="_17" name="__builtin_inff" returns="_35" context="_1" location="f1:18" file="f1" line="18" extern="1" attributes="nothrow const"/> + <Function id="_18" name="__builtin_inf" returns="_36" context="_1" location="f1:17" file="f1" line="17" extern="1" attributes="nothrow const"/> + <Namespace id="_19" name="core" context="_1" members="_37 " mangled="_Z4core"/> + <Struct id="_20" name="__vmi_class_type_info_pseudo3" context="_1" mangled="29__vmi_class_type_info_pseudo3" location="f0:30" file="f0" line="30" members="_38 _39 _40 _41 " bases=""/> + <CvQualifiedType id="_20c" type="_20" const="1"/> + <Struct id="_22" name="__vmi_class_type_info_pseudo1" context="_1" mangled="29__vmi_class_type_info_pseudo1" location="f0:24" file="f0" line="24" members="_42 _43 _44 _45 " bases=""/> + <CvQualifiedType id="_22c" type="_22" const="1"/> + <Struct id="_24" name="__si_class_type_info_pseudo" context="_1" mangled="27__si_class_type_info_pseudo" location="f2:0" file="f2" line="0" members="" bases=""/> + <CvQualifiedType id="_24c" type="_24" const="1"/> + <Struct id="_26" name="__class_type_info_pseudo" context="_1" mangled="24__class_type_info_pseudo" location="f2:0" file="f2" line="0" members="" bases=""/> + <CvQualifiedType id="_26c" type="_26" const="1"/> + <FundamentalType id="_28" name="long int"/> + <FundamentalType id="_29" name="void"/> + <PointerType id="_30" type="_29c"/> + <PointerType id="_31" type="_29"/> + <FundamentalType id="_32" name="unsigned int"/> + <FundamentalType id="_33" name="long double"/> + <PointerType id="_34" type="_47c"/> + <FundamentalType id="_35" name="float"/> + <FundamentalType id="_36" name="double"/> + <Namespace id="_37" name="class_hierarchy" context="_19" members="_49 _50 _51 _52 _53 _54 " mangled="_ZN4core15class_hierarchyE"/> + <Field id="_38" name="" type="_55" context="_20" location="f0:30" file="f0" line="30"/> + <Field id="_39" name="" type="_56" context="_20" location="f0:30" file="f0" line="30"/> + <Field id="_40" name="" type="_56" context="_20" location="f0:30" file="f0" line="30"/> + <Field id="_41" name="" type="_57" context="_20" location="f0:30" file="f0" line="30"/> + <Field id="_42" name="" type="_55" context="_22" location="f0:24" file="f0" line="24"/> + <Field id="_43" name="" type="_56" context="_22" location="f0:24" file="f0" line="24"/> + <Field id="_44" name="" type="_56" context="_22" location="f0:24" file="f0" line="24"/> + <Field id="_45" name="" type="_58" context="_22" location="f0:24" file="f0" line="24"/> + <Class id="_49" name="multi_derived_t" context="_37" mangled="N4core15class_hierarchy15multi_derived_tE" location="f0:30" file="f0" line="30" members="_59 _60 _61 " bases="private:_50 protected:_54 private:_53 "/> + <Class id="_50" name="derived_private_t" context="_37" mangled="N4core15class_hierarchy17derived_private_tE" location="f0:27" file="f0" line="27" members="_62 _63 _64 " bases="private:_54 "/> + <Class id="_51" name="derived_protected_t" context="_37" mangled="N4core15class_hierarchy19derived_protected_tE" location="f0:24" file="f0" line="24" members="_65 _66 _67 " bases="protected:_54 "/> + <Class id="_52" name="derived_public_t" context="_37" mangled="N4core15class_hierarchy16derived_public_tE" location="f0:21" file="f0" line="21" members="_68 _69 _70 " bases="_54 "/> + <Class id="_53" name="other_base_t" context="_37" mangled="N4core15class_hierarchy12other_base_tE" location="f0:18" file="f0" line="18" members="_71 _72 " bases=""/> + <Class id="_54" name="base_t" context="_37" mangled="N4core15class_hierarchy6base_tE" location="f0:13" file="f0" line="13" members="_73 _74 _75 " bases=""/> + <Struct id="_55" name="__type_info_pseudo" context="_1" mangled="18__type_info_pseudo" location="f2:0" file="f2" line="0" members="" bases=""/> + <FundamentalType id="_56" name="int"/> + <ArrayType id="_57" min="0" max="3" type="_76"/> + <ArrayType id="_58" min="0" max="1" type="_76"/> + <Constructor id="_59" name="multi_derived_t" artificial="1" throw="" context="_49" mangled="_ZN4core15class_hierarchy15multi_derived_tC1ERKS1_ *INTERNAL* " location="f0:30" file="f0" line="30"> + <Argument name="_ctor_arg" type="_77"/> + </Constructor> + <Constructor id="_60" name="multi_derived_t" artificial="1" throw="" context="_49" mangled="_ZN4core15class_hierarchy15multi_derived_tC1Ev *INTERNAL* " location="f0:30" file="f0" line="30"/> + <Destructor id="_61" name="multi_derived_t" virtual="1" artificial="1" context="_49" mangled="_ZN4core15class_hierarchy15multi_derived_tD1Ev *INTERNAL* " location="f0:30" file="f0" line="30"> + </Destructor> + <Constructor id="_62" name="derived_private_t" artificial="1" throw="" context="_50" mangled="_ZN4core15class_hierarchy17derived_private_tC1ERKS1_ *INTERNAL* " location="f0:27" file="f0" line="27"> + <Argument name="_ctor_arg" type="_78"/> + </Constructor> + <Constructor id="_63" name="derived_private_t" artificial="1" throw="" context="_50" mangled="_ZN4core15class_hierarchy17derived_private_tC1Ev *INTERNAL* " location="f0:27" file="f0" line="27"/> + <Destructor id="_64" name="derived_private_t" virtual="1" artificial="1" context="_50" mangled="_ZN4core15class_hierarchy17derived_private_tD1Ev *INTERNAL* " location="f0:27" file="f0" line="27"> + </Destructor> + <Constructor id="_65" name="derived_protected_t" artificial="1" throw="" context="_51" mangled="_ZN4core15class_hierarchy19derived_protected_tC1ERKS1_ *INTERNAL* " location="f0:24" file="f0" line="24"> + <Argument name="_ctor_arg" type="_79"/> + </Constructor> + <Constructor id="_66" name="derived_protected_t" artificial="1" throw="" context="_51" mangled="_ZN4core15class_hierarchy19derived_protected_tC1Ev *INTERNAL* " location="f0:24" file="f0" line="24"/> + <Destructor id="_67" name="derived_protected_t" virtual="1" artificial="1" context="_51" mangled="_ZN4core15class_hierarchy19derived_protected_tD1Ev *INTERNAL* " location="f0:24" file="f0" line="24"> + </Destructor> + <Constructor id="_68" name="derived_public_t" artificial="1" throw="" context="_52" mangled="_ZN4core15class_hierarchy16derived_public_tC1ERKS1_ *INTERNAL* " location="f0:21" file="f0" line="21"> + <Argument name="_ctor_arg" type="_80"/> + </Constructor> + <Constructor id="_69" name="derived_public_t" artificial="1" throw="" context="_52" mangled="_ZN4core15class_hierarchy16derived_public_tC1Ev *INTERNAL* " location="f0:21" file="f0" line="21"/> + <Destructor id="_70" name="derived_public_t" virtual="1" artificial="1" context="_52" mangled="_ZN4core15class_hierarchy16derived_public_tD1Ev *INTERNAL* " location="f0:21" file="f0" line="21"> + </Destructor> + <Constructor id="_71" name="other_base_t" artificial="1" throw="" context="_53" mangled="_ZN4core15class_hierarchy12other_base_tC1ERKS1_ *INTERNAL* " location="f0:18" file="f0" line="18"> + <Argument name="_ctor_arg" type="_81"/> + </Constructor> + <Constructor id="_72" name="other_base_t" artificial="1" throw="" context="_53" mangled="_ZN4core15class_hierarchy12other_base_tC1Ev *INTERNAL* " location="f0:18" file="f0" line="18"/> + <Constructor id="_73" name="base_t" artificial="1" throw="" context="_54" mangled="_ZN4core15class_hierarchy6base_tC1ERKS1_ *INTERNAL* " location="f0:13" file="f0" line="13"> + <Argument name="_ctor_arg" type="_82"/> + </Constructor> + <Constructor id="_74" name="base_t" artificial="1" throw="" context="_54" mangled="_ZN4core15class_hierarchy6base_tC1Ev *INTERNAL* " location="f0:13" file="f0" line="13"/> + <Destructor id="_75" name="base_t" virtual="1" context="_54" mangled="_ZN4core15class_hierarchy6base_tD1Ev *INTERNAL* " location="f0:15" file="f0" line="15" endline="15"> + </Destructor> + <Struct id="_76" name="__base_class_type_info_pseudo" context="_1" mangled="29__base_class_type_info_pseudo" location="f2:0" file="f2" line="0" members="" bases=""/> + <ReferenceType id="_77" type="_49c"/> + <ReferenceType id="_78" type="_50c"/> + <ReferenceType id="_79" type="_51c"/> + <ReferenceType id="_80" type="_52c"/> + <ReferenceType id="_81" type="_53c"/> + <ReferenceType id="_82" type="_54c"/> + <FundamentalType id="_47" name="char"/> + <CvQualifiedType id="_47c" type="_47" const="1"/> + <CvQualifiedType id="_29c" type="_29" const="1"/> + <CvQualifiedType id="_54c" type="_54" const="1"/> + <CvQualifiedType id="_53c" type="_53" const="1"/> + <CvQualifiedType id="_52c" type="_52" const="1"/> + <CvQualifiedType id="_51c" type="_51" const="1"/> + <CvQualifiedType id="_50c" type="_50" const="1"/> + <CvQualifiedType id="_49c" type="_49" const="1"/> + <File id="f0" name="core_class_hierarchy.hpp"/> + <File id="f1" name="/usr/local/share/gccxml-0.6/GCC/3.3/gccxml_builtins.h"/> + <File id="f2" name="<internal>"/> +</GCC_XML> Copied: pygccxml_dev/docs/example.py (from rev 646, pygccxml_dev/docs/example/example.py) =================================================================== --- pygccxml_dev/docs/example.py (rev 0) +++ pygccxml_dev/docs/example.py 2006-10-12 09:29:16 UTC (rev 656) @@ -0,0 +1,26 @@ +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import sys +sys.path.append('../..') #adding pygccxml to the path + +from pygccxml import parser +from pygccxml import declarations + +#configure GCC-XML parser +config = parser.config_t( gccxml_path='/home/roman/gccxml-build/bin/gccxml' ) + +#parsing source file +decls = parser.parse( ['core_class_hierarchy.hpp'], config ) +global_ns = declarations.get_global_namespace( decls ) + +#printing all declarations found in file and its includes +declarations.print_declarations( global_ns ) + +#print all base and derived class names +for class_ in global_ns.classes(): + print class_.name + print '\tbases: ', `[base.related_class.name for base in class_.bases]` + print '\tderived: ', `[derive.related_class.name for derive in class_.derived]` \ No newline at end of file Modified: pygccxml_dev/docs/pygccxml.rest =================================================================== --- pygccxml_dev/docs/pygccxml.rest 2006-10-12 09:18:29 UTC (rev 655) +++ pygccxml_dev/docs/pygccxml.rest 2006-10-12 09:29:16 UTC (rev 656) @@ -42,9 +42,9 @@ looks "in the real life", I mean how xml file is look like, you may look at the `original XML file`_ generated by `GCC-XML`_. -.. _`original XML file` : ./example/core_class_hierarchy.hpp.xml -.. _`core_class_hierarchy.hpp` : ./example/core_class_hierarchy.hpp -.. _`example` : ./example/example.py +.. _`original XML file` : ./core_class_hierarchy.hpp.xml.html +.. _`core_class_hierarchy.hpp` : ./core_class_hierarchy.hpp.html +.. _`example` : ./example.py.html -------- Features This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 09:18:40
|
Revision: 655 http://svn.sourceforge.net/pygccxml/?rev=655&view=rev Author: roman_yakovenko Date: 2006-10-12 02:18:29 -0700 (Thu, 12 Oct 2006) Log Message: ----------- switching to code block directive Modified Paths: -------------- pydsc_dev/docs/pydsc.rest Modified: pydsc_dev/docs/pydsc.rest =================================================================== --- pydsc_dev/docs/pydsc.rest 2006-10-12 07:54:49 UTC (rev 654) +++ pydsc_dev/docs/pydsc.rest 2006-10-12 09:18:29 UTC (rev 655) @@ -24,11 +24,13 @@ check all the documentation strings. My goal was simplicity + easy customization. I achieved it. Here is example of usage of pydsc: -| ``import pydsc`` -| ``#every module that will be imported after pydsc will be checked`` -| ``#all errors will be printed to stdout`` -| ``import readline`` +.. code-block:: Python + import pydsc + #every module that will be imported after pydsc will be checked + #all errors will be printed to stdout + import readline + -------------- Spell checking -------------- @@ -49,12 +51,14 @@ "More complex" example: -| ``import pydsc`` -| #check for spell errors only in files under "/home/roman/pygccxml" directory -| ``pydsc.include( "/home/roman/pygccxml" )`` -| ``pydsc.ignore( [ 'normcase', 'normpath' ] )`` -| ``import readline`` +.. code-block:: Python + import pydsc + #check for spell errors only in files under "/home/roman/pygccxml" directory + pydsc.include( "/home/roman/pygccxml" ) + pydsc.ignore( [ 'normcase', 'normpath' ] ) + import readline + -------- Download -------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 07:54:56
|
Revision: 654 http://svn.sourceforge.net/pygccxml/?rev=654&view=rev Author: roman_yakovenko Date: 2006-10-12 00:54:49 -0700 (Thu, 12 Oct 2006) Log Message: ----------- fixing small indentation problem Modified Paths: -------------- pygccxml_dev/docs/query_interface.rest Modified: pygccxml_dev/docs/query_interface.rest =================================================================== --- pygccxml_dev/docs/query_interface.rest 2006-10-12 07:31:24 UTC (rev 653) +++ pygccxml_dev/docs/query_interface.rest 2006-10-12 07:54:49 UTC (rev 654) @@ -85,7 +85,7 @@ Python string, that contains member function name or full name. - .. code-block:: Python + .. code-block:: Python do_smth = my_class.member_function( 'do_smth' ) do_smth = my_class.member_function( 'my_namespace::my_class::do_smth' ) @@ -108,10 +108,10 @@ Function return type. This argument can be Python string or an object that describes C++ type. - .. code-block:: Python + .. code-block:: Python mem_funcs = my_class.member_functions( return_type='int' ) - + i = declarations.int_t() ref_i = declarations.reference_t( i ) const_ref_i = declarations.const_t( ref_i ) @@ -216,8 +216,10 @@ exclude declaration, from being exported to Python. Next code will exclude ``clone`` member function from being exported: - ``global_ns.member_functions( 'clone' ).exclude()`` +.. code-block:: Python + global_ns.member_functions( 'clone' ).exclude() + As you can see this class allows you to write less code. Basically using this class you don't have to write loops. If will do it for you. Also if you insist to write loops, ``mdecl_wrapper_t`` class implements ``__len__``, ``__getitem__`` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 07:31:42
|
Revision: 653 http://svn.sourceforge.net/pygccxml/?rev=653&view=rev Author: roman_yakovenko Date: 2006-10-12 00:31:24 -0700 (Thu, 12 Oct 2006) Log Message: ----------- updating tutorials Modified Paths: -------------- pyplusplus_dev/docs/documentation/tutorials/tutorials.rest pyplusplus_dev/docs/documentation/tutorials/www_configuration.py Added Paths: ----------- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/generated.cpp.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp.rest pyplusplus_dev/docs/documentation/tutorials/pyplusplus_gui.png pyplusplus_dev/docs/documentation/tutorials/pyplusplus_gui.rest Removed Paths: ------------- pyplusplus_dev/docs/documentation/tutorials/pyplusplus_demo.png Added: pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py.rest (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py.rest 2006-10-12 07:31:24 UTC (rev 653) @@ -0,0 +1,3 @@ +.. code-block:: + :language: Python + :source-file: ./generate_code.py Added: pyplusplus_dev/docs/documentation/tutorials/module_builder/generated.cpp.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/generated.cpp.rest (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/generated.cpp.rest 2006-10-12 07:31:24 UTC (rev 653) @@ -0,0 +1,3 @@ +.. code-block:: + :language: C++ + :source-file: ./generated.cpp Added: pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp.rest (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp.rest 2006-10-12 07:31:24 UTC (rev 653) @@ -0,0 +1,3 @@ +.. code-block:: + :language: C++ + :source-file: ./hello_world.hpp Deleted: pyplusplus_dev/docs/documentation/tutorials/pyplusplus_demo.png =================================================================== (Binary files differ) Copied: pyplusplus_dev/docs/documentation/tutorials/pyplusplus_gui.png (from rev 646, pyplusplus_dev/docs/documentation/tutorials/pyplusplus_demo.png) =================================================================== (Binary files differ) Added: pyplusplus_dev/docs/documentation/tutorials/pyplusplus_gui.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/pyplusplus_gui.rest (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/pyplusplus_gui.rest 2006-10-12 07:31:24 UTC (rev 653) @@ -0,0 +1 @@ +.. image:: pyplusplus_gui.png Modified: pyplusplus_dev/docs/documentation/tutorials/tutorials.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-10-12 07:02:22 UTC (rev 652) +++ pyplusplus_dev/docs/documentation/tutorials/tutorials.rest 2006-10-12 07:31:24 UTC (rev 653) @@ -31,8 +31,8 @@ * it is able to generate `Py++`_ code for you -.. _`graphical interface` : ./pyplusplus_demo.png -.. _`Graphical interface` : ./pyplusplus_demo.png +.. _`graphical interface` : ./pyplusplus_gui.html +.. _`Graphical interface` : ./pyplusplus_gui.html --------------- Getting started Modified: pyplusplus_dev/docs/documentation/tutorials/www_configuration.py =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/www_configuration.py 2006-10-12 07:02:22 UTC (rev 652) +++ pyplusplus_dev/docs/documentation/tutorials/www_configuration.py 2006-10-12 07:31:24 UTC (rev 653) @@ -1 +1,2 @@ -name = 'tutorials' \ No newline at end of file +name = 'tutorials' +names = { 'pyplusplus_gui' : 'Py++ - graphical user interface' } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 07:02:29
|
Revision: 652 http://svn.sourceforge.net/pygccxml/?rev=652&view=rev Author: roman_yakovenko Date: 2006-10-12 00:02:22 -0700 (Thu, 12 Oct 2006) Log Message: ----------- updating tutorials Modified Paths: -------------- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py 2006-10-12 07:00:58 UTC (rev 651) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py 2006-10-12 07:02:22 UTC (rev 652) @@ -18,7 +18,7 @@ Color = mb.enum( 'color' ) Color.rename('Color') -#Set call policies to animal::get_name_ptr +#Set call policies to animal::genealogical_tree_ref animal = mb.class_( 'animal' ) genealogical_tree_ref = animal.member_function( 'genealogical_tree_ref', recursive=False ) genealogical_tree_ref.call_policies = module_builder.call_policies.return_internal_reference() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 07:01:11
|
Revision: 651 http://svn.sourceforge.net/pygccxml/?rev=651&view=rev Author: roman_yakovenko Date: 2006-10-12 00:00:58 -0700 (Thu, 12 Oct 2006) Log Message: ----------- updating tutorials Modified Paths: -------------- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest Added Paths: ----------- pyplusplus_dev/docs/documentation/tutorials/module_builder/generated.cpp Removed Paths: ------------- pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py 2006-10-12 05:44:53 UTC (rev 650) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py 2006-10-12 07:00:58 UTC (rev 651) @@ -4,15 +4,9 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -############################################################################# -## # -## ANY CHANGE IN THIS FILE MUST BE REFLECTED IN docs/tutorials DIRECTORY # -## # -############################################################################# - import os import sys -sys.path.append( '../..' ) +sys.path.append( '../../../..' ) from environment import gccxml from pyplusplus import module_builder @@ -26,12 +20,12 @@ #Set call policies to animal::get_name_ptr animal = mb.class_( 'animal' ) -get_name_ptr = animal.member_function( 'get_name_ptr', recursive=False ) -get_name_ptr.call_policies = module_builder.call_policies.return_internal_reference() +genealogical_tree_ref = animal.member_function( 'genealogical_tree_ref', recursive=False ) +genealogical_tree_ref.call_policies = module_builder.call_policies.return_internal_reference() #next code has same effect -get_name_ptr = mb.member_function( 'get_name_ptr' ) -get_name_ptr.call_policies = module_builder.call_policies.return_internal_reference() +genealogical_tree_ref = mb.member_function( 'genealogical_tree_ref' ) +genealogical_tree_ref.call_policies = module_builder.call_policies.return_internal_reference() #I want to exclude all classes with name starts with impl impl_classes = mb.classes( lambda decl: decl.name.startswith( 'impl' ) ) @@ -57,4 +51,4 @@ mb.code_creator.user_defined_directories.append( os.path.abspath('.') ) #And finally we can write code to the disk -mb.write_module( os.path.join( os.path.abspath('.'), 'hello_world.py.cpp' ) ) \ No newline at end of file +mb.write_module( os.path.join( os.path.abspath('.'), 'generated.cpp' ) ) Copied: pyplusplus_dev/docs/documentation/tutorials/module_builder/generated.cpp (from rev 649, pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp) =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/generated.cpp (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/generated.cpp 2006-10-12 07:00:58 UTC (rev 651) @@ -0,0 +1,31 @@ +// This file has been generated by Py++. + +//Boost Software License( http://boost.org/more/license_info.html ) + +#include "boost/python.hpp" + +#include "hello_world.hpp" + +namespace bp = boost::python; + +BOOST_PYTHON_MODULE(hw){ + bp::enum_< color>("Color") + .value("red", red) + .value("green", green) + .value("blue", blue) + .export_values() + ; + + bp::class_< animal, boost::noncopyable >( "animal", bp::init< bp::optional< std::string const & > >(( bp::arg("name")="" )) ) + .def( + "genealogical_tree_ref" + , &::animal::genealogical_tree_ref + , bp::return_internal_reference< 1, bp::default_call_policies >() ) + .def( + "name" + , &::animal::name ); + + bp::implicitly_convertible< std::string const &, animal >(); + + bp::class_< genealogical_tree >( "genealogical_tree" ); +} Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp 2006-10-12 05:44:53 UTC (rev 650) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp 2006-10-12 07:00:58 UTC (rev 651) @@ -1,38 +1,34 @@ -// Copyright 2004 Roman Yakovenko. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) +// Copyright 2004-2006 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) -/****************************************************************************************** - * * - * ANY CHANGE IN THIS FILE MUST BE REFLECTED IN docs/tutorials DIRECTORY * - * * - *****************************************************************************************/ - -#ifndef __hello_world_hpp__ -#define __hello_world_hpp__ - -#include <string> +#ifndef __hello_world_hpp__ +#define __hello_world_hpp__ +#include <string> + //I want to rename color to Color enum color{ red, green, blue }; - + +struct genealogical_tree{/*...*/}; + struct animal{ - - animal( const std::string& name="" ) + + explicit animal( const std::string& name="" ) : m_name( name ) {} //I need to set call policies to the function - const std::string* get_name_ptr() const - { return &m_name; } + genealogical_tree& genealogical_tree_ref() + { return m_genealogical_tree; } - const std::string& name() const + std::string name() const { return m_name; } - + private: std::string m_name; - + genealogical_tree m_genealogical_tree; }; //I want to exclude next declarations: @@ -43,5 +39,5 @@ inline int* get_int_ptr(int){ return 0;} inline int* get_int_ptr(double){ return 0;} -#endif//__hello_world_hpp__ - +#endif//__hello_world_hpp__ + Deleted: pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp 2006-10-12 05:44:53 UTC (rev 650) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp 2006-10-12 07:00:58 UTC (rev 651) @@ -1,28 +0,0 @@ -// This file has been generated by pyplusplus. - -//Boost Software License( http://boost.org/more/license_info.html ) - -#include "boost/python.hpp" - -#include "hello_world.hpp" - -namespace bp = boost::python; - -BOOST_PYTHON_MODULE(hw){ - bp::enum_<color>("Color") - .value("blue", blue) - .value("green", green) - .value("red", red) - .export_values() - ; - - bp::class_< animal, boost::noncopyable >( "animal", bp::init< bp::optional< std::string const & > >(( bp::arg("name")="" )) ) - .def("get_name_ptr" - , &::animal::get_name_ptr - , bp::return_internal_reference< 1, bp::default_call_policies >() ) - .def("name" - , &::animal::name - , bp::return_value_policy< bp::copy_const_reference, bp::default_call_policies >() ); - - bp::implicitly_convertible< std::string const &, animal >(); -} Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-10-12 05:44:53 UTC (rev 650) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2006-10-12 07:00:58 UTC (rev 651) @@ -24,8 +24,8 @@ * `generate_code.py`_ - Python code, that uses `Py++`_ to export declarations from the source file -.. _`hello_world.hpp` : ./hello_world.html -.. _`generate_code.py` : ./generate_code.html +.. _`hello_world.hpp` : ./hello_world.hpp.html +.. _`generate_code.py` : ./generate_code.py.html ---------------- module_builder_t @@ -35,8 +35,7 @@ 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. +guide you through the whole process. ------------------------- module_builder_t.__init__ @@ -50,27 +49,27 @@ 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``. + `pygccxml`_ will look for it using ``PATH`` environment variable. There are some other arguments: -* additional include directories +* additional include directories * [un]defined symbols ( macros ) -* declarations cache +* intermediate results cache strategy configuration * ... 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. +method is that all declarations has been successfully extracted from the sources +files and you can start work on them. -------------------------- Declarations customization -------------------------- -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 -directories as parsed files, will be exported: +There are always declarations, which should not be exported or could not be +exported without human invocation. As you already saw from example, `Py++`_ provides +simple and powerful declarations query interface. By default, only the declarations +that belongs to the files, you have asked to parse, and to the files, that lies +in the same directories as parsed files, will be exported: :: project_root/ @@ -97,11 +96,18 @@ * 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. +declarations tree or some specific declaration. You will find a lot of useful +information there: +* whether the declaration is include\\excluded +* call policies +* warnings, `Py++`_ warns you about the declarations that have some "problems" +* ... + +Very convenient, very useful. + ----------------------------------- module_builder_t.build_code_creator ----------------------------------- @@ -151,7 +157,7 @@ `View generated file`_ -.. _`View generated file` : ./result.html +.. _`View generated file` : ./generated.cpp.html That's all. I hope you enjoyed. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 05:45:01
|
Revision: 650 http://svn.sourceforge.net/pygccxml/?rev=650&view=rev Author: roman_yakovenko Date: 2006-10-11 22:44:53 -0700 (Wed, 11 Oct 2006) Log Message: ----------- removing tutorials Removed Paths: ------------- pyplusplus_dev/tutorials/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-12 05:44:01
|
Revision: 649 http://svn.sourceforge.net/pygccxml/?rev=649&view=rev Author: roman_yakovenko Date: 2006-10-11 22:43:44 -0700 (Wed, 11 Oct 2006) Log Message: ----------- moving module_builder tutorials to documentation Added Paths: ----------- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp Removed Paths: ------------- 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/result.html Deleted: pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.html =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.html 2006-10-11 21:41:52 UTC (rev 648) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.html 2006-10-12 05:43:44 UTC (rev 649) @@ -1,101 +0,0 @@ -<!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> Copied: pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py (from rev 646, pyplusplus_dev/tutorials/module_builder/generate_code.py) =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/generate_code.py 2006-10-12 05:43:44 UTC (rev 649) @@ -0,0 +1,60 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +############################################################################# +## # +## ANY CHANGE IN THIS FILE MUST BE REFLECTED IN docs/tutorials DIRECTORY # +## # +############################################################################# + +import os +import sys +sys.path.append( '../..' ) +from environment import gccxml +from pyplusplus import module_builder + +mb = module_builder.module_builder_t( + files=['hello_world.hpp'] + , gccxml_path=gccxml.executable ) #path to gccxml executable + +#rename enum Color to color +Color = mb.enum( 'color' ) +Color.rename('Color') + +#Set call policies to animal::get_name_ptr +animal = mb.class_( 'animal' ) +get_name_ptr = animal.member_function( 'get_name_ptr', recursive=False ) +get_name_ptr.call_policies = module_builder.call_policies.return_internal_reference() + +#next code has same effect +get_name_ptr = mb.member_function( 'get_name_ptr' ) +get_name_ptr.call_policies = module_builder.call_policies.return_internal_reference() + +#I want to exclude all classes with name starts with impl +impl_classes = mb.classes( lambda decl: decl.name.startswith( 'impl' ) ) +impl_classes.exclude() + +#I want to exclude all functions that returns pointer to int +ptr_to_int = mb.free_functions( return_type='int *' ) +ptr_to_int.exclude() + +#I can print declarations to see what is going on +mb.print_declarations() + +#I can print single declaration +mb.print_declarations( animal ) + +#Now it is the time to give a name to our module +mb.build_code_creator( module_name='hw' ) + +#It is common requirement in software world - each file should have license +mb.code_creator.license = '//Boost Software License( http://boost.org/more/license_info.html )' + +#I don't want absolute includes within code +mb.code_creator.user_defined_directories.append( os.path.abspath('.') ) + +#And finally we can write code to the disk +mb.write_module( os.path.join( os.path.abspath('.'), 'hello_world.py.cpp' ) ) \ No newline at end of file Copied: pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp (from rev 646, pyplusplus_dev/tutorials/module_builder/hello_world.hpp) =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.hpp 2006-10-12 05:43:44 UTC (rev 649) @@ -0,0 +1,47 @@ +// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/****************************************************************************************** + * * + * ANY CHANGE IN THIS FILE MUST BE REFLECTED IN docs/tutorials DIRECTORY * + * * + *****************************************************************************************/ + +#ifndef __hello_world_hpp__ +#define __hello_world_hpp__ + +#include <string> + +//I want to rename color to Color +enum color{ red, green, blue }; + +struct animal{ + + animal( const std::string& name="" ) + : m_name( name ) + {} + + //I need to set call policies to the function + const std::string* get_name_ptr() const + { return &m_name; } + + const std::string& name() const + { return m_name; } + +private: + std::string m_name; + +}; + +//I want to exclude next declarations: +struct impl1{}; +struct impl2{}; + +inline int* get_int_ptr(){ return 0;} +inline int* get_int_ptr(int){ return 0;} +inline int* get_int_ptr(double){ return 0;} + +#endif//__hello_world_hpp__ + Deleted: pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.html =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.html 2006-10-11 21:41:52 UTC (rev 648) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.html 2006-10-12 05:43:44 UTC (rev 649) @@ -1,97 +0,0 @@ -<!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> Copied: pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp (from rev 646, pyplusplus_dev/tutorials/module_builder/hello_world.py.cpp) =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp (rev 0) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/hello_world.py.cpp 2006-10-12 05:43:44 UTC (rev 649) @@ -0,0 +1,28 @@ +// This file has been generated by pyplusplus. + +//Boost Software License( http://boost.org/more/license_info.html ) + +#include "boost/python.hpp" + +#include "hello_world.hpp" + +namespace bp = boost::python; + +BOOST_PYTHON_MODULE(hw){ + bp::enum_<color>("Color") + .value("blue", blue) + .value("green", green) + .value("red", red) + .export_values() + ; + + bp::class_< animal, boost::noncopyable >( "animal", bp::init< bp::optional< std::string const & > >(( bp::arg("name")="" )) ) + .def("get_name_ptr" + , &::animal::get_name_ptr + , bp::return_internal_reference< 1, bp::default_call_policies >() ) + .def("name" + , &::animal::name + , bp::return_value_policy< bp::copy_const_reference, bp::default_call_policies >() ); + + bp::implicitly_convertible< std::string const &, animal >(); +} Deleted: pyplusplus_dev/docs/documentation/tutorials/module_builder/result.html =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/result.html 2006-10-11 21:41:52 UTC (rev 648) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/result.html 2006-10-12 05:43:44 UTC (rev 649) @@ -1,78 +0,0 @@ -<!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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-10-11 21:42:01
|
Revision: 648 http://svn.sourceforge.net/pygccxml/?rev=648&view=rev Author: roman_yakovenko Date: 2006-10-11 14:41:52 -0700 (Wed, 11 Oct 2006) Log Message: ----------- adding new file ext that should be deleted Modified Paths: -------------- developer_scripts/clean_source_dir.py Modified: developer_scripts/clean_source_dir.py =================================================================== --- developer_scripts/clean_source_dir.py 2006-10-11 12:50:41 UTC (rev 647) +++ developer_scripts/clean_source_dir.py 2006-10-11 21:41:52 UTC (rev 648) @@ -27,19 +27,19 @@ , '*.pdb' , '*.dat' , '*.ncb' + , '*.out' ] to_be_deleted_files = [ '.sconsign' ] - + if __name__ == '__main__': sources_dir = os.path.join( os.path.abspath( os.curdir ), '..' ) - + for file in files_iterator( sources_dir, to_be_deleted_file_exts ): print 'removing : ', file os.remove( file ) - + for file in files_iterator( sources_dir ): if os.path.split( file )[1] in to_be_deleted_files: print 'removing : ', file os.remove( file ) - \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |