pygccxml-commit Mailing List for C++ Python language bindings (Page 4)
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...> - 2009-12-23 21:26:05
|
Revision: 1782
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1782&view=rev
Author: roman_yakovenko
Date: 2009-12-23 21:25:58 +0000 (Wed, 23 Dec 2009)
Log Message:
-----------
according to MSDN(http://msdn.microsoft.com/en-us/library/s2ff0fz8%28VS.100%29.aspx) conversion constructor is a constructor that could be called with one argument - this change implements this behaviour
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
pyplusplus_dev/unittests/casting_tester.py
pyplusplus_dev/unittests/data/casting_to_be_exported.hpp
Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
===================================================================
--- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-12-15 20:47:10 UTC (rev 1781)
+++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-12-23 21:25:58 UTC (rev 1782)
@@ -341,14 +341,14 @@
For more information see:
* http://boost.org/libs/python/doc/v2/implicit.html#implicitly_convertible-spec
-
* http://msdn2.microsoft.com/en-us/library/h1y7x448.aspx
+ * http://msdn.microsoft.com/en-us/library/s2ff0fz8%28VS.100%29.aspx
"""
if self.parent.is_abstract: #user is not able to create an instance of the class
return False
if self.is_copy_constructor:
return False
- if 1 != len( self.arguments ):
+ if 1 != len( self.required_args ):
return False
if self.parent.find_out_member_access_type( self ) != declarations.ACCESS_TYPES.PUBLIC:
return False
Modified: pyplusplus_dev/unittests/casting_tester.py
===================================================================
--- pyplusplus_dev/unittests/casting_tester.py 2009-12-15 20:47:10 UTC (rev 1781)
+++ pyplusplus_dev/unittests/casting_tester.py 2009-12-23 21:25:58 UTC (rev 1782)
@@ -28,6 +28,9 @@
self.failUnless( 0 == module.x_value(False) )
fv = module.float_vector( 5.0 )
+ cc = module.get_value_a( 78 );
+ self.failUnless( cc == -78 )
+
def create_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(tester_t))
Modified: pyplusplus_dev/unittests/data/casting_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/casting_to_be_exported.hpp 2009-12-15 20:47:10 UTC (rev 1781)
+++ pyplusplus_dev/unittests/data/casting_to_be_exported.hpp 2009-12-23 21:25:58 UTC (rev 1782)
@@ -8,6 +8,20 @@
namespace casting{
+struct conversion_constructor_t{
+ conversion_constructor_t( int a, int b=0 )
+ : value_a( a* (-1) ), value_b( b * (-1) )
+ {}
+ int value_a;
+ bool value_b;
+};
+
+int get_value_a( int a ){
+ conversion_constructor_t cc( a );
+ return cc.value_a;
+}
+
+
struct y{};
struct x{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-12-15 20:47:18
|
Revision: 1781
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1781&view=rev
Author: roman_yakovenko
Date: 2009-12-15 20:47:10 +0000 (Tue, 15 Dec 2009)
Log Message:
-----------
a few updates to FT input static matrix functionality
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/function_transformers/transformers.py
pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp
pyplusplus_dev/unittests/ft_input_static_matrix_tester.py
Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-12-15 20:44:50 UTC (rev 1780)
+++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-12-15 20:47:10 UTC (rev 1781)
@@ -569,7 +569,7 @@
return [ code_repository.convenience.file_name ]
def __configure_sealed(self, controller):
- global _seq2arr
+ global _pymatrix2cmatrix
w_arg = controller.find_wrapper_arg( self.arg.name )
w_arg.type = declarations.dummy_type_t( "boost::python::object" )
@@ -592,7 +592,7 @@
def __configure_v_mem_fun_default( self, controller ):
self.__configure_sealed( controller )
- def __configure_v_mem_fun_override( self, controller ):
+ def __configure_v_mem_fun_override( self, controller ):
global _arr2seq
pylist = controller.declare_py_variable( declarations.dummy_type_t( 'boost::python::list' )
, 'py_' + self.arg.name )
Modified: pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp 2009-12-15 20:44:50 UTC (rev 1780)
+++ pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp 2009-12-15 20:47:10 UTC (rev 1781)
@@ -12,16 +12,31 @@
namespace ft{
-int sum( int m[2][3] ){
+template< int rows, int columns >
+int sum_impl( const int m[rows][columns] ){
int result = 0;
- for( int r = 0; r < 2; ++r ){
- for( int c = 0; c < 3; ++c ){
+ for( int r = 0; r < rows; ++r ){
+ for( int c = 0; c < columns; ++c ){
result += m[r][c];
}
}
return result;
}
+int sum( int m[2][3]){
+ return sum_impl<2, 3>( m );
}
+int sum_const( int m[2][3]){
+ return sum_impl<2, 3>( m );
+}
+
+struct matrix_sum_t{
+ virtual int calculate( const int m[3][5] ) const{
+ return sum_impl<3,5>( m );
+ }
+};
+
+}
+
#endif//__ft_input_static_matrix_to_be_exported_hpp__
Modified: pyplusplus_dev/unittests/ft_input_static_matrix_tester.py
===================================================================
--- pyplusplus_dev/unittests/ft_input_static_matrix_tester.py 2009-12-15 20:44:50 UTC (rev 1780)
+++ pyplusplus_dev/unittests/ft_input_static_matrix_tester.py 2009-12-15 20:47:10 UTC (rev 1781)
@@ -23,8 +23,16 @@
def customize( self, mb ):
mb.global_ns.calldefs().create_with_signature = True
+ mb.free_funs( 'sum_impl' ).exclude()
+
sum = mb.free_fun( 'sum' )
sum.add_transformation( ft.input_static_matrix('m', rows=2, columns=3) )
+
+ sum = mb.free_funs( lambda d: d.name in ('sum', 'sum_const' ) )
+ sum.add_transformation( ft.input_static_matrix('m', rows=2, columns=3) )
+
+ calculate = mb.mem_fun( 'calculate' )
+ calculate.add_transformation( ft.input_static_matrix('m', rows=3, columns=5) )
def run_tests(self, module):
"""Run the actual unit tests"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-12-15 20:44:57
|
Revision: 1780
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1780&view=rev
Author: roman_yakovenko
Date: 2009-12-15 20:44:50 +0000 (Tue, 15 Dec 2009)
Log Message:
-----------
fix for "get dependencies" functionality
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/dependencies.py
pyplusplus_dev/pyplusplus/creators_factory/dependencies_manager.py
Modified: pygccxml_dev/pygccxml/declarations/dependencies.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/dependencies.py 2009-11-16 21:15:20 UTC (rev 1779)
+++ pygccxml_dev/pygccxml/declarations/dependencies.py 2009-12-15 20:44:50 UTC (rev 1780)
@@ -9,6 +9,28 @@
import cpptypes
+class impl_details:
+ @staticmethod
+ def dig_declarations( depend_on_it ):
+ #prevent recursive import
+ from pygccxml import declarations
+
+ if isinstance( depend_on_it, declarations.declaration_t ):
+ return [depend_on_it]
+ base_type = declarations.base_type( declarations.remove_alias( depend_on_it ) )
+ if isinstance( base_type, cpptypes.declarated_t ):
+ return [base_type.declaration]
+ elif isinstance( base_type, cpptypes.calldef_type_t ):
+ result = []
+ result.extend( impl_details.dig_declarations( base_type.return_type ) )
+ for argtype in base_type.arguments_types:
+ result.extend( impl_details.dig_declarations( argtype ) )
+ if isinstance( base_type, cpptypes.member_function_type_t ):
+ result.extend( impl_details.dig_declarations( base_type.class_inst ) )
+ return result
+ return []
+
+
class dependency_info_t( object ):
def __init__( self, declaration, depend_on_it, access_type=None, hint=None ):
object.__init__( self )
@@ -46,20 +68,12 @@
about dependency. It can be used later"""
return self._hint
- def find_out_depend_on_declaration( self ):
+ def find_out_depend_on_it_declarations( self ):
"""if declaration depends on other declaration and not on some type
this function will return reference to it. Otherwise None will be returned
"""
- #prevent recursive import
- from pygccxml import declarations
+ return impl_details.dig_declarations( self.depend_on_it )
- if isinstance( self.depend_on_it, declarations.declaration_t ):
- return self.depend_on_it
- base_type = declarations.base_type( declarations.remove_alias( self.depend_on_it ) )
- if isinstance( base_type, cpptypes.declarated_t ):
- return base_type.declaration
- return None
-
@staticmethod
def i_depend_on_them( decl ):
"""returns set of declarations. every item in the returned set, depends on a
@@ -67,9 +81,9 @@
import class_declaration #prevent cyclic imports
to_be_included = set()
for dependency_info in decl.i_depend_on_them():
- ddecl = dependency_info.find_out_depend_on_declaration()
- if ddecl:
- to_be_included.add( ddecl )
+ for ddecl in dependency_info.find_out_depend_on_it_declarations():
+ if ddecl:
+ to_be_included.add( ddecl )
if isinstance( decl.parent, class_declaration.class_t ):
to_be_included.add( decl.parent )
Modified: pyplusplus_dev/pyplusplus/creators_factory/dependencies_manager.py
===================================================================
--- pyplusplus_dev/pyplusplus/creators_factory/dependencies_manager.py 2009-11-16 21:15:20 UTC (rev 1779)
+++ pyplusplus_dev/pyplusplus/creators_factory/dependencies_manager.py 2009-12-15 20:44:50 UTC (rev 1780)
@@ -141,28 +141,30 @@
exported_ids = set( map( lambda d: id( d ), self.__exported_decls ) )
for decl in self.__exported_decls:
for dependency in self.__build_dependencies( decl ):
- depend_on_decl = dependency.find_out_depend_on_declaration()
- if self.__has_unexposed_dependency( exported_ids, depend_on_decl, dependency ):
- if messages.filter_disabled_msgs([messages.W1040], depend_on_decl.disabled_messages ):
- #need to report dependency errors
- used_not_exported.append(dependency)
+ for depend_on_decl in dependency.find_out_depend_on_it_declarations():
+ if self.__has_unexposed_dependency( exported_ids, depend_on_decl, dependency ):
+ if messages.filter_disabled_msgs([messages.W1040], depend_on_decl.disabled_messages ):
+ #need to report dependency errors
+ used_not_exported.append(dependency)
return used_not_exported
def __group_by_unexposed( self, dependencies ):
groups = {}
for dependency in dependencies:
- depend_on_decl = dependency.find_out_depend_on_declaration()
- if not groups.has_key( id( depend_on_decl ) ):
- groups[ id( depend_on_decl ) ] = []
- groups[ id( depend_on_decl ) ].append( dependency )
+ for depend_on_decl in dependency.find_out_depend_on_it_declarations():
+ if not groups.has_key( id( depend_on_decl ) ):
+ groups[ id( depend_on_decl ) ] = []
+ groups[ id( depend_on_decl ) ].append( dependency )
return groups
def __create_dependencies_msg( self, dependencies ):
- depend_on_decl = dependencies[0].find_out_depend_on_declaration()
- decls = []
- for dependency in dependencies:
- decls.append( os.linesep + ' ' + str( dependency.declaration ) )
- return "%s;%s" % ( depend_on_decl, messages.W1040 % ''.join( decls ) )
+ msg = []
+ for depend_on_decl in dependencies[0].find_out_depend_on_it_declarations():
+ decls = []
+ for dependency in dependencies:
+ decls.append( os.linesep + ' ' + str( dependency.declaration ) )
+ msg.append( "%s;%s" % ( depend_on_decl, messages.W1040 % ''.join( decls ) ) )
+ return os.linesep.join( msg )
def __report_duplicated_aliases( self ):
decls = filter( lambda decl: isinstance( decl, declarations.class_types ) \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-11-16 21:15:33
|
Revision: 1779
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1779&view=rev
Author: roman_yakovenko
Date: 2009-11-16 21:15:20 +0000 (Mon, 16 Nov 2009)
Log Message:
-----------
adding beginning of "input_static_matrix" tester
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/function_transformers/transformers.py
pyplusplus_dev/unittests/test_all.py
Added Paths:
-----------
pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp
pyplusplus_dev/unittests/ft_input_static_matrix_tester.py
Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-11-16 19:44:57 UTC (rev 1778)
+++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-11-16 21:15:20 UTC (rev 1779)
@@ -263,9 +263,10 @@
'pyplus_conv::copy_container( $native_array, $native_array + $array_size, pyplus_conv::list_inserter( $pylist ) );' )
_mat2seq = string.Template(
- 'for (int i=0; i<$matrix_size1; ++i) { boost::python::list ${pylist}_i; pyplus_conv::copy_container( $native_matrix[i], $native_matrix[i] + $matrix_size2, pyplus_conv::list_inserter( ${pylist}_i ) ); $pylist.append(${pylist}_i); }' )
+ 'for (int i=0; i<$rows; ++i) { boost::python::list ${pylist}_i; pyplus_conv::copy_container( $native_matrix[i], $native_matrix[i] + $columns, pyplus_conv::list_inserter( ${pylist}_i ) ); $pylist.append(${pylist}_i); }' )
+
class input_static_array_t(transformer.transformer_t):
"""Handles an input array with fixed size.
@@ -526,6 +527,13 @@
self.__configure_v_mem_fun_override( controller.override_controller )
self.__configure_v_mem_fun_default( controller.default_controller )
+_pymatrix2cmatrix = string.Template( os.linesep.join([
+ 'pyplus_conv::ensure_uniform_sequence< boost::python::list >( $pymatrix, $rows );'
+ , 'for( size_t $row = 0; $row < $rows; ++$row ){'
+ , ' pyplus_conv::ensure_uniform_sequence< $type >( $pymatrix[$row], $columns );'
+ , ' pyplus_conv::copy_sequence( $pymatrix[$row], pyplus_conv::array_inserter( $native_matrix[$row], $columns ) );'
+ , '}']))
+
# input_static_matrix_t
class input_static_matrix_t(transformer.transformer_t):
"""Handles an input matrix with fixed size.
@@ -534,11 +542,11 @@
# m must be a sequence of 3 sequences of 3 floats
"""
- def __init__(self, function, arg_ref, size1, size2):
+ def __init__(self, function, arg_ref, rows, columns):
"""Constructor.
- :param size1, size2: The fixed size of the input matrix
- :type size1, size2: int
+ :param rows, columns: The fixed size of the input matrix
+ :type rows, columns: int
"""
transformer.transformer_t.__init__( self, function )
@@ -549,12 +557,12 @@
raise ValueError( '%s\nin order to use "input_matrix" transformation, argument %s type must be a array or a pointer (got %s).' ) \
% ( function, self.arg.name, self.arg.type)
- self.matrix_size1 = size1
- self.matrix_size2 = size2
+ self.rows = rows
+ self.columns = columns
self.matrix_item_type = declarations.remove_const( declarations.array_item_type( declarations.array_item_type( self.arg.type ) ) )
def __str__(self):
- return "input_matrix(%s,%d,%d)"%( self.arg.name, self.matrix_size1, self.matrix_size2)
+ return "input_matrix(%s,%d,%d)"%( self.arg.name, self.rows, self.columns)
def required_headers( self ):
"""Returns list of header files that transformer generated code depends on."""
@@ -568,21 +576,17 @@
# Declare a variable that will hold the C matrix...
native_matrix = controller.declare_variable( self.matrix_item_type
, "native_" + self.arg.name
- , '[%d][%d]' % (self.matrix_size1, self.matrix_size2)
- )
+ , '[%d][%d]' % (self.rows, self.columns) )
- pre_call = string.Template('pyplus_conv::ensure_uniform_sequence< $type >( $pylist, $array_size );')
- controller.add_pre_call_code(pre_call.substitute(type='boost::python::list', pylist=w_arg.name,array_size=self.matrix_size1))
+ conversion_code = _pymatrix2cmatrix.substitute( type=self.matrix_item_type
+ , pymatrix=w_arg.name
+ , columns='%d' % self.columns
+ , row=controller.register_variable_name( "row" )
+ , rows='%d' % self.rows
+ , native_matrix=native_matrix )
- #TODO: may be a better idea is move this loop to the generated code.
- for i in range(0,self.matrix_size1):
- copy_pylist2arr = _seq2arr.substitute( type=self.matrix_item_type
- , pylist=w_arg.name+"["+str(i)+"]"
- , array_size=self.matrix_size2
- , native_array=native_matrix+'['+str(i)+']' )
+ controller.add_pre_call_code( conversion_code )
- controller.add_pre_call_code( copy_pylist2arr )
-
controller.modify_arg_expression( self.arg_index, native_matrix )
def __configure_v_mem_fun_default( self, controller ):
@@ -594,9 +598,9 @@
, 'py_' + self.arg.name )
#TODO: may be a better idea is move this loop to the generated code.
- for i in range(0, self.matrix_size1):
+ for i in range(0, self.rows):
copy_arr2pylist = _arr2seq.substitute( native_array=self.arg.name+'[%d]'%i
- , array_size=self.matrix_size2
+ , array_size=self.columns
, pylist=pylist )
controller.add_py_pre_call_code( copy_arr2pylist )
@@ -619,13 +623,13 @@
# m will be a sequence of 3 sequences of 3 floats
"""
- def __init__(self, function, arg_ref, size1, size2):
+ def __init__(self, function, arg_ref, rows, columns):
"""Constructor.
:param arg_ref: Index of the argument that is an output matrix
:type arg_ref: int
- :param size1, size2: The fixed size of the output matrix
- :type size1, size2: int
+ :param rows, columns: The fixed size of the output matrix
+ :type rows, columns: int
"""
transformer.transformer_t.__init__( self, function )
@@ -637,12 +641,12 @@
raise ValueError( '%s\nin order to use "output_matrix" transformation, argument %s type must be a array or a pointer (got %s).' ) \
% ( function, self.arg.name, self.arg.type)
- self.matrix_size1 = size1
- self.matrix_size2 = size2
+ self.rows = rows
+ self.columns = columns
self.matrix_item_type = declarations.remove_const( declarations.array_item_type( declarations.array_item_type( self.arg.type ) ) )
def __str__(self):
- return "output_matrix(%s,%d,%d)"%( self.arg.name, self.matrix_size1, self.matrix_size2)
+ return "output_matrix(%s,%d,%d)"%( self.arg.name, self.rows, self.columns)
def required_headers( self ):
"""Returns list of header files that transformer generated code depends on."""
@@ -656,7 +660,7 @@
# Declare a variable that will hold the C matrix...
native_matrix = controller.declare_variable( self.matrix_item_type
, "native_" + self.arg.name
- , '[%d][%d]' % (self.matrix_size1, self.matrix_size2)
+ , '[%d][%d]' % (self.rows, self.columns)
)
#adding just declared variable to the original function call expression
controller.modify_arg_expression( self.arg_index, native_matrix )
@@ -666,8 +670,8 @@
, 'py_' + self.arg.name )
copy_mat2pylist = _mat2seq.substitute( native_matrix = native_matrix,
- matrix_size1=self.matrix_size1,
- matrix_size2=self.matrix_size2,
+ rows=self.rows,
+ columns=self.columns,
pylist=pylist)
controller.add_post_call_code( copy_mat2pylist )
@@ -690,10 +694,10 @@
controller.add_py_post_call_code( get_ref_to_seq )
#TODO: may be a better idea is move this loop to the generated code.
- for i in range(0, self.matrix_size1):
+ for i in range(0, self.rows):
copy_pylist2arr = _seq2arr.substitute( type=self.matrix_item_type
, pylist=seq
- , array_size=self.matrix_size2
+ , array_size=self.columns
, native_array=self.arg.name+'[%d]'%i )
controller.add_py_post_call_code( copy_pylist2arr )
@@ -711,17 +715,17 @@
class inout_static_matrix_t(transformer.transformer_t):
"""Handles an input/output matrix with fixed size.
- transpose_matrix(double m[3][3]) -> m = transpose_matrix(object m)
- # m must be a sequence of 3 sequences of 3 floats
+ transpose_matrix(double m[2][3]) -> m = transpose_matrix(object m)
+ # m must be a sequence of 2 sequences of 3 floats
"""
- def __init__(self, function, arg_ref, size1, size2):
+ def __init__(self, function, arg_ref, rows, columns):
"""Constructor.
:param arg_ref: Index of the argument that is an input/output matrix
:type arg_ref: int
- :param size1,size2: The fixed size of the input/output matrix
- :type size1,size2: int
+ :param rows,columns: The fixed size of the input/output matrix
+ :type rows,columns: int
"""
transformer.transformer_t.__init__( self, function )
@@ -732,12 +736,12 @@
raise ValueError( '%s\nin order to use "inout_matrix" transformation, argument %s type must be a array or a pointer (got %s).' ) \
% ( function, self.arg.name, self.arg.type)
- self.matrix_size1 = size1
- self.matrix_size2 = size2
+ self.rows = rows
+ self.columns = columns
self.matrix_item_type = declarations.remove_const( declarations.array_item_type( declarations.array_item_type( self.arg.type ) ) )
def __str__(self):
- return "inout_matrix(%s,%d,%d)"%( self.arg.name, self.matrix_size1, self.matrix_size2)
+ return "inout_matrix(%s,%d,%d)"%( self.arg.name, self.rows, self.columns)
def required_headers( self ):
"""Returns list of header files that transformer generated code depends on."""
@@ -752,17 +756,17 @@
# Declare a variable that will hold the C matrix...
native_matrix = controller.declare_variable( self.matrix_item_type
, "native_" + self.arg.name
- , '[%d][%d]' % (self.matrix_size1, self.matrix_size2)
+ , '[%d][%d]' % (self.rows, self.columns)
)
pre_call = string.Template('pyplus_conv::ensure_uniform_sequence< $type >( $pylist, $array_size );')
- controller.add_pre_call_code(pre_call.substitute(type='boost::python::list', pylist=w_arg.name,array_size=self.matrix_size1))
+ controller.add_pre_call_code(pre_call.substitute(type='boost::python::list', pylist=w_arg.name,array_size=self.rows))
#TODO: may be a better idea is move this loop to the generated code.
- for i in range(0,self.matrix_size1):
+ for i in range(0,self.rows):
copy_pylist2arr = _seq2arr.substitute( type=self.matrix_item_type
, pylist=w_arg.name+"["+str(i)+"]"
- , array_size=self.matrix_size2
+ , array_size=self.columns
, native_array=native_matrix+'['+str(i)+']' )
controller.add_pre_call_code( copy_pylist2arr )
@@ -771,10 +775,10 @@
pylist = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" )
, 'py_' + self.arg.name )
- copy_mat2pylist = _mat2seq.substitute( native_matrix = native_matrix,
- matrix_size1=self.matrix_size1,
- matrix_size2=self.matrix_size2,
- pylist=pylist)
+ copy_mat2pylist = _mat2seq.substitute( native_matrix = native_matrix
+ , rows=self.rows
+ , columns=self.columns
+ , pylist=pylist)
controller.add_post_call_code( copy_mat2pylist )
@@ -790,8 +794,8 @@
, 'py_' + self.arg.name )
copy_mat2pylist = _mat2seq.substitute( native_matrix=self.arg.name
- , matrix_size1=self.matrix_size1
- , matrix_size2=self.matrix_size2
+ , rows=self.rows
+ , columns=self.columns
, pylist=pylist )
controller.add_py_pre_call_code( copy_arr2pylist )
Added: pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp (rev 0)
+++ pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp 2009-11-16 21:15:20 UTC (rev 1779)
@@ -0,0 +1,27 @@
+// Copyright 2004-2008 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 __ft_input_static_matrix_to_be_exported_hpp__
+#define __ft_input_static_matrix_to_be_exported_hpp__
+
+#include <cmath>
+#include <string>
+#include <iostream>
+
+namespace ft{
+
+int sum( int m[2][3] ){
+ int result = 0;
+ for( int r = 0; r < 2; ++r ){
+ for( int c = 0; c < 3; ++c ){
+ result += m[r][c];
+ }
+ }
+ return result;
+}
+
+}
+
+#endif//__ft_input_static_matrix_to_be_exported_hpp__
Added: pyplusplus_dev/unittests/ft_input_static_matrix_tester.py
===================================================================
--- pyplusplus_dev/unittests/ft_input_static_matrix_tester.py (rev 0)
+++ pyplusplus_dev/unittests/ft_input_static_matrix_tester.py 2009-11-16 21:15:20 UTC (rev 1779)
@@ -0,0 +1,43 @@
+# Copyright 2004-2008 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 os
+import sys
+import math
+import unittest
+import fundamental_tester_base
+from pygccxml import declarations
+from pyplusplus import function_transformers as ft
+from pyplusplus.module_builder import call_policies
+
+class tester_t(fundamental_tester_base.fundamental_tester_base_t):
+ EXTENSION_NAME = 'ft_input_static_matrix'
+
+ def __init__( self, *args ):
+ fundamental_tester_base.fundamental_tester_base_t.__init__(
+ self
+ , tester_t.EXTENSION_NAME
+ , *args )
+
+ def customize( self, mb ):
+ mb.global_ns.calldefs().create_with_signature = True
+ sum = mb.free_fun( 'sum' )
+ sum.add_transformation( ft.input_static_matrix('m', rows=2, columns=3) )
+
+ def run_tests(self, module):
+ """Run the actual unit tests"""
+ m = [ [1, 2, 3], [4,5,6] ]
+ self.failUnless( 21 == module.sum( m ) )
+
+def create_suite():
+ suite = unittest.TestSuite()
+ suite.addTest( unittest.makeSuite(tester_t))
+ return suite
+
+def run_suite():
+ unittest.TextTestRunner(verbosity=2).run( create_suite() )
+
+if __name__ == "__main__":
+ run_suite()
Modified: pyplusplus_dev/unittests/test_all.py
===================================================================
--- pyplusplus_dev/unittests/test_all.py 2009-11-16 19:44:57 UTC (rev 1778)
+++ pyplusplus_dev/unittests/test_all.py 2009-11-16 21:15:20 UTC (rev 1779)
@@ -122,6 +122,7 @@
#import ogre_generate_tester
import ft_from_address
import indexing_suites2_support_tester
+import ft_input_static_matrix
testers = [
algorithms_tester
@@ -232,6 +233,7 @@
, selection_bug_tester
, ft_from_address
, indexing_suites2_support_tester
+ , ft_input_static_matrix
# , ogre_generate_tester too much time
]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-11-16 19:45:04
|
Revision: 1778
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1778&view=rev
Author: roman_yakovenko
Date: 2009-11-16 19:44:57 +0000 (Mon, 16 Nov 2009)
Log Message:
-----------
adding documentation for from_address transformation
Added Paths:
-----------
pyplusplus_dev/docs/documentation/functions/transformation/from_address.rest
Added: pyplusplus_dev/docs/documentation/functions/transformation/from_address.rest
===================================================================
--- pyplusplus_dev/docs/documentation/functions/transformation/from_address.rest (rev 0)
+++ pyplusplus_dev/docs/documentation/functions/transformation/from_address.rest 2009-11-16 19:44:57 UTC (rev 1778)
@@ -0,0 +1,97 @@
+============================
+``from_address`` transformer
+============================
+
+----------
+Definition
+----------
+
+"from_address" transformer allows integration with :mod:`ctypes` package.
+Basically it handles the translation between ``size_t`` value, which
+represents a pointer to some data and the exposed code. Thus you can
+use :mod:`ctypes` package to create the data and than pass it to the
+`Boost.Python`_ exposed function.
+
+
+"from_address" transformer takes as first argument name or index of the
+"data" argument. The argument should have "reference" or "pointer" type.
+
+-------
+Example
+-------
+
+.. code-block:: c++
+
+ unsigned long
+ sum_matrix( unsigned int* matrix, unsigned int rows, unsigned int columns ){
+ if( !matrix ){
+ throw std::runtime_error( "matrix is null" );
+ }
+ unsigned long result = 0;
+ for( unsigned int r = 0; r < rows; ++r ){
+ for( unsigned int c = 0; c < columns; ++c ){
+ result += *matrix;
+ ++matrix;
+ }
+ }
+ return result;
+ }
+
+In order to expose ``sum_matrix`` function we need to create a small wrapper.
+The following :doc:`Py++ <../../../pyplusplus>` code does it for you:
+
+ .. code-block:: python
+
+ from pyplusplus import module_builder
+ from pyplusplus import function_transformers as FT
+
+ mb = module_builder.module_builder_t( ... )
+ mb.free_function( 'sum_matrix' ).add_transformation( FT.from_address( 0 ) )
+
+What you see below is the relevant pieces of generated code:
+
+ .. code-block:: c++
+
+ static boost::python::object sum_matrix_515b62fca9176ae4fffaf5fb118855dc( unsigned int matrix, unsigned int rows, unsigned int columns ){
+ long unsigned int result = ::sum_matrix(reinterpret_cast< unsigned int * >( matrix ), rows, columns);
+ return bp::object( result );
+ }
+
+ BOOST_PYTHON_MODULE(...){
+ { //::sum_matrix
+
+ typedef boost::python::object ( *sum_matrix_function_type )( unsigned int,unsigned int,unsigned int );
+
+ bp::def(
+ "sum_matrix"
+ , sum_matrix_function_type( &sum_matrix_515b62fca9176ae4fffaf5fb118855dc )
+ , ( bp::arg("matrix"), bp::arg("rows"), bp::arg("columns") )
+ , "documentation" );
+ }
+ }
+
+And now the Python usage example:
+
+ .. code-block:: python
+
+ import ctypes
+ import mymodule
+
+ rows = 10
+ columns = 7
+ matrix_type = ctypes.c_uint * columns * rows
+ sum = 0
+ counter = 0
+ matrix = matrix_type()
+ for r in range( rows ):
+ for c in range( columns ):
+ matrix[r][c] = counter
+ sum += counter
+ counter += 1
+ result = module.sum_matrix( ctypes.addressof( matrix ), rows, columns )
+
+
+.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html
+.. _`Python`: http://www.python.org
+.. _`GCC-XML`: http://www.gccxml.org
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-11-16 19:43:18
|
Revision: 1777
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1777&view=rev
Author: roman_yakovenko
Date: 2009-11-16 19:43:10 +0000 (Mon, 16 Nov 2009)
Log Message:
-----------
making ft_from_address_tester to pass
Modified Paths:
--------------
pyplusplus_dev/unittests/ft_from_address_tester.py
Property Changed:
----------------
pyplusplus_dev/unittests/
Property changes on: pyplusplus_dev/unittests
___________________________________________________________________
Modified: svn:ignore
- *.pyc
temp
+ *.pyc
temp
.sconsign.dblite
Modified: pyplusplus_dev/unittests/ft_from_address_tester.py
===================================================================
--- pyplusplus_dev/unittests/ft_from_address_tester.py 2009-11-16 19:40:43 UTC (rev 1776)
+++ pyplusplus_dev/unittests/ft_from_address_tester.py 2009-11-16 19:43:10 UTC (rev 1777)
@@ -49,13 +49,11 @@
double_ptr_type = ctypes.POINTER( ctypes.c_double )
value = double_ptr_type.from_address( ptr.value )
self.failUnless( value.contents.value == 5.9 )
- dd = double_ptr_type(ctypes.c_double(0.0) )
- print dir( ctypes.pointer( dd ).contents )
-
- ptr.get_v_address( ctypes.pointer( dd ).contents.value )
- print ptr.value
- print dd.contents.value
+ d_ptr = double_ptr_type(ctypes.c_double(0.0) )
+ d_ptr_ptr = ctypes.pointer( d_ptr )
+ ptr.get_v_address( ctypes.addressof( d_ptr ) )
+
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...> - 2009-11-16 19:40:49
|
Revision: 1776
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1776&view=rev
Author: roman_yakovenko
Date: 2009-11-16 19:40:43 +0000 (Mon, 16 Nov 2009)
Log Message:
-----------
ignoring "binary" directories
Property Changed:
----------------
pyplusplus_dev/unittests/data/ctypes/circular_references/
pyplusplus_dev/unittests/data/ctypes/templates/
pyplusplus_dev/unittests/data/ctypes/varargs/
pyplusplus_dev/unittests/data/ctypes/variables/
Property changes on: pyplusplus_dev/unittests/data/ctypes/circular_references
___________________________________________________________________
Added: svn:ignore
+ binaries
Property changes on: pyplusplus_dev/unittests/data/ctypes/templates
___________________________________________________________________
Added: svn:ignore
+ binaries
Property changes on: pyplusplus_dev/unittests/data/ctypes/varargs
___________________________________________________________________
Added: svn:ignore
+ binaries
Property changes on: pyplusplus_dev/unittests/data/ctypes/variables
___________________________________________________________________
Added: svn:ignore
+ binaries
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-11-16 19:37:48
|
Revision: 1775
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1775&view=rev
Author: roman_yakovenko
Date: 2009-11-16 19:37:39 +0000 (Mon, 16 Nov 2009)
Log Message:
-----------
adding new test case
Modified Paths:
--------------
pyplusplus_dev/unittests/test_all.py
Added Paths:
-----------
pyplusplus_dev/unittests/data/indexing_suites2_support_to_be_exported.hpp
pyplusplus_dev/unittests/indexing_suites2_support_tester.py
Added: pyplusplus_dev/unittests/data/indexing_suites2_support_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/indexing_suites2_support_to_be_exported.hpp (rev 0)
+++ pyplusplus_dev/unittests/data/indexing_suites2_support_to_be_exported.hpp 2009-11-16 19:37:39 UTC (rev 1775)
@@ -0,0 +1,21 @@
+// Copyright 2004-2008 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>
+
+struct foo{
+ int bar;
+};
+
+typedef std::vector< foo > foo_vector;
+
+foo_vector get_foos(){
+ return foo_vector();
+}
+
+#endif//__indexing_suites2_to_be_exported_hpp__
Added: pyplusplus_dev/unittests/indexing_suites2_support_tester.py
===================================================================
--- pyplusplus_dev/unittests/indexing_suites2_support_tester.py (rev 0)
+++ pyplusplus_dev/unittests/indexing_suites2_support_tester.py 2009-11-16 19:37:39 UTC (rev 1775)
@@ -0,0 +1,48 @@
+# Copyright 2004-2008 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 os
+import sys
+import unittest
+import fundamental_tester_base
+from pygccxml import declarations
+from pyplusplus import module_builder
+
+
+class tester_t(fundamental_tester_base.fundamental_tester_base_t):
+ EXTENSION_NAME = 'indexing_suites2_support'
+
+ def __init__( self, *args ):
+ fundamental_tester_base.fundamental_tester_base_t.__init__(
+ self
+ , tester_t.EXTENSION_NAME
+ , indexing_suite_version=2
+ , *args)
+
+ def customize(self, generator):
+ fvector = generator.global_ns.typedef( 'foo_vector' )
+ fvector = declarations.remove_declarated( fvector.type )
+ fvector.indexing_suite.call_policies \
+ = module_builder.call_policies.return_internal_reference()
+
+ def run_tests( self, module):
+ v = module.foo_vector()
+ f = module.foo()
+ f.bar = 0
+ v.append(f)
+ self.failUnless( v[0].bar == 0 )
+ v[0].bar = 10
+ self.failUnless( v[0].bar == 10 )
+
+def create_suite():
+ suite = unittest.TestSuite()
+ suite.addTest( unittest.makeSuite(tester_t))
+ return suite
+
+def run_suite():
+ unittest.TextTestRunner(verbosity=2).run( create_suite() )
+
+if __name__ == "__main__":
+ run_suite()
Modified: pyplusplus_dev/unittests/test_all.py
===================================================================
--- pyplusplus_dev/unittests/test_all.py 2009-11-05 22:56:49 UTC (rev 1774)
+++ pyplusplus_dev/unittests/test_all.py 2009-11-16 19:37:39 UTC (rev 1775)
@@ -120,7 +120,8 @@
import function_adaptor_tester
import selection_bug_tester
#import ogre_generate_tester
-import ft_from_address
+import ft_from_address
+import indexing_suites2_support_tester
testers = [
algorithms_tester
@@ -229,7 +230,8 @@
, return_ref_to_ptr_tester
, function_adaptor_tester
, selection_bug_tester
- , ft_from_address
+ , ft_from_address
+ , indexing_suites2_support_tester
# , ogre_generate_tester too much time
]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-11-05 22:57:01
|
Revision: 1774
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1774&view=rev
Author: roman_yakovenko
Date: 2009-11-05 22:56:49 +0000 (Thu, 05 Nov 2009)
Log Message:
-----------
misc: adding new documentation for from_address transformation
Modified Paths:
--------------
pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest
pyplusplus_dev/unittests/ft_from_address_tester.py
pyplusplus_dev/unittests/test_all.py
Modified: pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest
===================================================================
--- pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2009-11-04 22:08:12 UTC (rev 1773)
+++ pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2009-11-05 22:56:49 UTC (rev 1774)
@@ -94,6 +94,7 @@
output_static_array.rest
transfer_ownership.rest
input_c_buffer.rest
+ from_address.rest
Modified: pyplusplus_dev/unittests/ft_from_address_tester.py
===================================================================
--- pyplusplus_dev/unittests/ft_from_address_tester.py 2009-11-04 22:08:12 UTC (rev 1773)
+++ pyplusplus_dev/unittests/ft_from_address_tester.py 2009-11-05 22:56:49 UTC (rev 1774)
@@ -51,6 +51,7 @@
self.failUnless( value.contents.value == 5.9 )
dd = double_ptr_type(ctypes.c_double(0.0) )
print dir( ctypes.pointer( dd ).contents )
+
ptr.get_v_address( ctypes.pointer( dd ).contents.value )
print ptr.value
print dd.contents.value
Modified: pyplusplus_dev/unittests/test_all.py
===================================================================
--- pyplusplus_dev/unittests/test_all.py 2009-11-04 22:08:12 UTC (rev 1773)
+++ pyplusplus_dev/unittests/test_all.py 2009-11-05 22:56:49 UTC (rev 1774)
@@ -120,6 +120,7 @@
import function_adaptor_tester
import selection_bug_tester
#import ogre_generate_tester
+import ft_from_address
testers = [
algorithms_tester
@@ -228,6 +229,7 @@
, return_ref_to_ptr_tester
, function_adaptor_tester
, selection_bug_tester
+ , ft_from_address
# , ogre_generate_tester too much time
]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-11-04 22:08:20
|
Revision: 1773
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1773&view=rev
Author: roman_yakovenko
Date: 2009-11-04 22:08:12 +0000 (Wed, 04 Nov 2009)
Log Message:
-----------
commit new function transformers from Beno?\195?\174t Leveau
Modified Paths:
--------------
pyplusplus_dev/docs/history/history.rest
pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
pyplusplus_dev/pyplusplus/function_transformers/__init__.py
pyplusplus_dev/pyplusplus/function_transformers/transformers.py
pyplusplus_dev/unittests/member_variables_tester.py
Modified: pyplusplus_dev/docs/history/history.rest
===================================================================
--- pyplusplus_dev/docs/history/history.rest 2009-11-04 20:24:32 UTC (rev 1772)
+++ pyplusplus_dev/docs/history/history.rest 2009-11-04 22:08:12 UTC (rev 1773)
@@ -25,6 +25,7 @@
* Andrei Vermel
* Carsten( spom.spom )
* Pertti Kellomäki
+* Benoît Leveau
-----------
SVN Version
@@ -53,6 +54,18 @@
7. The bug related to transformed virtual function was fixed. Many thanks to Pertti Kellomäki.
+8. Thanks to Benoît Leveau, the "Function Transformation" documentation
+ is much better now.
+
+9. The following transformers were added:
+
+ * ``inout_static_array``
+ * ``input_static_matrix``
+ * ``output_static_matrix``
+ * ``inout_static_matrix``
+
+ Many thanks to Benoît Leveau.
+
-----------
Version 1.0
-----------
Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
===================================================================
--- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-11-04 20:24:32 UTC (rev 1772)
+++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-11-04 22:08:12 UTC (rev 1773)
@@ -160,6 +160,11 @@
return ''
def _exportable_impl( self ):
+ if self.transformations:
+ #It is possible that the function asked for the user attention.
+ #The user paid attention and created a transformation.
+ #Py++ should be silent in this case.
+ return ''
if not self.parent.name:
return messages.W1057 % str( self )
all_types = [ arg.type for arg in self.arguments ]
Modified: pyplusplus_dev/pyplusplus/function_transformers/__init__.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/__init__.py 2009-11-04 20:24:32 UTC (rev 1772)
+++ pyplusplus_dev/pyplusplus/function_transformers/__init__.py 2009-11-04 22:08:12 UTC (rev 1773)
@@ -30,7 +30,27 @@
def creator( function ):
return transformers.output_static_array_t( function, *args, **keywd )
return creator
+
+def inout_static_array( *args, **keywd ):
+ def creator( function ):
+ return transformers.inout_static_array_t( function, *args, **keywd )
+ return creator
+def input_static_matrix( *args, **keywd ):
+ def creator( function ):
+ return transformers.input_static_matrix_t( function, *args, **keywd )
+ return creator
+
+def output_static_matrix( *args, **keywd ):
+ def creator( function ):
+ return transformers.output_static_matrix_t( function, *args, **keywd )
+ return creator
+
+def inout_static_matrix( *args, **keywd ):
+ def creator( function ):
+ return transformers.inout_static_matrix_t( function, *args, **keywd )
+ return creator
+
def modify_type( *args, **keywd ):
def creator( function ):
return transformers.type_modifier_t( function, *args, **keywd )
Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-11-04 20:24:32 UTC (rev 1772)
+++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-11-04 22:08:12 UTC (rev 1773)
@@ -165,7 +165,7 @@
def __str__(self):
return "input(%s)"%(self.arg.name)
-# input_t
+# from_address_t
class from_address_t(type_modifier_t):
"""Handles a single input variable.
@@ -193,6 +193,7 @@
def __str__(self):
return "from_address(%s)"%(self.arg.name)
+# inout_t
class inout_t(transformer.transformer_t):
"""Handles a single input/output variable.
@@ -261,6 +262,10 @@
_arr2seq = string.Template(
'pyplus_conv::copy_container( $native_array, $native_array + $array_size, pyplus_conv::list_inserter( $pylist ) );' )
+_mat2seq = string.Template(
+ 'for (int i=0; i<$matrix_size1; ++i) { boost::python::list ${pylist}_i; pyplus_conv::copy_container( $native_matrix[i], $native_matrix[i] + $matrix_size2, pyplus_conv::list_inserter( ${pylist}_i ) ); $pylist.append(${pylist}_i); }' )
+
+
class input_static_array_t(transformer.transformer_t):
"""Handles an input array with fixed size.
@@ -430,7 +435,378 @@
self.__configure_v_mem_fun_override( controller.override_controller )
self.__configure_v_mem_fun_default( controller.default_controller )
+# inout_static_array_t
+class inout_static_array_t(transformer.transformer_t):
+ """Handles an input/output array with fixed size.
+ void do_something(double* v) -> v2 = do_something(object v2)
+
+ where v2 is a Python sequence
+ """
+
+ def __init__(self, function, arg_ref, size):
+ """Constructor.
+
+ :param arg_ref: Index of the argument that is an input/output array
+ :type arg_ref: int
+ :param size: The fixed size of the input/output array
+ :type size: int
+ """
+ transformer.transformer_t.__init__( self, function )
+
+ self.arg = self.get_argument( arg_ref )
+ self.arg_index = self.function.arguments.index( self.arg )
+
+ if not is_ptr_or_array( self.arg.type ):
+ raise ValueError( '%s\nin order to use "inout_array" transformation, argument %s type must be a array or a pointer (got %s).' ) \
+ % ( function, self.arg.name, self.arg.type)
+
+ self.array_size = size
+ self.array_item_type = declarations.remove_const( declarations.array_item_type( self.arg.type ) )
+
+ def __str__(self):
+ return "inout_array(%s,%d)"%( self.arg.name, self.array_size)
+
+ def required_headers( self ):
+ """Returns list of header files that transformer generated code depends on."""
+ return [ code_repository.convenience.file_name ]
+
+ def __configure_sealed(self, controller):
+ global _seq2arr
+ global _arr2seq
+ w_arg = controller.find_wrapper_arg( self.arg.name )
+ w_arg.type = declarations.dummy_type_t( "boost::python::object" )
+
+ # Declare a variable that will hold the C array...
+ native_array = controller.declare_variable( self.array_item_type
+ , "native_" + self.arg.name
+ , '[%d]' % self.array_size )
+
+ copy_pylist2arr = _seq2arr.substitute( type=self.array_item_type
+ , pylist=w_arg.name
+ , array_size=self.array_size
+ , native_array=native_array )
+
+ controller.add_pre_call_code( copy_pylist2arr )
+ controller.modify_arg_expression( self.arg_index, native_array )
+
+ # Declare a Python list which will receive the output...
+ pylist = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" )
+ , 'py_' + self.arg.name )
+
+ copy_arr2pylist = _arr2seq.substitute( native_array=native_array
+ , array_size=self.array_size
+ , pylist=pylist )
+ controller.add_post_call_code( copy_arr2pylist )
+
+ #adding the variable to return variables list
+ controller.return_variable( pylist )
+
+ def __configure_v_mem_fun_default( self, controller ):
+ self.__configure_sealed( controller )
+
+ def __configure_v_mem_fun_override( self, controller ):
+ global _arr2seq
+ pylist = controller.declare_py_variable( declarations.dummy_type_t( 'boost::python::list' )
+ , 'py_' + self.arg.name )
+
+ copy_arr2pylist = _arr2seq.substitute( native_array=self.arg.name
+ , array_size=self.array_size
+ , pylist=pylist )
+
+ controller.add_py_pre_call_code( copy_arr2pylist )
+
+ def configure_mem_fun( self, controller ):
+ self.__configure_sealed( controller )
+
+ def configure_free_fun(self, controller ):
+ self.__configure_sealed( controller )
+
+ def configure_virtual_mem_fun( self, controller ):
+ self.__configure_v_mem_fun_override( controller.override_controller )
+ self.__configure_v_mem_fun_default( controller.default_controller )
+
+# input_static_matrix_t
+class input_static_matrix_t(transformer.transformer_t):
+ """Handles an input matrix with fixed size.
+
+ is_identity(double m[3][3]) -> is_identity(object m)
+ # m must be a sequence of 3 sequences of 3 floats
+ """
+
+ def __init__(self, function, arg_ref, size1, size2):
+ """Constructor.
+
+ :param size1, size2: The fixed size of the input matrix
+ :type size1, size2: int
+ """
+ transformer.transformer_t.__init__( self, function )
+
+ self.arg = self.get_argument( arg_ref )
+ self.arg_index = self.function.arguments.index( self.arg )
+
+ if not is_ptr_or_array( self.arg.type ):
+ raise ValueError( '%s\nin order to use "input_matrix" transformation, argument %s type must be a array or a pointer (got %s).' ) \
+ % ( function, self.arg.name, self.arg.type)
+
+ self.matrix_size1 = size1
+ self.matrix_size2 = size2
+ self.matrix_item_type = declarations.remove_const( declarations.array_item_type( declarations.array_item_type( self.arg.type ) ) )
+
+ def __str__(self):
+ return "input_matrix(%s,%d,%d)"%( self.arg.name, self.matrix_size1, self.matrix_size2)
+
+ def required_headers( self ):
+ """Returns list of header files that transformer generated code depends on."""
+ return [ code_repository.convenience.file_name ]
+
+ def __configure_sealed(self, controller):
+ global _seq2arr
+ w_arg = controller.find_wrapper_arg( self.arg.name )
+ w_arg.type = declarations.dummy_type_t( "boost::python::object" )
+
+ # Declare a variable that will hold the C matrix...
+ native_matrix = controller.declare_variable( self.matrix_item_type
+ , "native_" + self.arg.name
+ , '[%d][%d]' % (self.matrix_size1, self.matrix_size2)
+ )
+
+ pre_call = string.Template('pyplus_conv::ensure_uniform_sequence< $type >( $pylist, $array_size );')
+ controller.add_pre_call_code(pre_call.substitute(type='boost::python::list', pylist=w_arg.name,array_size=self.matrix_size1))
+
+ #TODO: may be a better idea is move this loop to the generated code.
+ for i in range(0,self.matrix_size1):
+ copy_pylist2arr = _seq2arr.substitute( type=self.matrix_item_type
+ , pylist=w_arg.name+"["+str(i)+"]"
+ , array_size=self.matrix_size2
+ , native_array=native_matrix+'['+str(i)+']' )
+
+ controller.add_pre_call_code( copy_pylist2arr )
+
+ controller.modify_arg_expression( self.arg_index, native_matrix )
+
+ def __configure_v_mem_fun_default( self, controller ):
+ self.__configure_sealed( controller )
+
+ def __configure_v_mem_fun_override( self, controller ):
+ global _arr2seq
+ pylist = controller.declare_py_variable( declarations.dummy_type_t( 'boost::python::list' )
+ , 'py_' + self.arg.name )
+
+ #TODO: may be a better idea is move this loop to the generated code.
+ for i in range(0, self.matrix_size1):
+ copy_arr2pylist = _arr2seq.substitute( native_array=self.arg.name+'[%d]'%i
+ , array_size=self.matrix_size2
+ , pylist=pylist )
+
+ controller.add_py_pre_call_code( copy_arr2pylist )
+
+ def configure_mem_fun( self, controller ):
+ self.__configure_sealed( controller )
+
+ def configure_free_fun(self, controller ):
+ self.__configure_sealed( controller )
+
+ def configure_virtual_mem_fun( self, controller ):
+ self.__configure_v_mem_fun_override( controller.override_controller )
+ self.__configure_v_mem_fun_default( controller.default_controller )
+
+# output_static_matrix_t
+class output_static_matrix_t(transformer.transformer_t):
+ """Handles an output matrix with fixed size.
+
+ get_matrix(double m[3][3]) -> m = get_matrix()
+ # m will be a sequence of 3 sequences of 3 floats
+ """
+
+ def __init__(self, function, arg_ref, size1, size2):
+ """Constructor.
+
+ :param arg_ref: Index of the argument that is an output matrix
+ :type arg_ref: int
+ :param size1, size2: The fixed size of the output matrix
+ :type size1, size2: int
+
+ """
+ transformer.transformer_t.__init__( self, function )
+
+ self.arg = self.get_argument( arg_ref )
+ self.arg_index = self.function.arguments.index( self.arg )
+
+ if not is_ptr_or_array( self.arg.type ):
+ raise ValueError( '%s\nin order to use "output_matrix" transformation, argument %s type must be a array or a pointer (got %s).' ) \
+ % ( function, self.arg.name, self.arg.type)
+
+ self.matrix_size1 = size1
+ self.matrix_size2 = size2
+ self.matrix_item_type = declarations.remove_const( declarations.array_item_type( declarations.array_item_type( self.arg.type ) ) )
+
+ def __str__(self):
+ return "output_matrix(%s,%d,%d)"%( self.arg.name, self.matrix_size1, self.matrix_size2)
+
+ def required_headers( self ):
+ """Returns list of header files that transformer generated code depends on."""
+ return [ code_repository.convenience.file_name ]
+
+ def __configure_sealed(self, controller):
+ global _mat2seq
+ #removing arg from the function wrapper definition
+ controller.remove_wrapper_arg( self.arg.name )
+
+ # Declare a variable that will hold the C matrix...
+ native_matrix = controller.declare_variable( self.matrix_item_type
+ , "native_" + self.arg.name
+ , '[%d][%d]' % (self.matrix_size1, self.matrix_size2)
+ )
+ #adding just declared variable to the original function call expression
+ controller.modify_arg_expression( self.arg_index, native_matrix )
+
+ # Declare a Python list which will receive the output...
+ pylist = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" )
+ , 'py_' + self.arg.name )
+
+ copy_mat2pylist = _mat2seq.substitute( native_matrix = native_matrix,
+ matrix_size1=self.matrix_size1,
+ matrix_size2=self.matrix_size2,
+ pylist=pylist)
+
+ controller.add_post_call_code( copy_mat2pylist )
+
+ #adding the variable to return variables list
+ controller.return_variable( pylist )
+
+ def __configure_v_mem_fun_default( self, controller ):
+ self.__configure_sealed( controller )
+
+ def __configure_v_mem_fun_override( self, controller ):
+ global _seq2arr
+ seq = controller.declare_py_variable( declarations.dummy_type_t( 'boost::python::object' )
+ , 'py_' + self.arg.name )
+ controller.remove_py_arg( self.arg_index )
+ tmpl = string.Template( '$seq = pyplus_conv::get_out_argument( $py_result, "$name" );' )
+ get_ref_to_seq = tmpl.substiture( seq=seq
+ , py_result=controller.py_result_variable_name
+ , name=self.arg.name )
+ controller.add_py_post_call_code( get_ref_to_seq )
+
+ #TODO: may be a better idea is move this loop to the generated code.
+ for i in range(0, self.matrix_size1):
+ copy_pylist2arr = _seq2arr.substitute( type=self.matrix_item_type
+ , pylist=seq
+ , array_size=self.matrix_size2
+ , native_array=self.arg.name+'[%d]'%i )
+ controller.add_py_post_call_code( copy_pylist2arr )
+
+ def configure_mem_fun( self, controller ):
+ self.__configure_sealed( controller )
+
+ def configure_free_fun(self, controller ):
+ self.__configure_sealed( controller )
+
+ def configure_virtual_mem_fun( self, controller ):
+ self.__configure_v_mem_fun_override( controller.override_controller )
+ self.__configure_v_mem_fun_default( controller.default_controller )
+
+# inout_static_matrix_t
+class inout_static_matrix_t(transformer.transformer_t):
+ """Handles an input/output matrix with fixed size.
+
+ transpose_matrix(double m[3][3]) -> m = transpose_matrix(object m)
+ # m must be a sequence of 3 sequences of 3 floats
+ """
+
+ def __init__(self, function, arg_ref, size1, size2):
+ """Constructor.
+
+ :param arg_ref: Index of the argument that is an input/output matrix
+ :type arg_ref: int
+ :param size1,size2: The fixed size of the input/output matrix
+ :type size1,size2: int
+ """
+ transformer.transformer_t.__init__( self, function )
+
+ self.arg = self.get_argument( arg_ref )
+ self.arg_index = self.function.arguments.index( self.arg )
+
+ if not is_ptr_or_array( self.arg.type ):
+ raise ValueError( '%s\nin order to use "inout_matrix" transformation, argument %s type must be a array or a pointer (got %s).' ) \
+ % ( function, self.arg.name, self.arg.type)
+
+ self.matrix_size1 = size1
+ self.matrix_size2 = size2
+ self.matrix_item_type = declarations.remove_const( declarations.array_item_type( declarations.array_item_type( self.arg.type ) ) )
+
+ def __str__(self):
+ return "inout_matrix(%s,%d,%d)"%( self.arg.name, self.matrix_size1, self.matrix_size2)
+
+ def required_headers( self ):
+ """Returns list of header files that transformer generated code depends on."""
+ return [ code_repository.convenience.file_name ]
+
+ def __configure_sealed(self, controller):
+ global _seq2arr
+ global _mat2seq
+ w_arg = controller.find_wrapper_arg( self.arg.name )
+ w_arg.type = declarations.dummy_type_t( "boost::python::object" )
+
+ # Declare a variable that will hold the C matrix...
+ native_matrix = controller.declare_variable( self.matrix_item_type
+ , "native_" + self.arg.name
+ , '[%d][%d]' % (self.matrix_size1, self.matrix_size2)
+ )
+
+ pre_call = string.Template('pyplus_conv::ensure_uniform_sequence< $type >( $pylist, $array_size );')
+ controller.add_pre_call_code(pre_call.substitute(type='boost::python::list', pylist=w_arg.name,array_size=self.matrix_size1))
+
+ #TODO: may be a better idea is move this loop to the generated code.
+ for i in range(0,self.matrix_size1):
+ copy_pylist2arr = _seq2arr.substitute( type=self.matrix_item_type
+ , pylist=w_arg.name+"["+str(i)+"]"
+ , array_size=self.matrix_size2
+ , native_array=native_matrix+'['+str(i)+']' )
+
+ controller.add_pre_call_code( copy_pylist2arr )
+
+ controller.modify_arg_expression( self.arg_index, native_matrix )
+
+ pylist = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" )
+ , 'py_' + self.arg.name )
+ copy_mat2pylist = _mat2seq.substitute( native_matrix = native_matrix,
+ matrix_size1=self.matrix_size1,
+ matrix_size2=self.matrix_size2,
+ pylist=pylist)
+
+ controller.add_post_call_code( copy_mat2pylist )
+
+ #adding the variable to return variables list
+ controller.return_variable( pylist )
+
+ def __configure_v_mem_fun_default( self, controller ):
+ self.__configure_sealed( controller )
+
+ def __configure_v_mem_fun_override( self, controller ):
+ global _mat2seq
+ pylist = controller.declare_py_variable( declarations.dummy_type_t( 'boost::python::list' )
+ , 'py_' + self.arg.name )
+
+ copy_mat2pylist = _mat2seq.substitute( native_matrix=self.arg.name
+ , matrix_size1=self.matrix_size1
+ , matrix_size2=self.matrix_size2
+ , pylist=pylist )
+
+ controller.add_py_pre_call_code( copy_arr2pylist )
+
+ def configure_mem_fun( self, controller ):
+ self.__configure_sealed( controller )
+
+ def configure_free_fun(self, controller ):
+ self.__configure_sealed( controller )
+
+ def configure_virtual_mem_fun( self, controller ):
+ self.__configure_v_mem_fun_override( controller.override_controller )
+ self.__configure_v_mem_fun_default( controller.default_controller )
+
+# input_c_buffer_t
class input_c_buffer_t(transformer.transformer_t):
"""
handles an input of C buffer:
@@ -523,7 +899,6 @@
self.__configure_v_mem_fun_override( controller.override_controller )
self.__configure_v_mem_fun_default( controller.default_controller )
-
class transfer_ownership_t(type_modifier_t):
"""see http://boost.org/libs/python/doc/v2/faq.html#ownership
"""
Modified: pyplusplus_dev/unittests/member_variables_tester.py
===================================================================
--- pyplusplus_dev/unittests/member_variables_tester.py 2009-11-04 20:24:32 UTC (rev 1772)
+++ pyplusplus_dev/unittests/member_variables_tester.py 2009-11-04 22:08:12 UTC (rev 1773)
@@ -55,23 +55,6 @@
self.failUnless( bf.b == module.get_b( bf ) )
self.failIfNotRaisesAny( lambda: self.set_b( bf, 23 ) )
- array = module.array_t()
- self.failUnless( len( array.vars ) == 3 )
- for i in range( len( array.vars ) ):
- self.failUnless( array.vars[i].value == -9 )
- self.failUnless( len( array.ivars ) == 10 )
-
- ivars = array.ivars
- del array #testing call policies
- for i in range(20):
- for index in range(10):
- self.failUnless( ivars[index] == -index )
-
- array = module.array_t()
- for index in range( len(array.ivars) ):
- array.ivars[index] = index * index
- self.failUnless( array.get_ivars_item( index ) == index * index )
-
tree = module.create_tree()
self.failUnless( tree.parent is None )
self.failUnless( tree.data.value == 0 )
@@ -109,6 +92,24 @@
data = data_type.from_address( module.image_t.none_image )
self.failUnless( 1997 == data.contents.value )
+ array = module.array_t()
+ self.failUnless( len( array.ivars ) == 10 )
+
+ ivars = array.ivars
+ del array #testing call policies
+ for i in range(20):
+ for index in range(10):
+ self.failUnless( ivars[index] == -index )
+
+ array = module.array_t()
+ for index in range( len(array.ivars) ):
+ array.ivars[index] = index * index
+ self.failUnless( array.get_ivars_item( index ) == index * index )
+
+ self.failUnless( len( array.vars ) == 3 )
+ for i in range( len( array.vars ) ):
+ self.failUnless( array.vars[i].value == -9 )
+
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...> - 2009-11-04 20:24:46
|
Revision: 1772
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1772&view=rev
Author: roman_yakovenko
Date: 2009-11-04 20:24:32 +0000 (Wed, 04 Nov 2009)
Log Message:
-----------
commit documentation patch from Beno?\195?\174t Leveau
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/function_transformers/controllers.py
pyplusplus_dev/pyplusplus/function_transformers/transformers.py
Modified: pyplusplus_dev/pyplusplus/function_transformers/controllers.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/controllers.py 2009-10-31 19:56:45 UTC (rev 1771)
+++ pyplusplus_dev/pyplusplus/function_transformers/controllers.py 2009-11-04 20:24:32 UTC (rev 1772)
@@ -42,7 +42,7 @@
@property
def initialize_expr( self ):
- "inirialize expression"
+ "initialize expression"
return self.__initialize_expr
def declare_var_string( self ):
@@ -79,8 +79,10 @@
:param name: name( str ) of the variable
:param initialize_expr: an expression that initialize the variable
+
+ :returns: the variable name, which is unique in a whole scope, based on "name" argument
- :rtype: the unique variable name
+ :rtype: str
"""
unique_name = self.__create_unique_var_name( name )
self.__variables.append( variable_t( type, unique_name, initialize_expr ) )
Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-10-31 19:56:45 UTC (rev 1771)
+++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-11-04 20:24:32 UTC (rev 1772)
@@ -38,7 +38,7 @@
The specified variable is removed from the argument list and is turned
into a return value.
- void getValue(int& v) -> v = getValue()
+ void get_value(int& v) -> v = get_value()
"""
def __init__(self, function, arg_ref):
@@ -47,7 +47,7 @@
The specified argument must be a reference or a pointer.
- :param arg_ref: Index of the argument that is an output value.
+ :param arg_ref: Index of the argument that is an output value
:type arg_ref: int
"""
self.arg = self.get_argument( arg_ref )
@@ -106,8 +106,10 @@
def __init__(self, function, arg_ref, modifier):
"""Constructor.
- modifier is callable, which take the type of the argument and should return
- new type
+ modifier is callable, which take the type of the argument and should return new type
+
+ :param arg_ref: Index of the argument which will be transformed
+ :type arg_ref: int
"""
transformer.transformer_t.__init__( self, function )
self.arg = self.get_argument( arg_ref )
@@ -151,8 +153,8 @@
def __init__(self, function, arg_ref):
"""
- :param idx: Index of the argument that is an output value.
- :type idx: int
+ :param arg_ref: Index of the argument that is an input value
+ :type arg_ref: int
"""
type_modifier_t.__init__( self, function, arg_ref, remove_ref_or_ptr )
@@ -178,8 +180,8 @@
The specified argument must be a reference or a pointer.
- :param idx: Index of the argument that is an output value.
- :type idx: int
+ :param arg_ref: Index of the argument that is an output value
+ :type arg_ref: int
"""
modifier = lambda type_: declarations.FUNDAMENTAL_TYPES[ 'unsigned int' ]
type_modifier_t.__init__( self, function, arg_ref, modifier )
@@ -202,8 +204,8 @@
The specified argument must be a reference or a pointer.
- :param idx: Index of the argument that is an in/out value
- :type idx: int
+ :param arg_ref: Index of the argument that is an in/out value
+ :type arg_ref: int
"""
transformer.transformer_t.__init__( self, function )
self.arg = self.get_argument( arg_ref )
@@ -270,7 +272,9 @@
def __init__(self, function, arg_ref, size):
"""Constructor.
- :param size: The fixed size of the input array
+ :param arg_ref: Index of the argument that is an input array
+ :type arg_ref: int
+ :param size: The fixed size of the input array
:type size: int
"""
transformer.transformer_t.__init__( self, function )
@@ -340,15 +344,15 @@
class output_static_array_t(transformer.transformer_t):
"""Handles an output array of a fixed size.
- void getVec3(double* v) -> v = getVec3()
+ void get_vec3(double* v) -> v = get_vec3()
# v will be a list with 3 floats
"""
def __init__(self, function, arg_ref, size):
"""Constructor.
- :param idx: Index of the argument that is an output array.
- :type idx: int
+ :param arg_ref: Index of the argument that is an output array
+ :type arg_ref: int
:param size: The fixed size of the output array
:type size: int
"""
@@ -357,7 +361,7 @@
self.arg_index = self.function.arguments.index( self.arg )
if not is_ptr_or_array( self.arg.type ):
- raise ValueError( '%s\nin order to use "input_array" transformation, argument %s type must be a array or a pointer (got %s).' ) \
+ raise ValueError( '%s\nin order to use "output_array" transformation, argument %s type must be a array or a pointer (got %s).' ) \
% ( function, self.arg.name, self.arg.type)
self.array_size = size
@@ -524,12 +528,16 @@
"""see http://boost.org/libs/python/doc/v2/faq.html#ownership
"""
def __init__(self, function, arg_ref):
- """Constructor."""
+ """Constructor.
+
+ :param arg_ref: Index of the argument on which to transfer ownership
+ :type arg_ref: int
+ """
transformer.transformer_t.__init__( self, function )
self.arg = self.get_argument( arg_ref )
self.arg_index = self.function.arguments.index( self.arg )
if not declarations.is_pointer( self.arg.type ):
- raise ValueError( '%s\nin order to use "transfer ownership" transformation, argument %s type must be a pointer (got %s).' ) \
+ raise ValueError( '%s\nin order to use "transfer_ownership" transformation, argument %s type must be a pointer (got %s).' ) \
% ( function, self.arg_ref.name, arg.type)
def __str__(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-31 19:56:53
|
Revision: 1771
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1771&view=rev
Author: roman_yakovenko
Date: 2009-10-31 19:56:45 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
misc: adding new test case for pre/post call functionality for FT
Modified Paths:
--------------
pyplusplus_dev/unittests/function_transformations_tester.py
Modified: pyplusplus_dev/unittests/function_transformations_tester.py
===================================================================
--- pyplusplus_dev/unittests/function_transformations_tester.py 2009-10-04 21:26:45 UTC (rev 1770)
+++ pyplusplus_dev/unittests/function_transformations_tester.py 2009-10-31 19:56:45 UTC (rev 1771)
@@ -53,7 +53,10 @@
point3d.add_wrapper_code( '' )
point3d.mem_fun( 'initialize' ).add_transformation( ft.input_static_array(0, size=3) )
point3d.mem_fun( 'position' ).add_transformation( ft.output_static_array(0, size=3) )
- point3d.mem_fun( 'distance' ).add_transformation( ft.output(1) )
+ distance = point3d.mem_fun( 'distance' )
+ distance.add_transformation( ft.output(1) )
+ distance.transformations[0].controller.add_pre_call_code( '//dddddddddddddd' )
+ distance.transformations[0].controller.add_post_call_code( '//qqqqqqqqqqqqq' )
image = mb.class_( "image_t" )
image.always_expose_using_scope = True
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-04 21:27:14
|
Revision: 1770
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1770&view=rev
Author: roman_yakovenko
Date: 2009-10-04 21:26:45 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
removing dead code
Removed Paths:
-------------
pyplusplus_dev/examples/pyeasybmp_dev/ctypes/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-04 21:18:07
|
Revision: 1769
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1769&view=rev
Author: roman_yakovenko
Date: 2009-10-04 21:17:36 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
remove dead code
Removed Paths:
-------------
pyplusplus_dev/contrib/templates/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-04 21:11:36
|
Revision: 1768
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1768&view=rev
Author: roman_yakovenko
Date: 2009-10-04 21:11:13 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
adding missing code
Added Paths:
-----------
gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/5.8/adaptation.patch
Added: gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/5.8/adaptation.patch
===================================================================
--- gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/5.8/adaptation.patch (rev 0)
+++ gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/5.8/adaptation.patch 2009-10-04 21:11:13 UTC (rev 1768)
@@ -0,0 +1,168 @@
+Common subdirectories: ./iso and ../result/iso
+diff -r -u ./istream ../result/istream
+--- ./istream Fri Nov 16 16:40:47 2007
++++ ../result/istream Fri Nov 16 15:22:16 2007
+@@ -419,9 +419,11 @@
+ const istream_iterator<T,charT,traits,Distance>& x,
+ const istream_iterator<T,charT,traits,Distance>& y);
+ #else
+- friend inline bool operator== <> (
++/* SMOSS 29/08/07 inline not allowed in friend declaration */
++ friend /*inline*/ bool operator== <> (
+ const istream_iterator<T,charT,traits,Distance>& x,
+ const istream_iterator<T,charT,traits,Distance>& y);
++/* END SMOSS 29/08/07 inline not allowed in friend declaration */
+ #endif
+ public:
+ typedef charT char_type;
+diff -r -u ./math.h ../result/math.h
+--- ./math.h Fri Nov 16 17:25:29 2007
++++ ../result/math.h Fri Nov 16 15:22:16 2007
+@@ -313,6 +313,11 @@
+ #endif
+ /* END adopted by C99 */
+
++/* SMOSS 29/08/07 <floatingpoint.h> conflicts with stdlib_iso.h */
++#ifdef __EXTENSIONS__
++# undef __EXTENSIONS__
++#endif //__EXTENSIONS__
++/* END SMOSS 29/08/07 <floatingpoint.h> conflicts with stdlib_iso.h */
+ #if defined(__EXTENSIONS__) || !defined(__cplusplus)
+ #include <floatingpoint.h>
+ #endif
+@@ -319,6 +324,11 @@
+ #endif /* defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE) */
+ #endif /* defined(__EXTENSIONS__) || defined(_XOPEN_SOURCE) || ... */
+
++/* SMOSS 29/08/07 <floatingpoint.h> conflicts with stdlib_iso.h */
++#ifdef __EXTENSIONS__
++# define __EXTENSIONS__
++#endif //__EXTENSIONS__
++/* END SMOSS 29/08/07 <floatingpoint.h> conflicts with stdlib_iso.h */
+ #if defined(__cplusplus) && defined(__GNUC__)
+ #undef exception
+ #endif
+Common subdirectories: ./rw and ../result/rw
+diff -r -u ./streambuf ../result/streambuf
+--- ./streambuf Fri Nov 16 16:40:47 2007
++++ ../result/streambuf Fri Nov 16 15:22:16 2007
+@@ -927,7 +927,10 @@
+ * int_type snextc()
+ * returns the next character
+ */
+-
++/* SMOSS 29/08/07 Can't use typename in template specializations */
++#ifdef _TYPENAME
++# define _TYPENAME
++#endif
+ inline _TYPENAME basic_streambuf<char, char_traits<char> >::int_type
+ basic_streambuf<char, char_traits<char> >::snextc()
+ {
+@@ -1208,6 +1211,11 @@
+ {
+ return seekpos(sp, which);
+ }
++#ifdef _TYPENAME
++# define _TYPENAME typename
++# undef _OLD_TYPENAME
++#endif
++/* END SMOSS 29/08/07 Can't use typename in template specializations */
+
+ /*
+ * basic_streambuf *pubsetbuf(char_type *, streamsize)
+diff -r -u ./string ../result/string
+--- ./string Fri Nov 16 16:40:47 2007
++++ ../result/string Fri Nov 16 15:22:16 2007
+@@ -797,7 +797,9 @@
+ // Null string ref
+ //
+ #ifndef _RWSTD_NO_STATIC_DEF3
+- static __SUNW_GLOBAL const __null_ref_type __nullref;
++/* SMOSS 29/08/07 Can't resolve #define __SUNW_GLOBAL __global */
++ static /* __SUNW_GLOBAL */ const __null_ref_type __nullref;
++/* SMOSS 29/08/07 Can't resolve #define __SUNW_GLOBAL __global */
+ #endif
+
+ static __string_ref_type * __getNullRep ()
+Common subdirectories: ./sys and ../result/sys
+diff -r -u ./typeinfo ../result/typeinfo
+--- ./typeinfo Fri Nov 16 16:40:47 2007
++++ ../result/typeinfo Fri Nov 16 15:22:16 2007
+@@ -34,7 +34,8 @@
+ // Implementation
+ const void* __data;
+ type_info(const void*) throw();
+- friend __Cimpl::__type_info_friend;
++ /* SMOSS 29/08/07 Can't resolve */
++ //friend __Cimpl::__type_info_friend;
+ };
+
+ class bad_typeid: public exception {
+diff -r -u ./iso/stdlib_iso.h ../result/iso/stdlib_iso.h
+--- ./iso/stdlib_iso.h Fri Nov 16 16:40:47 2007
++++ ../result/iso/stdlib_iso.h Fri Nov 16 15:22:16 2007
+@@ -110,8 +110,10 @@
+ extern double atof(const char *);
+ extern int atoi(const char *);
+ extern long int atol(const char *);
++/* SMOSS 29/08/07
+ extern void *bsearch(const void *, const void *, size_t, size_t,
+ int (*)(const void *, const void *));
++*/
+ #if __cplusplus >= 199711L
+ extern "C++" {
+ void *bsearch(const void *, const void *, size_t, size_t,
+@@ -131,7 +133,6 @@
+ extern size_t mbstowcs(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
+ size_t);
+ extern int mbtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t);
+-extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+ #if __cplusplus >= 199711L
+ extern "C++" {
+ void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+diff -r -u ./rw/iterator ../result/rw/iterator
+--- ./rw/iterator Fri Nov 16 17:03:59 2007
++++ ../result/rw/iterator Fri Nov 16 15:22:16 2007
+@@ -426,10 +426,12 @@
+ friend inline difference_type (std::operator-) (const self& x, const self& y);
+ friend inline self (std::operator+) (difference_type n, const self& x);
+ #else
+- friend inline bool operator== <> (const self& x, const self& y);
+- friend inline bool operator< <> (const self& x, const self& y);
+- friend inline difference_type operator- <> (const self& x, const self& y);
+- friend inline self operator+ <> (difference_type n, const self& x);
++/* SMOSS 29/08/07 removing 'inline' from friend declarations */
++ friend /*inline*/ bool operator== <> (const self& x, const self& y);
++ friend /*inline*/ bool operator< <> (const self& x, const self& y);
++ friend /*inline*/ difference_type operator- <> (const self& x, const self& y);
++ friend /*inline*/ self operator+ <> (difference_type n, const self& x);
++/* END SMOSS 29/08/07 removing 'inline' from friend declarations */
+ #endif
+ protected:
+
+@@ -581,7 +583,9 @@
+ typedef Reference reference;
+ typedef Pointer pointer;
+
+- friend inline bool operator== <> (const self& x, const self& y);
++/* SMOSS 29/08/07 removing 'inline' from friend declarations */
++ friend /*inline*/ bool operator== <> (const self& x, const self& y);
++/* END SMOSS 29/08/07 removing 'inline' from friend declarations */
+
+ protected:
+
+diff -r -u ./sys/regset.h ../result/sys/regset.h
+--- ./sys/regset.h Fri Nov 16 16:40:47 2007
++++ ../result/sys/regset.h Fri Nov 16 15:22:16 2007
+@@ -16,7 +16,10 @@
+ #pragma ident "@(#)regset.h 1.28 04/09/28 SMI" /* SVr4.0 1.1 */
+
+ #include <sys/feature_tests.h>
+-
++/* SMOSS 29/08/07 */
++//#include <inttypes.h>
++typedef long long unsigned int uint64_t;
++/* end SMOSS 29/08/08 */
+ #if !defined(_ASM)
+ #include <sys/int_types.h>
+ #endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-04 20:28:25
|
Revision: 1767
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1767&view=rev
Author: roman_yakovenko
Date: 2009-10-04 20:28:17 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
removing dead files
Removed Paths:
-------------
pyplusplus_dev/docs/osdc2006/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-04 20:03:01
|
Revision: 1766
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1766&view=rev
Author: roman_yakovenko
Date: 2009-10-04 20:02:50 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
adding missing code
Added Paths:
-----------
gccxml_bin/v09/linux2/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h
gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/5.8/
gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/README
gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/adapt_headers.sh
gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/find_flags
Added: gccxml_bin/v09/linux2/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h
===================================================================
--- gccxml_bin/v09/linux2/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h (rev 0)
+++ gccxml_bin/v09/linux2/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h 2009-10-04 20:02:50 UTC (rev 1766)
@@ -0,0 +1,181 @@
+#define __builtin_apply(x,y,z) ((void*)0)
+#define __builtin_nan(x) (0.0)
+#define __builtin_nanf(x) (0.0f)
+#define __builtin_nanl(x) (0.0l)
+#define __builtin_huge_val(x) (0.0)
+#define __builtin_huge_valf(x) (0.0f)
+#define __builtin_huge_vall(x) (0.0l)
+#define __builtin_apply_args(x) ((void*)0)
+#define __builtin_types_compatible_p(x,y) 0
+#define __builtin_choose_expr(x,y,z) int
+#define __builtin_constant_p(x) 0
+void* __builtin_memchr(void const*, int, unsigned int);
+void __builtin_return (void *RESULT);
+void * __builtin_return_address (unsigned int LEVEL);
+void * __builtin_frame_address (unsigned int LEVEL);
+long __builtin_expect (long EXP, long C);
+void __builtin_prefetch (const void *ADDR, ...);
+double __builtin_inf (void);
+float __builtin_inff (void);
+long double __builtin_infl (void);
+double __builtin_nans (const char *str);
+float __builtin_nansf (const char *str);
+long double __builtin_nansl (const char *str);
+double __builtin_acos(double);
+float __builtin_acosf(float);
+long double __builtin_acosl(long double);
+double __builtin_asin(double);
+float __builtin_asinf(float);
+long double __builtin_asinl(long double);
+double __builtin_atan(double);
+double __builtin_atan2(double, double);
+float __builtin_atan2f(float, float);
+long double __builtin_atan2l(long double, long double);
+float __builtin_atanf(float);
+long double __builtin_atanl(long double);
+double __builtin_ceil(double);
+float __builtin_ceilf(float);
+long double __builtin_ceill(long double);
+double __builtin_cos(double);
+float __builtin_cosf(float);
+double __builtin_cosh(double);
+float __builtin_coshf(float);
+long double __builtin_coshl(long double);
+long double __builtin_cosl(long double);
+double __builtin_exp(double);
+float __builtin_expf(float);
+long double __builtin_expl(long double);
+double __builtin_fabs(double);
+float __builtin_fabsf(float);
+long double __builtin_fabsl(long double);
+double __builtin_floor(double);
+float __builtin_floorf(float);
+long double __builtin_floorl(long double);
+float __builtin_fmodf(float, float);
+long double __builtin_fmodl(long double, long double);
+double __builtin_frexp(double, int*);
+float __builtin_frexpf(float, int*);
+long double __builtin_frexpl(long double, int*);
+double __builtin_ldexp(double, int);
+float __builtin_ldexpf(float, int);
+long double __builtin_ldexpl(long double, int);
+double __builtin_log(double);
+double __builtin_log10(double);
+float __builtin_log10f(float);
+long double __builtin_log10l(long double);
+float __builtin_logf(float);
+long double __builtin_logl(long double);
+float __builtin_modff(float, float*);
+long double __builtin_modfl(long double, long double*);
+float __builtin_powf(float, float);
+long double __builtin_powl(long double, long double);
+double __builtin_powi(double, int);
+float __builtin_powif(float, int);
+long double __builtin_powil(long double, int);
+double __builtin_sin(double);
+float __builtin_sinf(float);
+double __builtin_sinh(double);
+float __builtin_sinhf(float);
+long double __builtin_sinhl(long double);
+long double __builtin_sinl(long double);
+double __builtin_sqrt(double);
+float __builtin_sqrtf(float);
+long double __builtin_sqrtl(long double);
+double __builtin_tan(double);
+float __builtin_tanf(float);
+double __builtin_tanh(double);
+float __builtin_tanhf(float);
+long double __builtin_tanhl(long double);
+long double __builtin_tanl(long double);
+float __builtin_cabsf(float __complex__);
+double __builtin_cabs(double __complex__);
+long double __builtin_cabsl(long double __complex__);
+float __builtin_cargf(float __complex__);
+double __builtin_carg(double __complex__);
+long double __builtin_cargl(long double __complex__);
+int __builtin_ctz(int);
+int __builtin_ctzl(long);
+int __builtin_ctzll(long long);
+int __builtin_popcount(int);
+int __builtin_popcountl(long);
+int __builtin_popcountll(long long);
+float __complex__ __builtin_ccosf(float __complex__);
+double __complex__ __builtin_ccos(double __complex__);
+long double __complex__ __builtin_ccosl(long double __complex__);
+float __complex__ __builtin_ccoshf(float __complex__);
+double __complex__ __builtin_ccosh(double __complex__);
+long double __complex__ __builtin_ccoshl(long double __complex__);
+float __complex__ __builtin_cexpf(float __complex__);
+double __complex__ __builtin_cexp(double __complex__);
+long double __complex__ __builtin_cexpl(long double __complex__);
+float __complex__ __builtin_clogf(float __complex__);
+double __complex__ __builtin_clog(double __complex__);
+long double __complex__ __builtin_clogl(long double __complex__);
+float __complex__ __builtin_csinf(float __complex__);
+double __complex__ __builtin_csin(double __complex__);
+long double __complex__ __builtin_csinl(long double __complex__);
+float __complex__ __builtin_csinhf(float __complex__);
+double __complex__ __builtin_csinh(double __complex__);
+long double __complex__ __builtin_csinhl(long double __complex__);
+float __complex__ __builtin_csqrtf(float __complex__);
+double __complex__ __builtin_csqrt(double __complex__);
+long double __complex__ __builtin_csqrtl(long double __complex__);
+float __complex__ __builtin_ctanf(float __complex__);
+double __complex__ __builtin_ctan(double __complex__);
+long double __complex__ __builtin_ctanl(long double __complex__);
+float __complex__ __builtin_ctanhf(float __complex__);
+double __complex__ __builtin_ctanh(double __complex__);
+long double __complex__ __builtin_ctanhl(long double __complex__);
+float __complex__ __builtin_cpowf(float __complex__, float __complex__);
+double __complex__ __builtin_cpow(double __complex__, double __complex__);
+long double __complex__ __builtin_cpowl(long double __complex__, long double __complex__);
+
+/* The GCC 4.3 parser hard-codes handling of these, so they do not
+ have real signatures. */
+bool __builtin_isfinite(...);
+bool __builtin_isinf(...);
+bool __builtin_isnan(...);
+bool __builtin_isnormal(...);
+bool __builtin_isgreater(...);
+bool __builtin_isgreaterequal(...);
+bool __builtin_isless(...);
+bool __builtin_islessequal(...);
+bool __builtin_islessgreater(...);
+bool __builtin_isunordered(...);
+
+/*
+
+GCC 4.3 has the following additional builtin compile-time constant
+expressions:
+
+ __builtin_va_arg ( assignment-expression , type-id )
+ __builtin_offsetof ( type-id , offsetof-expression )
+
+ __has_nothrow_assign(T)
+ __has_nothrow_constructor(T)
+ __has_nothrow_copy(T)
+ __has_trivial_assign(T)
+ __has_trivial_constructor(T)
+ __has_trivial_copy(T)
+ __has_trivial_destructor(T)
+ __has_virtual_destructor(T)
+ __is_abstract(T)
+ __is_base_of(Tbase,Tderived)
+ __is_class(T)
+ __is_convertible_to(Tfrom,Tto)
+ __is_empty(T)
+ __is_enum(T)
+ __is_pod(T)
+ __is_polymorphic(T)
+ __is_union(T)
+
+In order to really support these we would have to update GCC-XML's
+internal parser to be GCC 4.3. Since this has not yet been done we
+get most of the way by defining some of these as macros with fake
+answers. It is enough to get through GCC 4.3's C++98 standard
+library.
+*/
+
+#define __is_pod(x) false
+#define __is_empty(x) false
+#define __has_trivial_destructor(x) false
Added: gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/README
===================================================================
--- gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/README (rev 0)
+++ gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/README 2009-10-04 20:02:50 UTC (rev 1766)
@@ -0,0 +1,8 @@
+Sun CC support contributed by Pierre-Olivier Gaillard
+
+This is a small README file regarding gccxml support for Solaris and Sun CC 5.8.
+
+The Sun CC headers are not suitable for GCC and need to be adapted. The adapted files may not be redistributed freely. This forces you to perform the following operations:
+ ./adapt_headers.sh
+
+This will produce corrected header files in the 5.8 directory.
Added: gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/adapt_headers.sh
===================================================================
--- gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/adapt_headers.sh (rev 0)
+++ gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/adapt_headers.sh 2009-10-04 20:02:50 UTC (rev 1766)
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+INCLUDES=/usr/include
+CC_INCLUDES=`find_flags | perl -ne '($a) = m|-I([/a-zA-Z0-9_-]+/include/CC)|o ; print "$a\n" if $a'`
+
+cd 5.8
+
+cp $INCLUDES/math.h .
+cp $CC_INCLUDES/typeinfo .
+cp $CC_INCLUDES/Cstd/istream .
+cp $CC_INCLUDES/Cstd/streambuf .
+cp $CC_INCLUDES/Cstd/string .
+
+mkdir -p rw
+mkdir -p sys
+mkdir -p iso
+
+cp $CC_INCLUDES/Cstd/rw/iterator rw/iterator
+cp $INCLUDES/iso/stdio_iso.h iso
+cp $INCLUDES/iso/stdlib_iso.h iso
+
+cp $INCLUDES/sys/regset.h sys
+
+patch -p1 < adaptation.patch
Added: gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/find_flags
===================================================================
--- gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/find_flags (rev 0)
+++ gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/find_flags 2009-10-04 20:02:50 UTC (rev 1766)
@@ -0,0 +1,69 @@
+#!/bin/sh
+#=============================================================================
+#
+# Program: GCC-XML
+# Module: $RCSfile: find_flags,v $
+# Language: C++
+# Date: $Date: 2007/11/28 19:52:06 $
+# Version: $Revision: 1.1 $
+#
+# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
+# See Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even
+# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the above copyright notices for more information.
+#
+#=============================================================================
+# Find the CC executable name.
+if test "x$1" = "x" ; then
+ if test "x${CXX}" = "x" ; then
+ CXX=CC
+ fi
+else
+ CXX="$1"
+ shift
+ CXXFLAGS="$@"
+fi
+
+GCCXML_PID="$$"
+cat > "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" <<!
+#include <>
+!
+
+# Find the macro definition options.
+MACROS=`${CXX} /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc -E -xdumpmacros=defs 2>&1 |
+ awk '{ if ($1 ~ /#define/) printf("-D%s=%s %s %s ",$2,$3,$4,$5) }'
+ `
+MACROS="-D__cplusplus=199711L -D__STDC__ -D_REENTRANT $MACROS"
+
+# Find the include path options.
+#todo test for truss
+INCLUDES=`truss -f -t openat ${CXX} -E /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc 2>&1 |
+ awk '{if ($3 ~ /\"[A-Za-z0-9_\/.-]+\",/ && $3 !~ /tmp/)
+ if (tempString!=substr($3,2,length($3)-3))
+ {
+ tempString=substr($3,2,length($3)-3);
+ printf("-I%s ",tempString)
+ }
+ }'`
+
+#cleanup
+rm -rf "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc"
+
+# The support headers are located where this script is.
+SELFPATH=`echo $0 | sed -n '/\//{s/\/find_flags//;p;}'`
+if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi
+SELFPATH=`cd "$SELFPATH" ; pwd`
+
+# Find CC version
+CC_VERSION=`${CXX} -V 2>&1 | awk '{print $4}'`
+
+# Use hacked headers for CC 5.8
+if [ $CC_VERSION = 5.8 ]; then
+ INCLUDES="-iwrapper\"$SELFPATH/5.8\" $INCLUDES"
+fi
+
+# Format and print out the options.
+OPTIONS="$MACROS $INCLUDES $SPECIAL"
+echo $OPTIONS
Property changes on: gccxml_bin/v09/linux2/share/gccxml-0.9/Sun/find_flags
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-04 20:01:31
|
Revision: 1765
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1765&view=rev
Author: roman_yakovenko
Date: 2009-10-04 20:01:20 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
removing dead code
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/creators_factory/ctypes_creator.py
Modified: pyplusplus_dev/pyplusplus/creators_factory/ctypes_creator.py
===================================================================
--- pyplusplus_dev/pyplusplus/creators_factory/ctypes_creator.py 2009-10-04 19:59:05 UTC (rev 1764)
+++ pyplusplus_dev/pyplusplus/creators_factory/ctypes_creator.py 2009-10-04 20:01:20 UTC (rev 1765)
@@ -42,8 +42,6 @@
self.curr_code_creator = self.module
#mapping between class declaration and class introduction code creator
self.__class2introduction = {}
- #mapping between classs and its methods definition dictionary
- self.__class2methods_def = {}
#mapping between namespace and its code creator
self.__namespace2pyclass = {}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-04 19:59:16
|
Revision: 1764
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1764&view=rev
Author: roman_yakovenko
Date: 2009-10-04 19:59:05 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
update libmemcached example
Modified Paths:
--------------
pyplusplus_dev/examples/libmemcached_dev/pymemcached/__init__.py
pyplusplus_dev/examples/libmemcached_dev/pymemcached/exposed_decl.pypp.txt
pyplusplus_dev/examples/libmemcached_dev/test.py
Modified: pyplusplus_dev/examples/libmemcached_dev/pymemcached/__init__.py
===================================================================
--- pyplusplus_dev/examples/libmemcached_dev/pymemcached/__init__.py 2009-10-04 19:41:39 UTC (rev 1763)
+++ pyplusplus_dev/examples/libmemcached_dev/pymemcached/__init__.py 2009-10-04 19:59:05 UTC (rev 1764)
@@ -13,170 +13,170 @@
"extern memcached_return memcached_decrement_with_initial(memcached_st * ptr, char const * key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t * value) [free function]" : "memcached_decrement_with_initial",
"extern char * * memcached_stat_get_keys(memcached_st * ptr, memcached_stat_st * stat, memcached_return * error) [free function]" : "memcached_stat_get_keys",
"extern memcached_return memcached_append(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_append",
- "extern memcached_return run_distribution(memcached_st * ptr) [free function]" : "run_distribution",
- "extern char * memcached_string_c_copy(memcached_string_st * string) [free function]" : "memcached_string_c_copy",
"extern memcached_return memcached_server_add_with_weight(memcached_st * ptr, char const * hostname, unsigned int port, uint32_t weight) [free function]" : "memcached_server_add_with_weight",
"extern memcached_return memcached_dump(memcached_st * ptr, memcached_dump_func * function, void * context, uint32_t number_of_callbacks) [free function]" : "memcached_dump",
"extern memcached_return memcached_server_push(memcached_st * ptr, memcached_server_st * list) [free function]" : "memcached_server_push",
"extern memcached_return memcached_result_set_value(memcached_result_st * ptr, char * value, size_t length) [free function]" : "memcached_result_set_value",
- "extern char * memcached_get_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]" : "memcached_get_by_key",
+ "extern memcached_return memcached_replace_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_replace_by_key",
"extern memcached_return memcached_server_add_udp(memcached_st * ptr, char const * hostname, unsigned int port) [free function]" : "memcached_server_add_udp",
- "extern memcached_return memcached_mget(memcached_st * ptr, char * * keys, size_t * key_length, unsigned int number_of_keys) [free function]" : "memcached_mget",
"extern memcached_server_st * memcached_servers_parse(char const * server_strings) [free function]" : "memcached_servers_parse",
"extern memcached_return memcached_set_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_set_by_key",
- "extern memcached_result_st * memcached_result_create(memcached_st * ptr, memcached_result_st * result) [free function]" : "memcached_result_create",
+ "extern uint64_t memcached_behavior_get(memcached_st * ptr, memcached_behavior flag) [free function]" : "memcached_behavior_get",
"extern char * memcached_fetch(memcached_st * ptr, char * key, size_t * key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]" : "memcached_fetch",
"extern memcached_st * memcached_create(memcached_st * ptr) [free function]" : "memcached_create",
"extern memcached_return memcached_replace(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_replace",
"extern memcached_return memcached_callback_set(memcached_st * ptr, memcached_callback flag, void * data) [free function]" : "memcached_callback_set",
- "extern memcached_return memcached_fetch_execute(memcached_st * ptr, memcached_execute_function * callback, void * context, unsigned int number_of_callbacks) [free function]" : "memcached_fetch_execute",
- "extern memcached_server_st * memcached_server_clone(memcached_server_st * clone, memcached_server_st * ptr) [free function]" : "memcached_server_clone",
+ "extern char * memcached_result_value(memcached_result_st * ptr) [free function]" : "memcached_result_value",
"extern void memcached_result_free(memcached_result_st * result) [free function]" : "memcached_result_free",
- "extern char * memcached_get(memcached_st * ptr, char const * key, size_t key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]" : "memcached_get",
- "extern void memcached_server_list_free(memcached_server_st * ptr) [free function]" : "memcached_server_list_free",
- "extern memcached_return memcached_string_check(memcached_string_st * string, size_t need) [free function]" : "memcached_string_check",
+ "extern memcached_server_st * memcached_server_create_with(memcached_st * memc, memcached_server_st * host, char const * hostname, unsigned int port, uint32_t weight, memcached_connection type) [free function]" : "memcached_server_create_with",
+ "extern memcached_return memcached_verbosity(memcached_st * ptr, unsigned int verbosity) [free function]" : "memcached_verbosity",
+ "extern void memcached_free(memcached_st * ptr) [free function]" : "memcached_free",
"extern memcached_return memcached_mget_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char * * keys, size_t * key_length, unsigned int number_of_keys) [free function]" : "memcached_mget_by_key",
"extern memcached_return memcached_version(memcached_st * ptr) [free function]" : "memcached_version",
- "extern char const * memcached_lib_version() [free function]" : "memcached_lib_version",
+ "extern void memcached_result_reset(memcached_result_st * ptr) [free function]" : "memcached_result_reset",
"extern void memcached_quit(memcached_st * ptr) [free function]" : "memcached_quit",
"extern memcached_analysis_st * memcached_analyze(memcached_st * memc, memcached_stat_st * stat, memcached_return * error) [free function]" : "memcached_analyze",
- "extern char * memcached_result_value(memcached_result_st * ptr) [free function]" : "memcached_result_value",
+ "extern memcached_return memcached_fetch_execute(memcached_st * ptr, memcached_execute_function * callback, void * context, unsigned int number_of_callbacks) [free function]" : "memcached_fetch_execute",
"extern memcached_return memcached_prepend_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_prepend_by_key",
- "extern void memcached_result_reset(memcached_result_st * ptr) [free function]" : "memcached_result_reset",
+ "extern char const * memcached_lib_version() [free function]" : "memcached_lib_version",
"extern memcached_return memcached_server_remove(memcached_server_st * st_ptr) [free function]" : "memcached_server_remove",
"extern memcached_return memcached_delete_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, time_t expiration) [free function]" : "memcached_delete_by_key",
"extern uint32_t memcached_generate_hash(memcached_st * ptr, char const * key, size_t key_length) [free function]" : "memcached_generate_hash",
"extern memcached_return memcached_set_memory_allocators(memcached_st * ptr, memcached_malloc_function mem_malloc, memcached_free_function mem_free, memcached_realloc_function mem_realloc, memcached_calloc_function mem_calloc) [free function]" : "memcached_set_memory_allocators",
- "extern memcached_return memcached_server_add(memcached_st * ptr, char const * hostname, unsigned int port) [free function]" : "memcached_server_add",
- "extern memcached_server_st * memcached_server_create_with(memcached_st * memc, memcached_server_st * host, char const * hostname, unsigned int port, uint32_t weight, memcached_connection type) [free function]" : "memcached_server_create_with",
+ "extern memcached_return memcached_prepend(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_prepend",
+ "extern void memcached_server_list_free(memcached_server_st * ptr) [free function]" : "memcached_server_list_free",
"extern memcached_return memcached_add(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_add",
"extern memcached_return memcached_flush(memcached_st * ptr, time_t expiration) [free function]" : "memcached_flush",
"extern memcached_return memcached_string_append_character(memcached_string_st * string, char character) [free function]" : "memcached_string_append_character",
"extern memcached_st * memcached_clone(memcached_st * clone, memcached_st * ptr) [free function]" : "memcached_clone",
"extern memcached_return memcached_server_add_udp_with_weight(memcached_st * ptr, char const * hostname, unsigned int port, uint32_t weight) [free function]" : "memcached_server_add_udp_with_weight",
- "extern void memcached_free(memcached_st * ptr) [free function]" : "memcached_free",
- "extern void * memcached_get_user_data(memcached_st * ptr) [free function]" : "memcached_get_user_data",
+ "extern char * memcached_string_c_copy(memcached_string_st * string) [free function]" : "memcached_string_c_copy",
+ "extern memcached_return memcached_string_append(memcached_string_st * string, char * value, size_t length) [free function]" : "memcached_string_append",
"extern memcached_stat_st * memcached_stat(memcached_st * ptr, char * args, memcached_return * error) [free function]" : "memcached_stat",
- "extern void memcached_get_memory_allocators(memcached_st * ptr, memcached_malloc_function * mem_malloc, memcached_free_function * mem_free, memcached_realloc_function * mem_realloc, memcached_calloc_function * mem_calloc) [free function]" : "memcached_get_memory_allocators",
- "extern memcached_return memcached_add_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_add_by_key",
+ "extern char * memcached_get(memcached_st * ptr, char const * key, size_t key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]" : "memcached_get",
"extern memcached_server_st * memcached_server_list_append(memcached_server_st * ptr, char const * hostname, unsigned int port, memcached_return * error) [free function]" : "memcached_server_list_append",
"extern memcached_return memcached_server_cursor(memcached_st * ptr, memcached_server_function * callback, void * context, unsigned int number_of_callbacks) [free function]" : "memcached_server_cursor",
- "extern void memcached_string_free(memcached_string_st * string) [free function]" : "memcached_string_free",
+ "extern memcached_server_st * memcached_server_clone(memcached_server_st * clone, memcached_server_st * ptr) [free function]" : "memcached_server_clone",
+ "extern memcached_result_st * memcached_result_create(memcached_st * ptr, memcached_result_st * result) [free function]" : "memcached_result_create",
"extern memcached_server_st * memcached_server_list_append_with_weight(memcached_server_st * ptr, char const * hostname, unsigned int port, uint32_t weight, memcached_return * error) [free function]" : "memcached_server_list_append_with_weight",
"extern memcached_return memcached_set(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_set",
"extern void memcached_server_free(memcached_server_st * ptr) [free function]" : "memcached_server_free",
"extern void memcached_stat_free(memcached_st * arg0, memcached_stat_st * arg1) [free function]" : "memcached_stat_free",
"extern memcached_return memcached_cas_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas) [free function]" : "memcached_cas_by_key",
- "extern memcached_return memcached_prepend(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_prepend",
+ "extern memcached_return memcached_cas(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas) [free function]" : "memcached_cas",
+ "extern memcached_return memcached_server_add(memcached_st * ptr, char const * hostname, unsigned int port) [free function]" : "memcached_server_add",
"extern memcached_return memcached_stat_servername(memcached_stat_st * stat, char * args, char * hostname, unsigned int port) [free function]" : "memcached_stat_servername",
+ "extern memcached_return memcached_add_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_add_by_key",
"extern void * memcached_callback_get(memcached_st * ptr, memcached_callback flag, memcached_return * error) [free function]" : "memcached_callback_get",
"extern memcached_string_st * memcached_string_create(memcached_st * ptr, memcached_string_st * string, size_t initial_size) [free function]" : "memcached_string_create",
"extern memcached_return memcached_server_add_unix_socket_with_weight(memcached_st * ptr, char const * filename, uint32_t weight) [free function]" : "memcached_server_add_unix_socket_with_weight",
- "extern memcached_return memcached_replace_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_replace_by_key",
+ "extern char * memcached_get_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]" : "memcached_get_by_key",
"extern memcached_return memcached_server_add_unix_socket(memcached_st * ptr, char const * filename) [free function]" : "memcached_server_add_unix_socket",
"extern memcached_server_st * memcached_server_by_key(memcached_st * ptr, char const * key, size_t key_length, memcached_return * error) [free function]" : "memcached_server_by_key",
"extern memcached_return memcached_flush_buffers(memcached_st * mem) [free function]" : "memcached_flush_buffers",
- "extern memcached_return memcached_cas(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas) [free function]" : "memcached_cas",
+ "extern void memcached_get_memory_allocators(memcached_st * ptr, memcached_malloc_function * mem_malloc, memcached_free_function * mem_free, memcached_realloc_function * mem_realloc, memcached_calloc_function * mem_calloc) [free function]" : "memcached_get_memory_allocators",
"extern memcached_return memcached_delete(memcached_st * ptr, char const * key, size_t key_length, time_t expiration) [free function]" : "memcached_delete",
"extern void * memcached_set_user_data(memcached_st * ptr, void * data) [free function]" : "memcached_set_user_data",
- "extern memcached_return memcached_string_append(memcached_string_st * string, char * value, size_t length) [free function]" : "memcached_string_append",
+ "extern memcached_return memcached_increment(memcached_st * ptr, char const * key, size_t key_length, uint32_t offset, uint64_t * value) [free function]" : "memcached_increment",
+ "extern memcached_return run_distribution(memcached_st * ptr) [free function]" : "run_distribution",
+ "extern void memcached_string_free(memcached_string_st * string) [free function]" : "memcached_string_free",
"extern memcached_return memcached_append_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]" : "memcached_append_by_key",
- "extern memcached_return memcached_verbosity(memcached_st * ptr, unsigned int verbosity) [free function]" : "memcached_verbosity",
+ "extern memcached_return memcached_string_check(memcached_string_st * string, size_t need) [free function]" : "memcached_string_check",
"extern memcached_return memcached_behavior_set(memcached_st * ptr, memcached_behavior flag, uint64_t data) [free function]" : "memcached_behavior_set",
"extern unsigned int memcached_server_list_count(memcached_server_st * ptr) [free function]" : "memcached_server_list_count",
- "extern size_t memcached_result_length(memcached_result_st * ptr) [free function]" : "memcached_result_length",
- "extern memcached_return memcached_increment(memcached_st * ptr, char const * key, size_t key_length, uint32_t offset, uint64_t * value) [free function]" : "memcached_increment",
+ "extern memcached_return memcached_mget(memcached_st * ptr, char * * keys, size_t * key_length, unsigned int number_of_keys) [free function]" : "memcached_mget",
+ "extern void * memcached_get_user_data(memcached_st * ptr) [free function]" : "memcached_get_user_data",
"extern memcached_return memcached_increment_with_initial(memcached_st * ptr, char const * key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t * value) [free function]" : "memcached_increment_with_initial",
"extern char * memcached_stat_get_value(memcached_st * ptr, memcached_stat_st * stat, char const * key, memcached_return * error) [free function]" : "memcached_stat_get_value",
"extern memcached_result_st * memcached_fetch_result(memcached_st * ptr, memcached_result_st * result, memcached_return * error) [free function]" : "memcached_fetch_result",
"extern memcached_server_st * memcached_server_create(memcached_st * memc, memcached_server_st * ptr) [free function]" : "memcached_server_create",
+ "extern size_t memcached_result_length(memcached_result_st * ptr) [free function]" : "memcached_result_length",
"extern char * memcached_strerror(memcached_st * ptr, memcached_return rc) [free function]" : "memcached_strerror",
- "extern uint64_t memcached_behavior_get(memcached_st * ptr, memcached_behavior flag) [free function]" : "memcached_behavior_get",
"memcached_decrement" : "extern memcached_return memcached_decrement(memcached_st * ptr, char const * key, size_t key_length, uint32_t offset, uint64_t * value) [free function]",
"memcached_string_reset" : "extern memcached_return memcached_string_reset(memcached_string_st * string) [free function]",
"memcached_generate_hash_value" : "extern uint32_t memcached_generate_hash_value(char const * key, size_t key_length, memcached_hash hash_algorithm) [free function]",
"memcached_decrement_with_initial" : "extern memcached_return memcached_decrement_with_initial(memcached_st * ptr, char const * key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t * value) [free function]",
"memcached_stat_get_keys" : "extern char * * memcached_stat_get_keys(memcached_st * ptr, memcached_stat_st * stat, memcached_return * error) [free function]",
"memcached_append" : "extern memcached_return memcached_append(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
- "run_distribution" : "extern memcached_return run_distribution(memcached_st * ptr) [free function]",
- "memcached_string_c_copy" : "extern char * memcached_string_c_copy(memcached_string_st * string) [free function]",
"memcached_server_add_with_weight" : "extern memcached_return memcached_server_add_with_weight(memcached_st * ptr, char const * hostname, unsigned int port, uint32_t weight) [free function]",
"memcached_dump" : "extern memcached_return memcached_dump(memcached_st * ptr, memcached_dump_func * function, void * context, uint32_t number_of_callbacks) [free function]",
"memcached_server_push" : "extern memcached_return memcached_server_push(memcached_st * ptr, memcached_server_st * list) [free function]",
"memcached_result_set_value" : "extern memcached_return memcached_result_set_value(memcached_result_st * ptr, char * value, size_t length) [free function]",
- "memcached_get_by_key" : "extern char * memcached_get_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]",
+ "memcached_replace_by_key" : "extern memcached_return memcached_replace_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
"memcached_server_add_udp" : "extern memcached_return memcached_server_add_udp(memcached_st * ptr, char const * hostname, unsigned int port) [free function]",
- "memcached_mget" : "extern memcached_return memcached_mget(memcached_st * ptr, char * * keys, size_t * key_length, unsigned int number_of_keys) [free function]",
"memcached_servers_parse" : "extern memcached_server_st * memcached_servers_parse(char const * server_strings) [free function]",
"memcached_set_by_key" : "extern memcached_return memcached_set_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
- "memcached_result_create" : "extern memcached_result_st * memcached_result_create(memcached_st * ptr, memcached_result_st * result) [free function]",
+ "memcached_behavior_get" : "extern uint64_t memcached_behavior_get(memcached_st * ptr, memcached_behavior flag) [free function]",
"memcached_fetch" : "extern char * memcached_fetch(memcached_st * ptr, char * key, size_t * key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]",
"memcached_create" : "extern memcached_st * memcached_create(memcached_st * ptr) [free function]",
"memcached_replace" : "extern memcached_return memcached_replace(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
"memcached_callback_set" : "extern memcached_return memcached_callback_set(memcached_st * ptr, memcached_callback flag, void * data) [free function]",
- "memcached_fetch_execute" : "extern memcached_return memcached_fetch_execute(memcached_st * ptr, memcached_execute_function * callback, void * context, unsigned int number_of_callbacks) [free function]",
- "memcached_server_clone" : "extern memcached_server_st * memcached_server_clone(memcached_server_st * clone, memcached_server_st * ptr) [free function]",
+ "memcached_result_value" : "extern char * memcached_result_value(memcached_result_st * ptr) [free function]",
"memcached_result_free" : "extern void memcached_result_free(memcached_result_st * result) [free function]",
- "memcached_get" : "extern char * memcached_get(memcached_st * ptr, char const * key, size_t key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]",
- "memcached_server_list_free" : "extern void memcached_server_list_free(memcached_server_st * ptr) [free function]",
- "memcached_string_check" : "extern memcached_return memcached_string_check(memcached_string_st * string, size_t need) [free function]",
+ "memcached_server_create_with" : "extern memcached_server_st * memcached_server_create_with(memcached_st * memc, memcached_server_st * host, char const * hostname, unsigned int port, uint32_t weight, memcached_connection type) [free function]",
+ "memcached_verbosity" : "extern memcached_return memcached_verbosity(memcached_st * ptr, unsigned int verbosity) [free function]",
+ "memcached_free" : "extern void memcached_free(memcached_st * ptr) [free function]",
"memcached_mget_by_key" : "extern memcached_return memcached_mget_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char * * keys, size_t * key_length, unsigned int number_of_keys) [free function]",
"memcached_version" : "extern memcached_return memcached_version(memcached_st * ptr) [free function]",
- "memcached_lib_version" : "extern char const * memcached_lib_version() [free function]",
+ "memcached_result_reset" : "extern void memcached_result_reset(memcached_result_st * ptr) [free function]",
"memcached_quit" : "extern void memcached_quit(memcached_st * ptr) [free function]",
"memcached_analyze" : "extern memcached_analysis_st * memcached_analyze(memcached_st * memc, memcached_stat_st * stat, memcached_return * error) [free function]",
- "memcached_result_value" : "extern char * memcached_result_value(memcached_result_st * ptr) [free function]",
+ "memcached_fetch_execute" : "extern memcached_return memcached_fetch_execute(memcached_st * ptr, memcached_execute_function * callback, void * context, unsigned int number_of_callbacks) [free function]",
"memcached_prepend_by_key" : "extern memcached_return memcached_prepend_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
- "memcached_result_reset" : "extern void memcached_result_reset(memcached_result_st * ptr) [free function]",
+ "memcached_lib_version" : "extern char const * memcached_lib_version() [free function]",
"memcached_server_remove" : "extern memcached_return memcached_server_remove(memcached_server_st * st_ptr) [free function]",
"memcached_delete_by_key" : "extern memcached_return memcached_delete_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, time_t expiration) [free function]",
"memcached_generate_hash" : "extern uint32_t memcached_generate_hash(memcached_st * ptr, char const * key, size_t key_length) [free function]",
"memcached_set_memory_allocators" : "extern memcached_return memcached_set_memory_allocators(memcached_st * ptr, memcached_malloc_function mem_malloc, memcached_free_function mem_free, memcached_realloc_function mem_realloc, memcached_calloc_function mem_calloc) [free function]",
- "memcached_server_add" : "extern memcached_return memcached_server_add(memcached_st * ptr, char const * hostname, unsigned int port) [free function]",
- "memcached_server_create_with" : "extern memcached_server_st * memcached_server_create_with(memcached_st * memc, memcached_server_st * host, char const * hostname, unsigned int port, uint32_t weight, memcached_connection type) [free function]",
+ "memcached_prepend" : "extern memcached_return memcached_prepend(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
+ "memcached_server_list_free" : "extern void memcached_server_list_free(memcached_server_st * ptr) [free function]",
"memcached_add" : "extern memcached_return memcached_add(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
"memcached_flush" : "extern memcached_return memcached_flush(memcached_st * ptr, time_t expiration) [free function]",
"memcached_string_append_character" : "extern memcached_return memcached_string_append_character(memcached_string_st * string, char character) [free function]",
"memcached_clone" : "extern memcached_st * memcached_clone(memcached_st * clone, memcached_st * ptr) [free function]",
"memcached_server_add_udp_with_weight" : "extern memcached_return memcached_server_add_udp_with_weight(memcached_st * ptr, char const * hostname, unsigned int port, uint32_t weight) [free function]",
- "memcached_free" : "extern void memcached_free(memcached_st * ptr) [free function]",
- "memcached_get_user_data" : "extern void * memcached_get_user_data(memcached_st * ptr) [free function]",
+ "memcached_string_c_copy" : "extern char * memcached_string_c_copy(memcached_string_st * string) [free function]",
+ "memcached_string_append" : "extern memcached_return memcached_string_append(memcached_string_st * string, char * value, size_t length) [free function]",
"memcached_stat" : "extern memcached_stat_st * memcached_stat(memcached_st * ptr, char * args, memcached_return * error) [free function]",
- "memcached_get_memory_allocators" : "extern void memcached_get_memory_allocators(memcached_st * ptr, memcached_malloc_function * mem_malloc, memcached_free_function * mem_free, memcached_realloc_function * mem_realloc, memcached_calloc_function * mem_calloc) [free function]",
- "memcached_add_by_key" : "extern memcached_return memcached_add_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
+ "memcached_get" : "extern char * memcached_get(memcached_st * ptr, char const * key, size_t key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]",
"memcached_server_list_append" : "extern memcached_server_st * memcached_server_list_append(memcached_server_st * ptr, char const * hostname, unsigned int port, memcached_return * error) [free function]",
"memcached_server_cursor" : "extern memcached_return memcached_server_cursor(memcached_st * ptr, memcached_server_function * callback, void * context, unsigned int number_of_callbacks) [free function]",
- "memcached_string_free" : "extern void memcached_string_free(memcached_string_st * string) [free function]",
+ "memcached_server_clone" : "extern memcached_server_st * memcached_server_clone(memcached_server_st * clone, memcached_server_st * ptr) [free function]",
+ "memcached_result_create" : "extern memcached_result_st * memcached_result_create(memcached_st * ptr, memcached_result_st * result) [free function]",
"memcached_server_list_append_with_weight" : "extern memcached_server_st * memcached_server_list_append_with_weight(memcached_server_st * ptr, char const * hostname, unsigned int port, uint32_t weight, memcached_return * error) [free function]",
"memcached_set" : "extern memcached_return memcached_set(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
"memcached_server_free" : "extern void memcached_server_free(memcached_server_st * ptr) [free function]",
"memcached_stat_free" : "extern void memcached_stat_free(memcached_st * arg0, memcached_stat_st * arg1) [free function]",
"memcached_cas_by_key" : "extern memcached_return memcached_cas_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas) [free function]",
- "memcached_prepend" : "extern memcached_return memcached_prepend(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
+ "memcached_cas" : "extern memcached_return memcached_cas(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas) [free function]",
+ "memcached_server_add" : "extern memcached_return memcached_server_add(memcached_st * ptr, char const * hostname, unsigned int port) [free function]",
"memcached_stat_servername" : "extern memcached_return memcached_stat_servername(memcached_stat_st * stat, char * args, char * hostname, unsigned int port) [free function]",
+ "memcached_add_by_key" : "extern memcached_return memcached_add_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
"memcached_callback_get" : "extern void * memcached_callback_get(memcached_st * ptr, memcached_callback flag, memcached_return * error) [free function]",
"memcached_string_create" : "extern memcached_string_st * memcached_string_create(memcached_st * ptr, memcached_string_st * string, size_t initial_size) [free function]",
"memcached_server_add_unix_socket_with_weight" : "extern memcached_return memcached_server_add_unix_socket_with_weight(memcached_st * ptr, char const * filename, uint32_t weight) [free function]",
- "memcached_replace_by_key" : "extern memcached_return memcached_replace_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
+ "memcached_get_by_key" : "extern char * memcached_get_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, size_t * value_length, uint32_t * flags, memcached_return * error) [free function]",
"memcached_server_add_unix_socket" : "extern memcached_return memcached_server_add_unix_socket(memcached_st * ptr, char const * filename) [free function]",
"memcached_server_by_key" : "extern memcached_server_st * memcached_server_by_key(memcached_st * ptr, char const * key, size_t key_length, memcached_return * error) [free function]",
"memcached_flush_buffers" : "extern memcached_return memcached_flush_buffers(memcached_st * mem) [free function]",
- "memcached_cas" : "extern memcached_return memcached_cas(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas) [free function]",
+ "memcached_get_memory_allocators" : "extern void memcached_get_memory_allocators(memcached_st * ptr, memcached_malloc_function * mem_malloc, memcached_free_function * mem_free, memcached_realloc_function * mem_realloc, memcached_calloc_function * mem_calloc) [free function]",
"memcached_delete" : "extern memcached_return memcached_delete(memcached_st * ptr, char const * key, size_t key_length, time_t expiration) [free function]",
"memcached_set_user_data" : "extern void * memcached_set_user_data(memcached_st * ptr, void * data) [free function]",
- "memcached_string_append" : "extern memcached_return memcached_string_append(memcached_string_st * string, char * value, size_t length) [free function]",
+ "memcached_increment" : "extern memcached_return memcached_increment(memcached_st * ptr, char const * key, size_t key_length, uint32_t offset, uint64_t * value) [free function]",
+ "run_distribution" : "extern memcached_return run_distribution(memcached_st * ptr) [free function]",
+ "memcached_string_free" : "extern void memcached_string_free(memcached_string_st * string) [free function]",
"memcached_append_by_key" : "extern memcached_return memcached_append_by_key(memcached_st * ptr, char const * master_key, size_t master_key_length, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]",
- "memcached_verbosity" : "extern memcached_return memcached_verbosity(memcached_st * ptr, unsigned int verbosity) [free function]",
+ "memcached_string_check" : "extern memcached_return memcached_string_check(memcached_string_st * string, size_t need) [free function]",
"memcached_behavior_set" : "extern memcached_return memcached_behavior_set(memcached_st * ptr, memcached_behavior flag, uint64_t data) [free function]",
"memcached_server_list_count" : "extern unsigned int memcached_server_list_count(memcached_server_st * ptr) [free function]",
- "memcached_result_length" : "extern size_t memcached_result_length(memcached_result_st * ptr) [free function]",
- "memcached_increment" : "extern memcached_return memcached_increment(memcached_st * ptr, char const * key, size_t key_length, uint32_t offset, uint64_t * value) [free function]",
+ "memcached_mget" : "extern memcached_return memcached_mget(memcached_st * ptr, char * * keys, size_t * key_length, unsigned int number_of_keys) [free function]",
+ "memcached_get_user_data" : "extern void * memcached_get_user_data(memcached_st * ptr) [free function]",
"memcached_increment_with_initial" : "extern memcached_return memcached_increment_with_initial(memcached_st * ptr, char const * key, size_t key_length, uint64_t offset, uint64_t initial, time_t expiration, uint64_t * value) [free function]",
"memcached_stat_get_value" : "extern char * memcached_stat_get_value(memcached_st * ptr, memcached_stat_st * stat, char const * key, memcached_return * error) [free function]",
"memcached_fetch_result" : "extern memcached_result_st * memcached_fetch_result(memcached_st * ptr, memcached_result_st * result, memcached_return * error) [free function]",
"memcached_server_create" : "extern memcached_server_st * memcached_server_create(memcached_st * memc, memcached_server_st * ptr) [free function]",
+ "memcached_result_length" : "extern size_t memcached_result_length(memcached_result_st * ptr) [free function]",
"memcached_strerror" : "extern char * memcached_strerror(memcached_st * ptr, memcached_return rc) [free function]",
- "memcached_behavior_get" : "extern uint64_t memcached_behavior_get(memcached_st * ptr, memcached_behavior flag) [free function]",
}
class memcached_hash( ctypes_utils.Enumeration ):
@@ -562,9 +562,6 @@
memcached_prepend_type = ctypes.CFUNCTYPE( memcached_return, ctypes.POINTER( memcached_st ), ctypes.c_char_p, ctypes.c_uint, ctypes.c_char_p, ctypes.c_uint, ctypes.c_long, ctypes.c_uint )
memcached_prepend = memcached_prepend_type( ( libmemcached_lib.undecorated_names["extern memcached_return memcached_prepend(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]"], libmemcached_lib ) )
-memcached_append_type = ctypes.CFUNCTYPE( memcached_return, ctypes.POINTER( memcached_st ), ctypes.c_char_p, ctypes.c_uint, ctypes.c_char_p, ctypes.c_uint, ctypes.c_long, ctypes.c_uint )
-memcached_append = memcached_append_type( ( libmemcached_lib.undecorated_names["extern memcached_return memcached_append(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]"], libmemcached_lib ) )
-
memcached_server_list_append_with_weight_type = ctypes.CFUNCTYPE( ctypes.POINTER( memcached_server_st ), ctypes.POINTER( memcached_server_st ), ctypes.c_char_p, ctypes.c_uint, ctypes.c_uint, ctypes.POINTER( memcached_return ) )
memcached_server_list_append_with_weight = memcached_server_list_append_with_weight_type( ( libmemcached_lib.undecorated_names["extern memcached_server_st * memcached_server_list_append_with_weight(memcached_server_st * ptr, char const * hostname, unsigned int port, uint32_t weight, memcached_return * error) [free function]"], libmemcached_lib ) )
@@ -640,6 +637,9 @@
memcached_callback_set_type = ctypes.CFUNCTYPE( memcached_return, ctypes.POINTER( memcached_st ), memcached_callback, ctypes.c_void_p )
memcached_callback_set = memcached_callback_set_type( ( libmemcached_lib.undecorated_names["extern memcached_return memcached_callback_set(memcached_st * ptr, memcached_callback flag, void * data) [free function]"], libmemcached_lib ) )
+memcached_append_type = ctypes.CFUNCTYPE( memcached_return, ctypes.POINTER( memcached_st ), ctypes.c_char_p, ctypes.c_uint, ctypes.c_char_p, ctypes.c_uint, ctypes.c_long, ctypes.c_uint )
+memcached_append = memcached_append_type( ( libmemcached_lib.undecorated_names["extern memcached_return memcached_append(memcached_st * ptr, char const * key, size_t key_length, char const * value, size_t value_length, time_t expiration, uint32_t flags) [free function]"], libmemcached_lib ) )
+
memcached_decrement_type = ctypes.CFUNCTYPE( memcached_return, ctypes.POINTER( memcached_st ), ctypes.c_char_p, ctypes.c_uint, ctypes.c_uint, ctypes.POINTER( ctypes.c_ulonglong ) )
memcached_decrement = memcached_decrement_type( ( libmemcached_lib.undecorated_names["extern memcached_return memcached_decrement(memcached_st * ptr, char const * key, size_t key_length, uint32_t offset, uint64_t * value) [free function]"], libmemcached_lib ) )
Modified: pyplusplus_dev/examples/libmemcached_dev/pymemcached/exposed_decl.pypp.txt
===================================================================
--- pyplusplus_dev/examples/libmemcached_dev/pymemcached/exposed_decl.pypp.txt 2009-10-04 19:41:39 UTC (rev 1763)
+++ pyplusplus_dev/examples/libmemcached_dev/pymemcached/exposed_decl.pypp.txt 2009-10-04 19:59:05 UTC (rev 1764)
@@ -57,7 +57,7 @@
~@destructor_t@~._11@ ( ::pthread_mutexattr_t::* )( ) ( ::pthread_mutexattr_t::* )( )
~@destructor_t@~._13@ ( ::pthread_cond_t::* )( ) ( ::pthread_cond_t::* )( )
~@destructor_t@~._12@ ( ::pthread_cond_t::* )( ) ( ::pthread_cond_t::* )( )
-~@enumeration_t@('/usr/include/bits/socket.h', 184)@::
+~@enumeration_t@('/usr/include/bits/socket.h', 320)@::
~@enumeration_t@memcached_server_distribution@::memcached_server_distribution
+@enumeration_t@memcached_behavior@::memcached_behavior
+@enumeration_t@memcached_callback@::memcached_callback
@@ -68,7 +68,7 @@
+@enumeration_t@memcached_return@::memcached_return
~@enumeration_t@('/usr/include/sys/socket.h', 54)@::
~@enumeration_t@('/usr/include/netinet/in.h', 32)@::
-~@enumeration_t@('/usr/include/bits/socket.h', 308)@::
+~@enumeration_t@('/usr/include/bits/socket.h', 196)@::
~@typedef_t@__uint16_t@::__uint16_t
~@typedef_t@__int16_t@::__int16_t
~@typedef_t@__u_char@::__u_char
@@ -214,6 +214,7 @@
~@typedef_t@int8_t@::int8_t
~@typedef_t@useconds_t@::useconds_t
~@typedef_t@memcached_realloc_function@::memcached_realloc_function
+~@typedef_t@locale_t@::locale_t
~@typedef_t@memcached_cleanup_func@::memcached_cleanup_func
~@typedef_t@in_addr_t@::in_addr_t
~@typedef_t@__u_int@::__u_int
@@ -749,6 +750,7 @@
+@free_function_t@memcached_clone@::memcached_st * (*)( ::memcached_st *,::memcached_st * )::memcached_st * (*)( ::memcached_st *,::memcached_st * )
~@free_function_t@rand_r@int (*)( unsigned int * )int (*)( unsigned int * )
~@free_function_t@getpt@int (*)( )int (*)( )
+~@free_function_t@preadv64@::ssize_t (*)( int,::iovec const *,int,::__off64_t )::ssize_t (*)( int,::iovec const *,int,::__off64_t )
~@free_function_t@__builtin_tan@double (*)( double )double (*)( double )
~@free_function_t@__builtin_csinf@complex float (*)( complex float )complex float (*)( complex float )
+@free_function_t@memcached_add_by_key@::memcached_return (*)( ::memcached_st *,char const *,::size_t,char const *,::size_t,char const *,::size_t,::time_t,::uint32_t )::memcached_return (*)( ::memcached_st *,char const *,::size_t,char const *,::size_t,char const *,::size_t,::time_t,::uint32_t )
@@ -772,6 +774,7 @@
+@free_function_t@memcached_server_add_udp@::memcached_return (*)( ::memcached_st *,char const *,unsigned int )::memcached_return (*)( ::memcached_st *,char const *,unsigned int )
~@free_function_t@__ctype_get_mb_cur_max@::size_t (*)( )::size_t (*)( )
+@free_function_t@memcached_flush@::memcached_return (*)( ::memcached_st *,::time_t )::memcached_return (*)( ::memcached_st *,::time_t )
+~@free_function_t@pwritev@::ssize_t (*)( int,::iovec const *,int,::__off_t )::ssize_t (*)( int,::iovec const *,int,::__off_t )
+@free_function_t@memcached_server_create_with@::memcached_server_st * (*)( ::memcached_st *,::memcached_server_st *,char const *,unsigned int,::uint32_t,::memcached_connection )::memcached_server_st * (*)( ::memcached_st *,::memcached_server_st *,char const *,unsigned int,::uint32_t,::memcached_connection )
~@free_function_t@mktemp@char * (*)( char * )char * (*)( char * )
+@free_function_t@memcached_lib_version@char const * (*)( )char const * (*)( )
@@ -823,6 +826,7 @@
~@free_function_t@setkey@void (*)( char const * )void (*)( char const * )
+@free_function_t@memcached_stat_free@void (*)( ::memcached_st *,::memcached_stat_st * )void (*)( ::memcached_st *,::memcached_stat_st * )
~@free_function_t@valloc@void * (*)( ::size_t )void * (*)( ::size_t )
+~@free_function_t@at_quick_exit@int (*)( void (*)( ) * )int (*)( void (*)( ) * )
~@free_function_t@__secure_getenv@char * (*)( char const * )char * (*)( char const * )
~@free_function_t@getsourcefilter@int (*)( int,::uint32_t,::sockaddr const *,::socklen_t,::uint32_t *,::uint32_t *,::sockaddr_storage * )int (*)( int,::uint32_t,::sockaddr const *,::socklen_t,::uint32_t *,::uint32_t *,::sockaddr_storage * )
~@free_function_t@bind@int (*)( int,::sockaddr const *,::socklen_t )int (*)( int,::sockaddr const *,::socklen_t )
@@ -927,7 +931,7 @@
~@free_function_t@__builtin_nansl@long double (*)( char const * )long double (*)( char const * )
~@free_function_t@__builtin_return_address@void * (*)( unsigned int )void * (*)( unsigned int )
~@free_function_t@inet6_option_next@int (*)( ::cmsghdr const *,::uint8_t * * )int (*)( ::cmsghdr const *,::uint8_t * * )
-~@free_function_t@getenv@char * (*)( char const * )char * (*)( char const * )
+~@free_function_t@__builtin_cosh@double (*)( double )double (*)( double )
+@free_function_t@memcached_callback_get@void * (*)( ::memcached_st *,::memcached_callback,::memcached_return * )void * (*)( ::memcached_st *,::memcached_callback,::memcached_return * )
~@free_function_t@__builtin_cosl@long double (*)( long double )long double (*)( long double )
~@free_function_t@inet6_option_append@int (*)( ::cmsghdr *,::uint8_t const *,int,int )int (*)( ::cmsghdr *,::uint8_t const *,int,int )
@@ -966,6 +970,7 @@
~@free_function_t@__builtin_ctanhl@complex long double (*)( complex long double )complex long double (*)( complex long double )
~@free_function_t@qgcvt@char * (*)( long double,int,char * )char * (*)( long double,int,char * )
~@free_function_t@atexit@int (*)( void (*)( ) * )int (*)( void (*)( ) * )
+~@free_function_t@quick_exit@void (*)( int )void (*)( int )
~@free_function_t@getsockname@int (*)( int,__restrict__ ::sockaddr *,__restrict__ ::socklen_t * )int (*)( int,__restrict__ ::sockaddr *,__restrict__ ::socklen_t * )
~@free_function_t@jrand48@long int (*)( short unsigned int * )long int (*)( short unsigned int * )
~@free_function_t@__builtin_atan2l@long double (*)( long double,long double )long double (*)( long double,long double )
@@ -979,6 +984,7 @@
~@free_function_t@__builtin_csqrtl@complex long double (*)( complex long double )complex long double (*)( complex long double )
~@free_function_t@__builtin_csqrtf@complex float (*)( complex float )complex float (*)( complex float )
~@free_function_t@__builtin_ccos@complex double (*)( complex double )complex double (*)( complex double )
+~@free_function_t@inet6_option_alloc@::uint8_t * (*)( ::cmsghdr *,int,int,int )::uint8_t * (*)( ::cmsghdr *,int,int,int )
~@free_function_t@seed48_r@int (*)( short unsigned int *,::drand48_data * )int (*)( short unsigned int *,::drand48_data * )
~@free_function_t@setsockopt@int (*)( int,int,int,void const *,::socklen_t )int (*)( int,int,int,void const *,::socklen_t )
~@free_function_t@__builtin_ctzll@int (*)( long long int )int (*)( long long int )
@@ -1044,7 +1050,7 @@
+@free_function_t@memcached_result_set_value@::memcached_return (*)( ::memcached_result_st *,char *,::size_t )::memcached_return (*)( ::memcached_result_st *,char *,::size_t )
~@free_function_t@__builtin_popcount@int (*)( int )int (*)( int )
+@free_function_t@memcached_server_list_free@void (*)( ::memcached_server_st * )void (*)( ::memcached_server_st * )
-~@free_function_t@inet6_option_alloc@::uint8_t * (*)( ::cmsghdr *,int,int,int )::uint8_t * (*)( ::cmsghdr *,int,int,int )
+~@free_function_t@preadv@::ssize_t (*)( int,::iovec const *,int,::__off_t )::ssize_t (*)( int,::iovec const *,int,::__off_t )
~@free_function_t@ldiv@::ldiv_t (*)( long int,long int )::ldiv_t (*)( long int,long int )
~@free_function_t@ptsname@char * (*)( int )char * (*)( int )
+@free_function_t@memcached_fetch_execute@::memcached_return (*)( ::memcached_st *,::memcached_execute_function *,void *,unsigned int )::memcached_return (*)( ::memcached_st *,::memcached_execute_function *,void *,unsigned int )
@@ -1072,6 +1078,7 @@
~@free_function_t@mblen@int (*)( char const *,::size_t )int (*)( char const *,::size_t )
~@free_function_t@__builtin_sinf@float (*)( float )float (*)( float )
~@free_function_t@__builtin_sinl@long double (*)( long double )long double (*)( long double )
+~@free_function_t@accept4@int (*)( int,__restrict__ ::sockaddr *,__restrict__ ::socklen_t *,int )int (*)( int,__restrict__ ::sockaddr *,__restrict__ ::socklen_t *,int )
~@free_function_t@__builtin_isfinite@bool (*)( ... )bool (*)( ... )
~@free_function_t@__builtin_sinh@double (*)( double )double (*)( double )
~@free_function_t@qecvt_r@int (*)( long double,int,__restrict__ int *,__restrict__ int *,__restrict__ char *,::size_t )int (*)( long double,int,__restrict__ int *,__restrict__ int *,__restrict__ char *,::size_t )
@@ -1091,7 +1098,6 @@
+@free_function_t@memcached_set@::memcached_return (*)( ::memcached_st *,char const *,::size_t,char const *,::size_t,::time_t,::uint32_t )::memcached_return (*)( ::memcached_st *,char const *,::size_t,char const *,::size_t,::time_t,::uint32_t )
+@free_function_t@memcached_behavior_get@::uint64_t (*)( ::memcached_st *,::memcached_behavior )::uint64_t (*)( ::memcached_st *,::memcached_behavior )
~@free_function_t@sockatmark@int (*)( int )int (*)( int )
-~@free_function_t@__builtin_cosh@double (*)( double )double (*)( double )
~@free_function_t@putenv@int (*)( char * )int (*)( char * )
+@free_function_t@memcached_generate_hash_value@::uint32_t (*)( char const *,::size_t,::memcached_hash )::uint32_t (*)( char const *,::size_t,::memcached_hash )
+@free_function_t@memcached_result_value@char * (*)( ::memcached_result_st * )char * (*)( ::memcached_result_st * )
@@ -1101,7 +1107,7 @@
~@free_function_t@l64a@char * (*)( long int )char * (*)( long int )
~@free_function_t@mrand48@long int (*)( )long int (*)( )
+@free_function_t@memcached_stat@::memcached_stat_st * (*)( ::memcached_st *,char *,::memcached_return * )::memcached_stat_st * (*)( ::memcached_st *,char *,::memcached_return * )
-~@free_function_t@llabs@long long int (*)( long long int )long long int (*)( long long int )
+~@free_function_t@getenv@char * (*)( char const * )char * (*)( char const * )
+@free_function_t@memcached_server_list_append_with_weight@::memcached_server_st * (*)( ::memcached_server_st *,char const *,unsigned int,::uint32_t,::memcached_return * )::memcached_server_st * (*)( ::memcached_server_st *,char const *,unsigned int,::uint32_t,::memcached_return * )
~@free_function_t@atoi@int (*)( char const * )int (*)( char const * )
~@free_function_t@atol@long int (*)( char const * )long int (*)( char const * )
@@ -1111,6 +1117,7 @@
~@free_function_t@imaxdiv@::imaxdiv_t (*)( ::intmax_t,::intmax_t )::imaxdiv_t (*)( ::intmax_t,::intmax_t )
+@free_function_t@memcached_fetch_result@::memcached_result_st * (*)( ::memcached_st *,::memcached_result_st *,::memcached_return * )::memcached_result_st * (*)( ::memcached_st *,::memcached_result_st *,::memcached_return * )
~@free_function_t@connect@int (*)( int,::sockaddr const *,::socklen_t )int (*)( int,::sockaddr const *,::socklen_t )
+~@free_function_t@llabs@long long int (*)( long long int )long long int (*)( long long int )
~@free_function_t@__builtin_frexpf@float (*)( float,int * )float (*)( float,int * )
~@free_function_t@htonl@::uint32_t (*)( ::uint32_t )::uint32_t (*)( ::uint32_t )
~@free_function_t@inet6_option_space@int (*)( int )int (*)( int )
@@ -1127,6 +1134,7 @@
~@free_function_t@__builtin_ccoshl@complex long double (*)( complex long double )complex long double (*)( complex long double )
~@free_function_t@__builtin_inff@float (*)( )float (*)( )
~@free_function_t@__builtin_ccoshf@complex float (*)( complex float )complex float (*)( complex float )
+~@free_function_t@pwritev64@::ssize_t (*)( int,::iovec const *,int,::__off64_t )::ssize_t (*)( int,::iovec const *,int,::__off64_t )
+@free_function_t@memcached_server_list_append@::memcached_server_st * (*)( ::memcached_server_st *,char const *,unsigned int,::memcached_return * )::memcached_server_st * (*)( ::memcached_server_st *,char const *,unsigned int,::memcached_return * )
~@free_function_t@mkostemp64@int (*)( char *,int )int (*)( char *,int )
~@free_function_t@strtoul_l@long unsigned int (*)( __restrict__ char const *,__restrict__ char * *,int,::__locale_t )long unsigned int (*)( __restrict__ char const *,__restrict__ char * *,int,::__locale_t )
Modified: pyplusplus_dev/examples/libmemcached_dev/test.py
===================================================================
--- pyplusplus_dev/examples/libmemcached_dev/test.py 2009-10-04 19:41:39 UTC (rev 1763)
+++ pyplusplus_dev/examples/libmemcached_dev/test.py 2009-10-04 19:59:05 UTC (rev 1764)
@@ -16,3 +16,12 @@
result = mmc.memcached_delete( memc, key, len(key), 0);
print "key/value (%s/%s ) was deleted?: " % ( key, value ) + mmc.memcached_strerror(memc, result);
+
+for key in 'abcdefghijklmnopqrstuvwxyz':
+ value_length = ctypes.c_size_t()
+ flags = ctypes.c_ulong()
+ result = mmc.memcached_return()
+ value = mmc.memcached_get( memc, key, len(key), ctypes.byref( value_length ), ctypes.byref( flags ), ctypes.byref( result ) )
+ print 'key/value (%s/%s)' % ( key, value )
+ print mmc.memcached_strerror(memc, result);
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-04 19:41:50
|
Revision: 1763
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1763&view=rev
Author: roman_yakovenko
Date: 2009-10-04 19:41:39 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
"nm" utility invocation was fixed. Now it handles right relative paths and paths with spaces
Modified Paths:
--------------
pygccxml_dev/docs/history/history.rest
pygccxml_dev/pygccxml/binary_parsers/parsers.py
Modified: pygccxml_dev/docs/history/history.rest
===================================================================
--- pygccxml_dev/docs/history/history.rest 2009-10-01 22:59:08 UTC (rev 1762)
+++ pygccxml_dev/docs/history/history.rest 2009-10-04 19:41:39 UTC (rev 1763)
@@ -22,6 +22,7 @@
* Ben Schleimer
* Gustavo Carneiro
* Christopher Bruns
+* Alejandro Dubrovsky
-----------
SVN Version
@@ -50,7 +51,11 @@
8. "explicit" property was added to ``declarations.constructor_t`` class.
Many thanks to Christopher Bruns, for finding out how this property
works in `GCC-XML`_.
-
+
+9. "List symbols" (`nm`) utility invocation was improved and now handles
+ right relative paths and paths with spaces. Many thanks to Alejandro Dubrovsky
+ for providing the patch.
+
-----------
Version 1.0
-----------
Modified: pygccxml_dev/pygccxml/binary_parsers/parsers.py
===================================================================
--- pygccxml_dev/pygccxml/binary_parsers/parsers.py 2009-10-01 22:59:08 UTC (rev 1762)
+++ pygccxml_dev/pygccxml/binary_parsers/parsers.py 2009-10-04 19:41:39 UTC (rev 1763)
@@ -216,8 +216,9 @@
"""parser for Linux .so file"""
nm_executable = 'nm'
#numeric-sort used for mapping between mangled and unmangled name
- cmd_mangled = '%(nm)s --extern-only --dynamic --defined-only --numeric-sort %(lib)s'
- cmd_demangled = '%(nm)s --extern-only --dynamic --defined-only --demangle --numeric-sort %(lib)s'
+ cmd_mangled = '%(nm)s --extern-only --dynamic --defined-only --numeric-sort %(lib)s'.split()
+ cmd_demangled = '%(nm)s --extern-only --dynamic --defined-only --demangle --numeric-sort %(lib)s'.split()
+
entry = re.compile( r'^(?P<address>(?:\w|\d)+)\s\w\s(?P<symbol>.+)$' )
def __init__( self, global_ns, binary_file ):
@@ -225,11 +226,9 @@
def __execute_nm( self, cmd ):
process = subprocess.Popen( args=cmd
- , shell=True
, stdin=subprocess.PIPE
, stdout=subprocess.PIPE
- , stderr=subprocess.STDOUT
- , cwd=os.path.dirname( self.binary_file ) )
+ , stderr=subprocess.STDOUT )
process.stdin.close()
output = []
@@ -254,8 +253,9 @@
def load_symbols( self ):
tmpl_args = dict( nm=self.nm_executable, lib=self.binary_file )
- mangled_smbls = self.__extract_symbols( self.cmd_mangled % tmpl_args )
- demangled_smbls = self.__extract_symbols( self.cmd_demangled % tmpl_args )
+ mangled_smbls = self.__extract_symbols( [part % tmpl_args for part in self.cmd_mangled] )
+ demangled_smbls = self.__extract_symbols( [part % tmpl_args for part in self.cmd_demangled] )
+
result = []
for address, blob in mangled_smbls.iteritems():
if address in demangled_smbls:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-01 22:59:14
|
Revision: 1762
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1762&view=rev
Author: roman_yakovenko
Date: 2009-10-01 22:59:08 +0000 (Thu, 01 Oct 2009)
Log Message:
-----------
Adding "explicit" attribute to constructor_t class
Modified Paths:
--------------
pygccxml_dev/docs/history/history.rest
Modified: pygccxml_dev/docs/history/history.rest
===================================================================
--- pygccxml_dev/docs/history/history.rest 2009-10-01 22:56:50 UTC (rev 1761)
+++ pygccxml_dev/docs/history/history.rest 2009-10-01 22:59:08 UTC (rev 1762)
@@ -21,6 +21,7 @@
* Jeremy Sanders
* Ben Schleimer
* Gustavo Carneiro
+* Christopher Bruns
-----------
SVN Version
@@ -46,7 +47,10 @@
7. Bug `[ 2779781 ] pygccxml reverses array dimensions <https://sourceforge.net/tracker/index.php?func=detail&aid=2779781&group_id=118209&atid=684318>`_
was fixed.
-
+8. "explicit" property was added to ``declarations.constructor_t`` class.
+ Many thanks to Christopher Bruns, for finding out how this property
+ works in `GCC-XML`_.
+
-----------
Version 1.0
-----------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-10-01 22:57:09
|
Revision: 1761
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1761&view=rev
Author: roman_yakovenko
Date: 2009-10-01 22:56:50 +0000 (Thu, 01 Oct 2009)
Log Message:
-----------
Adding "explicit" attribute to constructor_t class
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/calldef.py
pygccxml_dev/pygccxml/declarations/decl_printer.py
pygccxml_dev/pygccxml/parser/scanner.py
pygccxml_dev/unittests/data/declarations_calldef.hpp
pygccxml_dev/unittests/declarations_tester.py
pygccxml_dev/unittests/filters_tester.py
Modified: pygccxml_dev/pygccxml/declarations/calldef.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/calldef.py 2009-09-22 18:41:38 UTC (rev 1760)
+++ pygccxml_dev/pygccxml/declarations/calldef.py 2009-10-01 22:56:50 UTC (rev 1761)
@@ -532,7 +532,19 @@
"""describes constructor declaration"""
def __init__( self, *args, **keywords ):
member_calldef_t.__init__( self, *args, **keywords )
+ self._explicit = True
+ def _get_explicit(self):
+ return self._explicit
+ def _set_explicit(self, explicit):
+ if explicit in [True, '1']:
+ self._explicit = True
+ else:
+ self._explicit = False
+ explicit = property( _get_explicit, _set_explicit
+ , doc="""True, if constructor has "explicit" keyword, False otherwise
+ @type: bool""" )
+
def __str__(self):
# Get the full name of the calldef...
name = algorithm.full_name(self)
@@ -568,7 +580,6 @@
def is_trivial_constructor(self):
return not bool( self.arguments )
-
class destructor_t( member_calldef_t ):
"""describes deconstructor declaration"""
def __init__( self, *args, **keywords ):
Modified: pygccxml_dev/pygccxml/declarations/decl_printer.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/decl_printer.py 2009-09-22 18:41:38 UTC (rev 1760)
+++ pygccxml_dev/pygccxml/declarations/decl_printer.py 2009-10-01 22:56:50 UTC (rev 1761)
@@ -146,8 +146,11 @@
self.print_decl_header()
self.print_calldef_info()
+ indent = ' ' * (self.level+1) * self.INDENT_SIZE
+ self.writer( indent + "explicit: " + str(self.__inst.explicit) + os.linesep)
+
if self.__print_details:
- self.writer( ' ' * ( self.level + 1 ) * self.INDENT_SIZE
+ self.writer( indent
+ 'copy constructor: ' + str(self.__inst.is_copy_constructor) + os.linesep)
def visit_destructor( self ):
Modified: pygccxml_dev/pygccxml/parser/scanner.py
===================================================================
--- pygccxml_dev/pygccxml/parser/scanner.py 2009-09-22 18:41:38 UTC (rev 1760)
+++ pygccxml_dev/pygccxml/parser/scanner.py 2009-10-01 22:56:50 UTC (rev 1761)
@@ -29,6 +29,7 @@
XML_AN_CVS_REVISION = "cvs_revision"
XML_AN_DEFAULT = "default"
XML_AN_DEMANGLED = "demangled"
+XML_AN_EXPLICIT = "explicit"
XML_AN_EXTERN = "extern"
XML_AN_FILE = "file"
XML_AN_ID = "id"
@@ -494,6 +495,7 @@
def __read_constructor( self, attrs ):
constructor = self.__decl_factory.create_constructor()
self.__read_member_function( constructor, attrs, True )
+ constructor.explicit = attrs.get( XML_AN_EXPLICIT, False )
return constructor
def __read_function(self, attrs):
Modified: pygccxml_dev/unittests/data/declarations_calldef.hpp
===================================================================
--- pygccxml_dev/unittests/data/declarations_calldef.hpp 2009-09-22 18:41:38 UTC (rev 1760)
+++ pygccxml_dev/unittests/data/declarations_calldef.hpp 2009-10-01 22:56:50 UTC (rev 1761)
@@ -27,8 +27,10 @@
struct calldefs_t{
calldefs_t();
- calldefs_t(char);
+ explicit calldefs_t(char);
+ calldefs_t(some_exception_t);
+
calldefs_t(int,double);
calldefs_t(const calldefs_t&);
Modified: pygccxml_dev/unittests/declarations_tester.py
===================================================================
--- pygccxml_dev/unittests/declarations_tester.py 2009-09-22 18:41:38 UTC (rev 1760)
+++ pygccxml_dev/unittests/declarations_tester.py 2009-10-01 22:56:50 UTC (rev 1761)
@@ -123,7 +123,7 @@
destructor = struct_calldefs.calldef( '~calldefs_t' )
self._test_calldef_args( destructor, [] )
- self._test_calldef_return_type( destructor, None.__class__)
+ self._test_calldef_return_type( destructor, None.__class__)
#well, now we have a few functions ( constructors ) with the same name, there is no easy way
#to find the desired one. Well in my case I have only 4 constructors
@@ -132,14 +132,23 @@
#3. default
#4. copy constructor
constructor_found = struct_calldefs.constructors( 'calldefs_t' )
- self.failUnless( len( constructor_found ) == 4
- , "struct 'calldefs_t' has 4 constructors, pygccxml parser reports only about %d." \
+ self.failUnless( len( constructor_found ) == 5
+ , "struct 'calldefs_t' has 5 constructors, pygccxml parser reports only about %d." \
% len( constructor_found ) )
self.failUnless( 1 == len( filter( lambda constructor: constructor.is_copy_constructor, constructor_found ) )
, "copy constructor has not been found" )
#there is nothing to check about constructors - I know the implementation of parser
#In this case it doesn't different from any other function
+ c = struct_calldefs.constructor( 'calldefs_t', arg_types=['char'] )
+ self.failUnless( c.explicit == True
+ , "calldef_t constructor defined with 'explicit' keyword, for some reason the value is False ")
+
+ arg_type = declarated_t( self.global_ns.class_('some_exception_t') )
+ c = struct_calldefs.constructor( 'calldefs_t', arg_types=[arg_type] )
+ self.failUnless( c.explicit == False
+ , "calldef_t constructor defined without 'explicit' keyword, for some reason the value is True ")
+
def test_operator_symbol(self):
calldefs_operators = ['=', '==' ]
calldefs_cast_operators = ['char *', 'double']
Modified: pygccxml_dev/unittests/filters_tester.py
===================================================================
--- pygccxml_dev/unittests/filters_tester.py 2009-09-22 18:41:38 UTC (rev 1760)
+++ pygccxml_dev/unittests/filters_tester.py 2009-10-01 22:56:50 UTC (rev 1761)
@@ -40,9 +40,9 @@
public_members = declarations.matcher.find( criteria, self.global_ns )
if '0.9' in public_members[0].compiler:
public_members = filter( lambda d: not d.is_artificial, public_members )
- self.failUnless( 16 == len( public_members ) )
+ self.failUnless( 17 == len( public_members ) )
else:
- self.failUnless( 20 == len( public_members ) )
+ self.failUnless( 21 == len( public_members ) )
def test_or_matcher( self ):
criteria1 = declarations.regex_matcher_t( 'oper.*'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-09-22 18:41:56
|
Revision: 1760
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1760&view=rev
Author: roman_yakovenko
Date: 2009-09-22 18:41:38 +0000 (Tue, 22 Sep 2009)
Log Message:
-----------
function transformation functionality was fixed for regular functions, which returns "reference"
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py
pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp
pyplusplus_dev/unittests/function_transformations_tester.py
Modified: pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py
===================================================================
--- pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py 2009-09-21 19:20:25 UTC (rev 1759)
+++ pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py 2009-09-22 18:41:38 UTC (rev 1760)
@@ -90,11 +90,14 @@
tmpl_values['save_result'] = ''
if not declarations.is_void( self.declaration.return_type ):
- tmpl_values['save_result'] \
- = '%(type)s %(name)s = ' \
- % { 'type': cntrl.result_variable.type.decl_string
- , 'name' : cntrl.result_variable.name }
+ tmpl_tmp = '%(type)s %(name)s = '
+ if declarations.is_reference( self.declaration.return_type ):
+ tmpl_tmp = tmpl_tmp + '&'
+ tmpl_values['save_result'] = tmpl_tmp \
+ % { 'type': cntrl.result_variable.type.decl_string
+ , 'name' : cntrl.result_variable.name }
+
tmpl_values['function_name'] = self.resolve_function_ref()
tmpl_values['arg_expressions'] = self.PARAM_SEPARATOR.join( cntrl.arg_expressions )
return_stmt_creator = calldef_utils.return_stmt_creator_t( self
@@ -353,7 +356,7 @@
if not declarations.is_void( self.declaration.return_type ):
tmpl_tmp = '%(result_var_name)s = '
if declarations.is_reference( self.declaration.return_type ):
- tmpl_tmp = '%(result_var_name)s = &'
+ tmpl_tmp = tmpl_tmp + '&'
tmpl_values['save_result'] = tmpl_tmp % dict( result_var_name=cntrl.result_variable.name )
tmpl_values['function_name'] = self.declaration.name
Modified: pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp 2009-09-21 19:20:25 UTC (rev 1759)
+++ pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp 2009-09-22 18:41:38 UTC (rev 1760)
@@ -277,4 +277,24 @@
}
+
+namespace ft_bugs2{
+
+class A2 {
+protected:
+ virtual ~A2(){};
+};
+
+class B2 {};
+
+class C2 {
+public:
+ B2& g(A2 const & x, int n){ return b; }
+private:
+ B2 b;
+};
+
+
+}
+
#endif//__function_transformations_to_be_exported_hpp__
Modified: pyplusplus_dev/unittests/function_transformations_tester.py
===================================================================
--- pyplusplus_dev/unittests/function_transformations_tester.py 2009-09-21 19:20:25 UTC (rev 1759)
+++ pyplusplus_dev/unittests/function_transformations_tester.py 2009-09-22 18:41:38 UTC (rev 1760)
@@ -112,10 +112,15 @@
h2.add_transformation( ft.modify_type(0, remove_const_ref ) )
h2.call_policies = call_policies.return_internal_reference()
-
ft_bugs.class_( 'B' ).always_expose_using_scope = True
ft_bugs.mem_fun( 'get_a' ).call_policies \
= call_policies.return_value_policy( call_policies.reference_existing_object )
+
+ ft_bugs2 = mb.namespace( 'ft_bugs2' )
+ g = ft_bugs2.mem_fun( 'g' )
+ g.add_transformation( ft.modify_type(0, remove_const_ref ) )
+ g.call_policies = call_policies.return_internal_reference()
+
def run_tests(self, module):
"""Run the actual unit tests.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-09-21 19:20:32
|
Revision: 1759
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1759&view=rev
Author: roman_yakovenko
Date: 2009-09-21 19:20:25 +0000 (Mon, 21 Sep 2009)
Log Message:
-----------
function transformation functionality was fixed for virtual functions, which returns "reference"
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py
pyplusplus_dev/pyplusplus/function_transformers/controllers.py
pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp
pyplusplus_dev/unittests/function_transformations_tester.py
Modified: pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py
===================================================================
--- pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py 2009-09-19 18:59:58 UTC (rev 1758)
+++ pyplusplus_dev/pyplusplus/code_creators/calldef_transformed.py 2009-09-21 19:20:25 UTC (rev 1759)
@@ -351,7 +351,10 @@
tmpl_values['save_result'] = ''
if not declarations.is_void( self.declaration.return_type ):
- tmpl_values['save_result'] = '%s = ' % cntrl.result_variable.name
+ tmpl_tmp = '%(result_var_name)s = '
+ if declarations.is_reference( self.declaration.return_type ):
+ tmpl_tmp = '%(result_var_name)s = &'
+ tmpl_values['save_result'] = tmpl_tmp % dict( result_var_name=cntrl.result_variable.name )
tmpl_values['function_name'] = self.declaration.name
tmpl_values['arg_expressions'] = self.PARAM_SEPARATOR.join( cntrl.arg_expressions )
Modified: pyplusplus_dev/pyplusplus/function_transformers/controllers.py
===================================================================
--- pyplusplus_dev/pyplusplus/function_transformers/controllers.py 2009-09-19 18:59:58 UTC (rev 1758)
+++ pyplusplus_dev/pyplusplus/function_transformers/controllers.py 2009-09-21 19:20:25 UTC (rev 1759)
@@ -131,8 +131,15 @@
controller_base_t.__init__( self, function )
self.__vars_manager = create_variables_manager( function )
self.__wrapper_args = [ arg.clone() for arg in function.arguments ]
- self.__result_var = variable_t( self.function.return_type
- , self.register_variable_name( 'result' ) )
+
+ initialize_expr = ''
+ result_type = self.function.return_type
+ if declarations.is_reference( self.function.return_type ):
+ initialize_expr = ' = 0'
+ result_type = declarations.pointer_t( declarations.remove_reference( self.function.return_type ) )
+ self.__result_var = variable_t( result_type
+ , self.register_variable_name( 'result' )
+ , initialize_expr=initialize_expr )
self.__return_variables = []
self.__pre_call = []
self.__post_call = []
Modified: pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp 2009-09-19 18:59:58 UTC (rev 1758)
+++ pyplusplus_dev/unittests/data/function_transformations_to_be_exported.hpp 2009-09-21 19:20:25 UTC (rev 1759)
@@ -269,9 +269,10 @@
class B {
public:
- virtual C* h(A const & x){ return 0;} // this does not work
- //C *h(A const & x); // this works
- //virtual C *h(); // and this
+ virtual C* h(A const & x){ return 0;}
+ virtual C& h2(A const & x){ return c;}
+private:
+ C c;
};
}
Modified: pyplusplus_dev/unittests/function_transformations_tester.py
===================================================================
--- pyplusplus_dev/unittests/function_transformations_tester.py 2009-09-19 18:59:58 UTC (rev 1758)
+++ pyplusplus_dev/unittests/function_transformations_tester.py 2009-09-21 19:20:25 UTC (rev 1759)
@@ -107,6 +107,12 @@
h = ft_bugs.mem_fun( 'h' )
h.add_transformation( ft.modify_type(0, remove_const_ref ) )
h.call_policies = call_policies.return_internal_reference()
+
+ h2 = ft_bugs.mem_fun( 'h2' )
+ h2.add_transformation( ft.modify_type(0, remove_const_ref ) )
+ h2.call_policies = call_policies.return_internal_reference()
+
+
ft_bugs.class_( 'B' ).always_expose_using_scope = True
ft_bugs.mem_fun( 'get_a' ).call_policies \
= call_policies.return_value_policy( call_policies.reference_existing_object )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2009-09-19 19:53:21
|
Revision: 1758
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1758&view=rev
Author: roman_yakovenko
Date: 2009-09-19 18:59:58 +0000 (Sat, 19 Sep 2009)
Log Message:
-----------
updating history and fixing few compilation errors in code, found by new gcc
Modified Paths:
--------------
pyplusplus_dev/docs/history/history.rest
pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp
pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp
Modified: pyplusplus_dev/docs/history/history.rest
===================================================================
--- pyplusplus_dev/docs/history/history.rest 2009-09-19 18:57:48 UTC (rev 1757)
+++ pyplusplus_dev/docs/history/history.rest 2009-09-19 18:59:58 UTC (rev 1758)
@@ -24,6 +24,7 @@
* Bernd Fritzke
* Andrei Vermel
* Carsten( spom.spom )
+* Pertti Kellomäki
-----------
SVN Version
@@ -50,6 +51,8 @@
6. Support for `std::hash_map<...>` and `std::hash_set<...>` containers was added.
+7. The bug related to transformed virtual function was fixed. Many thanks to Pertti Kellomäki.
+
-----------
Version 1.0
-----------
Modified: pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp
===================================================================
--- pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp 2009-09-19 18:57:48 UTC (rev 1757)
+++ pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp 2009-09-19 18:59:58 UTC (rev 1758)
@@ -7,6 +7,8 @@
namespace member_variables{
+const array_t::variable_t array_t::vars[] = { array_t::variable_t(), array_t::variable_t(), array_t::variable_t() };
+
int point::instance_count = 0;
const point::color point::default_color = point::red;
Modified: pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp 2009-09-19 18:57:48 UTC (rev 1757)
+++ pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp 2009-09-19 18:59:58 UTC (rev 1758)
@@ -49,7 +49,8 @@
unsigned int get_b(const bit_fields_t& inst);
struct array_t{
- array_t(){
+ array_t()
+ {
for( int i = 0; i < 10; ++i ){
ivars[i] = -i;
}
@@ -64,7 +65,7 @@
return ivars[index];
}
- const variable_t vars[3];
+ static const variable_t vars[3];
int ivars[10];
int ivars2[10];
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|