[pygccxml-commit] SF.net SVN: pygccxml: [1017] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2007-04-24 17:31:09
|
Revision: 1017 http://svn.sourceforge.net/pygccxml/?rev=1017&view=rev Author: roman_yakovenko Date: 2007-04-24 10:31:08 -0700 (Tue, 24 Apr 2007) Log Message: ----------- updating documentation Modified Paths: -------------- pygccxml_dev/docs/history/history.rest pygccxml_dev/pygccxml/__init__.py pyplusplus_dev/docs/documentation/functions/call_policies.rest pyplusplus_dev/docs/documentation/properties.rest pyplusplus_dev/docs/history/history.rest pyplusplus_dev/docs/pyplusplus.rest pyplusplus_dev/pyplusplus/__init__.py pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py Modified: pygccxml_dev/docs/history/history.rest =================================================================== --- pygccxml_dev/docs/history/history.rest 2007-04-23 17:15:08 UTC (rev 1016) +++ pygccxml_dev/docs/history/history.rest 2007-04-24 17:31:08 UTC (rev 1017) @@ -22,65 +22,69 @@ ------------- -Version 0.8.* +Version 0.9.0 ------------- -1. ``is_base_and_derived`` function was changed. The second argument could be +1. Performance was improved. `pygccxml`_ is now 30-50% faster. The improvement + was achieved by using `cElementTree`_ package, ``iterparse`` functionality, + instead of standard XML SAX API. If `cElementTree`_ package is not available, + the built-in XML SAX package is used. + +.. _`cElementTree` : http://effbot.org/zone/celementtree.htm + +2. ``is_base_and_derived`` function was changed. The second argument could be a tuple, which contains classes. Function returns ``True`` if at least one class derives from the base one. .. line separator -2. Class ``calldef_t`` has property - ``does_throw``. It describes +3. Class ``calldef_t`` has property - ``does_throw``. It describes whether the function throws any exception or not. .. line separator -3. Bug fixes: small bug was fixed in functionality that corrects GCC-XML reported +4. Bug fixes: small bug was fixed in functionality that corrects GCC-XML reported function default arguments. Reference to "enum" declaration extracted properly. Many thanks to Martin Preisler for reporting the bug. .. line separator -4. New type traits have been added: +5. New type traits have been added: + * ``is_std_ostream`` * ``is_std_wostream`` .. line separator - -5. C++ does not define implicit conversion between an integral type and ``void*``. - ``declarations.is_convertible`` type traitswas fixed. +6. C++ does not define implicit conversion between an integral type and ``void*``. + ``declarations.is_convertible`` type traits was fixed. + .. line separator -6. ``declarations.is_noncopyable`` type traits implementation was slightly changed. +7. ``declarations.is_noncopyable`` type traits implementation was slightly changed. Now it checks explicitly that class has: - + * default constructor * copy constructor * ``operator=`` * destructor - If all listed functions exists, than the algorithm returns ``False``, otherwise + If all listed functions exist, than the algorithm returns ``False``, otherwise it will continue to execute previous logic. - + .. line separator -7. ``declarations.class_declaration_t`` has new property - ``aliases``. This is +8. ``declarations.class_declaration_t`` has new property - ``aliases``. This is a list of all aliases to the class declaration. .. line separator - -8. The message of the exception, which is raised from ``declarations.mdecl_wrapper_t`` + +9. The message of the exception, which is raised from ``declarations.mdecl_wrapper_t`` class was improved and now clearly explains what the problem is. -.. line separator +.. line separator -9. Small improvment was done for ``parser.default_argument_patcher_t`` class. - ``enum`` extraction is done using functionality provided by type traits module. - - ------------- Version 0.8.5 ------------- Modified: pygccxml_dev/pygccxml/__init__.py =================================================================== --- pygccxml_dev/pygccxml/__init__.py 2007-04-23 17:15:08 UTC (rev 1016) +++ pygccxml_dev/pygccxml/__init__.py 2007-04-24 17:31:08 UTC (rev 1017) @@ -33,8 +33,8 @@ import pygccxml.parser as parser import pygccxml.utils as utils -#TODO: +#TODO: # 1. Write documentation for filtering functionality. # 2. Add "explicit" property for constructors -__version__ = '0.8.6' +__version__ = '0.9.0' Modified: pyplusplus_dev/docs/documentation/functions/call_policies.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies.rest 2007-04-23 17:15:08 UTC (rev 1016) +++ pyplusplus_dev/docs/documentation/functions/call_policies.rest 2007-04-24 17:31:08 UTC (rev 1017) @@ -115,6 +115,10 @@ * return type is ``T&``, for member ``operator[]`` +* ``return_self`` + + This call policy will be used for ``operator=``. + --------------------- Missing call policies --------------------- @@ -181,6 +185,30 @@ Py++ defined call policies -------------------------- +custom_call_policies +-------------------- + +``custom_call_policies`` policies functionality was born to allow you to define +your own call polices and use them with same level of convenience as built-in ones. + +The usage is pretty simple: + +.. code-block:: Python + + from pyplusplus import module_builder + from pyplusplus.module_builder import call_policies + + mb = module_builder.module_builder_t( ... ) + mb.free_function( ... ).call_policies \ + = call_policies.custom_call_policies( your call policies code ) + + Optionally you can specify name of the header file, which should be included: + +.. code-block:: Python + + mb.free_function( ... ).call_policies \ + = call_policies.custom_call_policies( your call policies code, "xyz.hpp" ) + return_pointee_value -------------------- Modified: pyplusplus_dev/docs/documentation/properties.rest =================================================================== --- pyplusplus_dev/docs/documentation/properties.rest 2007-04-23 17:15:08 UTC (rev 1016) +++ pyplusplus_dev/docs/documentation/properties.rest 2007-04-24 17:31:08 UTC (rev 1017) @@ -153,6 +153,13 @@ It is also aware of few common prefixes for set\\get accessors: get, is, has, set, <<empty prefix for get accessor>>. +------------- +Documentation +------------- +You can use ``doc`` attribute to specify the property documentation. If you +don't, than `Py++`_ will construct documentation, which will describe from what +functions this property was built from. + .. _`Py++` : ./../pyplusplus.html .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2007-04-23 17:15:08 UTC (rev 1016) +++ pyplusplus_dev/docs/history/history.rest 2007-04-24 17:31:08 UTC (rev 1017) @@ -35,37 +35,78 @@ ------------- -Version 0.8.* +Version 0.9.0 ------------- 1. Bug fixes: - - * Declaration of virtual functions that have an exception specification with + + * Declaration of virtual functions that have an exception specification with an empty throw was fixed. Now the exception specification is generated properly. Many thanks to Martin Preisler for reporting the bug. .. line-separator -2. Added exposing of copy constructor and ``operator=``. ``operator=`` is exposed - under "assign" name. +2. Added exposing of copy constructor, ``operator=`` and ``operator<<``. + * ``operator=`` is exposed under "assign" name + + * ``operator<<`` is exposed under "__str__" name + .. line-separator -3. Added new call policy - `as_tuple`_ +3. Added new call policies: + * `as_tuple`_ + + * `custom_call_policies`_ + + * `return_range`_ + .. _`as_tuple` : ../documentation/functions/call_policies.html#as-tuple +.. _`return_range`: ../documentation/functions/call_policies.html#custom-call-policies +.. _`custom_call_policies` : ../documentation/functions/call_policies.html#custom-call-policies -4. Added initial support for multi-module development. Now you can mark you declaration - as ``already_exposed``. "Py++" will not create code for it, but will +4. Added an initial support for multi-module development. Now you can mark you + declaration as ``already_exposed`` and `Py++`_ will do the rest. For more + information read `multi-module development guide`_. +.. _`multi-module development guide` : ../documentation/multi_module_development.html + .. line-separator 5. `input_c_buffer`_ - new functions transformation, which allows to pass a Python sequence to function, instead of pair of arguments: pointer to buffer and size. - + .. _`input_c_buffer` : ../documentation/functions/transformation/built_in/input_c_buffer.html +6. Added ability to control generated "include" directives. Now you can ask `Py++`_ + to include a header file, when it generates code for some declaration. For more + information refer to `inserting code guide`_. +.. _`inserting code guide` : ../documentation/inserting_code.html#header-files + +7. Code generation improvements: system header files ( Boost.Python or Py++ defined ) + will be included from the generated files only in case the generated code + depends on them. + +.. line-separator + +8. Performance improvements: Py++ runs 1.5 - 2 times faster, than the previous one. + +.. line-separator + +9. Added ability to add code before overriden and default function calls. + For more information refer to `member function API documentation`_. + +.. _`member function API documentation` : ../documentation/apidocs/pyplusplus.decl_wrappers.calldef_wrapper.member_function_t-class.html + +10. `Py++`_ will generate documentation for automatically constructed properties. + For more information refer to `properties guide`_ + +.. _`properties guide`: ../documentation/properties.html#documentation + +11. Added + ------------- Version 0.8.5 ------------- Modified: pyplusplus_dev/docs/pyplusplus.rest =================================================================== --- pyplusplus_dev/docs/pyplusplus.rest 2007-04-23 17:15:08 UTC (rev 1016) +++ pyplusplus_dev/docs/pyplusplus.rest 2007-04-24 17:31:08 UTC (rev 1017) @@ -126,13 +126,17 @@ Features list ------------- -* `Py++`_ support almost all features found in `Boost.Python`_ library +* `Py++`_ supports almost all features found in `Boost.Python`_ library +* Using `Py++`_ you can develop few extension modules simultaneously, especially + when they share the code. -* `Py++`_ generates code, which will help you to understand compiler generated - error messages +* `Py++`_ generates code, which will help you: + * to understand compiler generated error messages + * to minimize project built time + * `Py++`_ has few modes of writing code into files: * single file @@ -141,9 +145,6 @@ * multiple files, where single class code is split to few files -* `Py++`_ will save your compilation time - it will rewrite a file, only in case - of change - * You have full control over generated code. Your code could be inserted almost anywhere. Modified: pyplusplus_dev/pyplusplus/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/__init__.py 2007-04-23 17:15:08 UTC (rev 1016) +++ pyplusplus_dev/pyplusplus/__init__.py 2007-04-24 17:31:08 UTC (rev 1017) @@ -15,11 +15,11 @@ in the headers. You can then modify (decorate) this tree to customize the bindings. After that, a I{code creators} tree is created where each node represents a block of C++ source code. So you can change any piece of -code befor it is written to disk. As a last step, these source code blocks are -finally written into one or more C++ source files, which can then be compiled to +code befor it is written to disk. As a last step, these source code blocks are +finally written into one or more C++ source files, which can then be compiled to generate the final Python module. -If you are just starting with U{Py++<http://www.language-binding.net>}, +If you are just starting with U{Py++<http://www.language-binding.net>}, then consider to read documentation of L{module_builder} package. """ @@ -34,7 +34,7 @@ from _logging_ import multi_line_formatter_t -__version__ = '0.8.6' +__version__ = '0.9.0' #Known issues: #3. @@ -46,7 +46,7 @@ #~ > > In one header file you define class, in an other you #~ > > define function that takes #~ > > as argument shared_ptr to the class. -#~ > +#~ > #~ > You don't need to use a shared_ptr holder for that purpose. The #~ > *only* reason you'd ever want to use a share_ptr holder is if you #~ > expect people to wrap functions taking non-const references to these Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2007-04-23 17:15:08 UTC (rev 1016) +++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2007-04-24 17:31:08 UTC (rev 1017) @@ -98,21 +98,21 @@ def set_overridable( self, overridable ): self._overridable = overridable - + overridable = property( get_overridable, set_overridable , doc = get_overridable.__doc__ ) - @property + @property def non_overridable_reason( self ): """returns the reason the function could not be overriden""" return self._non_overridable_reason def mark_as_non_overridable( self, reason ): """mark this function as non-overridable - + Not all fucntions could be overrided from Python, for example virtual function that returns non const reference to a member variable. Py++ allows you to - mark these functions and provide and explanation to the user. + mark these functions and provide and explanation to the user. """ self.overridable = False self._non_overridable_reason = messages.W0000 % reason @@ -129,7 +129,7 @@ def add_transformation(self, *transformer_creators, **keywd): """add new function transformation. - transformer_creators - list of transformer creators, which should be applied on the function + transformer_creators - list of transformer creators, which should be applied on the function keywd - keyword arguments for L{function_transformation_t} class initialization """ self.transformations.append( ft.function_transformation_t( self, transformer_creators, **keywd ) ) @@ -167,31 +167,31 @@ return False base = declarations.remove_pointer( type_ ) return declarations.is_pointer( base ) - + def suspicious_type( type_ ): if not declarations.is_reference( type_ ): return False type_no_ref = declarations.remove_reference( type_ ) return not declarations.is_const( type_no_ref ) \ - and ( declarations.is_fundamental( type_no_ref ) + and ( declarations.is_fundamental( type_no_ref ) or declarations.is_enum( type_no_ref ) ) msgs = [] #TODO: functions that takes as argument pointer to pointer to smth, could not be exported #see http://www.boost.org/libs/python/doc/v2/faq.html#funcptr - + if len( self.arguments ) > calldef_t.BOOST_PYTHON_MAX_ARITY: msgs.append( messages.W1007 % ( calldef_t.BOOST_PYTHON_MAX_ARITY, len( self.arguments ) ) ) - + if self.transformations: #if user defined transformation, than I think it took care of the problems ft = self.transformations[0] if ft.alias == ft.unique_name: msgs.append( messages.W1044 % ft.alias ) return msgs - + if suspicious_type( self.return_type ) and None is self.call_policies: msgs.append( messages.W1008 ) - + if ( declarations.is_pointer( self.return_type ) or is_double_ptr( self.return_type ) ) \ and None is self.call_policies: msgs.append( messages.W1050 % str(self.return_type) ) @@ -204,7 +204,7 @@ if False == self.overridable: msgs.append( self._non_overridable_reason) - + problematics = algorithm.registration_order.select_problematics( self ) if problematics: tmp = [] @@ -223,19 +223,23 @@ self._default_precall_code = [] def add_override_precall_code(self, code): + """add code, which should be executed, before overrided member function call""" self._override_precall_code.append( code ) - + @property def override_precall_code(self): + """code, which should be executed, before overrided member function call""" return self._override_precall_code - + def add_default_precall_code(self, code): + """add code, which should be executed, before this member function call""" self._default_precall_code.append( code ) - + @property def default_precall_code(self): + """code, which should be executed, before this member function call""" return self._default_precall_code - + def get_use_overload_macro(self): return self._use_overload_macro def set_use_overload_macro(self, use_macro): @@ -249,14 +253,14 @@ and self.virtuality == declarations.VIRTUALITY_TYPES.NOT_VIRTUAL: return messages.W1011 return '' - + def _readme_impl( self ): msgs = super( member_function_t, self )._readme_impl() if self.does_throw == False \ and self.virtuality != declarations.VIRTUALITY_TYPES.NOT_VIRTUAL: msgs.append( messages.W1046 ) return msgs - + class constructor_t( declarations.constructor_t, calldef_t ): """defines a set of properties, that will instruct Py++ how to expose the constructor""" def __init__(self, *arguments, **keywords): @@ -321,7 +325,7 @@ """helps Py++ to deal with C++ operators""" inplace = [ '+=', '-=', '*=', '/=', '%=', '>>=', '<<=', '&=', '^=', '|=' ] comparison = [ '==', '!=', '<', '>', '<=', '>=' ] - non_member = [ '+', '-', '*', '/', '%', '&', '^', '|', ] + non_member = [ '+', '-', '*', '/', '%', '&', '^', '|', ] unary = [ '!', '~', '+', '-' ] all = inplace + comparison + non_member + unary @@ -334,7 +338,7 @@ return False if oper.symbol != '<<': return oper.symbol in operators_helper.all - + args_len = len( oper.arguments ) if isinstance( oper, declarations.member_operator_t ):# and args_len != 1: return False #Boost.Python does not support member operator<< :-( @@ -377,18 +381,18 @@ def add_override_precall_code(self, code): self._override_precall_code.append( code ) - + @property def override_precall_code(self): return self._override_precall_code - + def add_default_precall_code(self, code): self._default_precall_code.append( code ) - + @property def default_precall_code(self): return self._default_precall_code - + def _get_alias( self): alias = super( member_operator_t, self )._get_alias() if alias == self.name: @@ -493,7 +497,7 @@ calldef_t.__init__( self ) self._use_overload_macro = False self._declaration_code = [] - + def add_declaration_code( self, code ): """adds the code to the declaration section""" self.declaration_code.append( user_text.user_text_t( code ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |