pygccxml-commit Mailing List for C++ Python language bindings (Page 21)
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...> - 2008-06-26 09:36:17
|
Revision: 1357
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1357&view=rev
Author: roman_yakovenko
Date: 2008-06-26 02:36:26 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
cleaning no_init conditions
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/code_creators/class_declaration.py
Modified: pyplusplus_dev/pyplusplus/code_creators/class_declaration.py
===================================================================
--- pyplusplus_dev/pyplusplus/code_creators/class_declaration.py 2008-06-26 07:41:16 UTC (rev 1356)
+++ pyplusplus_dev/pyplusplus/code_creators/class_declaration.py 2008-06-26 09:36:26 UTC (rev 1357)
@@ -218,15 +218,14 @@
result.append( ', %s' % self.documentation )
used_init = None
inits = filter( lambda x: isinstance( x, calldef.constructor_t ), self.creators )
- if ( self.declaration.is_abstract \
- or not declarations.has_any_non_copyconstructor(self.declaration) ) \
- and not self.wrapper \
- or ( declarations.has_destructor( self.declaration )
- and not declarations.has_public_destructor( self.declaration ) ):
- #TODO: or self.declaration has public constructor and destructor
+ has_nonpublic_destructor = declarations.has_destructor( self.declaration ) \
+ and not declarations.has_public_destructor( self.declaration )
+ if has_nonpublic_destructor \
+ or ( self.declaration.is_abstract and not self.wrapper ) \
+ or not declarations.has_any_non_copyconstructor(self.declaration):
result.append( ", " )
result.append( algorithm.create_identifier( self, '::boost::python::no_init' ) )
- elif not declarations.has_trivial_constructor( self.declaration ):
+ elif not self.declaration.find_trivial_constructor():
if inits:
used_init = inits[0]
result.append( ", " )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-26 07:41:07
|
Revision: 1356
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1356&view=rev
Author: roman_yakovenko
Date: 2008-06-26 00:41:16 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
updating to latest GCCXML version
struct X{ const int items[10]; } will generate noncopyable in class_ definition
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/code_creators/class_declaration.py
Modified: pyplusplus_dev/pyplusplus/code_creators/class_declaration.py
===================================================================
--- pyplusplus_dev/pyplusplus/code_creators/class_declaration.py 2008-06-26 06:13:05 UTC (rev 1355)
+++ pyplusplus_dev/pyplusplus/code_creators/class_declaration.py 2008-06-26 07:41:16 UTC (rev 1356)
@@ -148,7 +148,11 @@
return operator_creators
def _generate_noncopyable(self):
- if self.declaration.noncopyable:
+ noncopyable_vars = self.declaration.find_noncopyable_vars()
+ copy_constr = self.declaration.find_copy_constructor()
+
+ if self.declaration.noncopyable \
+ or copy_constr and copy_constr.is_artificial and noncopyable_vars:
return algorithm.create_identifier( self, '::boost::noncopyable' )
def _generate_bases(self, base_creators):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-26 06:12:56
|
Revision: 1355
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1355&view=rev
Author: roman_yakovenko
Date: 2008-06-25 23:13:05 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
small bug fix
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/class_declaration.py
Modified: pygccxml_dev/pygccxml/declarations/class_declaration.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/class_declaration.py 2008-06-25 19:59:13 UTC (rev 1354)
+++ pygccxml_dev/pygccxml/declarations/class_declaration.py 2008-06-26 06:13:05 UTC (rev 1355)
@@ -519,8 +519,8 @@
if tt.is_array( no_const ):
logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes const member variable - array" % self.decl_string )
noncopyable_vars.append( mvar )
- if tt.is_class( type_ ):
- cls = type_.declaration
+ if tt.class_traits.is_my_case( type_ ):
+ cls = tt.class_traits.get_declaration( type_ )
if tt.is_noncopyable( cls ):
logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes member variable - class that is not copyable" % self.decl_string )
noncopyable_vars.append( mvar )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-25 19:59:13
|
Revision: 1354
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1354&view=rev
Author: roman_yakovenko
Date: 2008-06-25 12:59:13 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
another fixes to adopt new gccxml version
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/module_creator/creator.py
Modified: pyplusplus_dev/pyplusplus/module_creator/creator.py
===================================================================
--- pyplusplus_dev/pyplusplus/module_creator/creator.py 2008-06-25 19:19:38 UTC (rev 1353)
+++ pyplusplus_dev/pyplusplus/module_creator/creator.py 2008-06-25 19:59:13 UTC (rev 1354)
@@ -19,7 +19,6 @@
ACCESS_TYPES = declarations.ACCESS_TYPES
VIRTUALITY_TYPES = declarations.VIRTUALITY_TYPES
-#TODO: don't export functions that returns non const pointer to fundamental types
#TODO: add print decl_wrapper.readme messages
#class Foo{
# union {
@@ -575,44 +574,21 @@
self.curr_code_creator.wrapper.adopt_creator( wrapper )
else:
self.__extmodule.adopt_declaration_creator( wrapper )
+
#next constructors are not present in code, but compiler generated
- #Boost.Python requiers them to be declared in the wrapper class
- if '0.9' in self.curr_decl.compiler:
- copy_constr = self.curr_decl.find_copy_constructor()
- add_to_wrapper = False
- if declarations.has_copy_constructor( self.curr_decl ):
- #find out whether user or compiler defined it
- if self.curr_decl.noncopyable:
- add_to_wrapper = False
- elif not copy_constr:
- add_to_wrapper = True #compiler defined will not be exposed manually later
- elif copy_constr.is_artificial:
- add_to_wrapper = True #compiler defined will not be exposed manually later
- if add_to_wrapper:
- cccc = code_creators.copy_constructor_wrapper_t( class_=self.curr_decl)
- wrapper.adopt_creator( cccc )
- trivial_constr = self.curr_decl.find_trivial_constructor()
- add_to_wrapper = False
- if declarations.has_trivial_constructor( self.curr_decl ):
- if not trivial_constr:
- add_to_wrapper = True
- elif trivial_constr.is_artificial:
- add_to_wrapper = True
- if add_to_wrapper:
- tcons = code_creators.null_constructor_wrapper_t( class_=self.curr_decl )
- wrapper.adopt_creator( tcons )
- else:
- if declarations.has_copy_constructor( self.curr_decl ):
- copy_constr = self.curr_decl.find_copy_constructor()
- if not self.curr_decl.noncopyable and copy_constr.is_artificial:
- cccc = code_creators.copy_constructor_wrapper_t( class_=self.curr_decl)
- wrapper.adopt_creator( cccc )
- null_constr = self.curr_decl.find_trivial_constructor()
- if null_constr and null_constr.is_artificial:
- #this constructor is not going to be exposed
- tcons = code_creators.null_constructor_wrapper_t( class_=self.curr_decl )
- wrapper.adopt_creator( tcons )
+ #Boost.Python requiers them to be declared in the wrapper class
+ noncopyable_vars = self.curr_decl.find_noncopyable_vars()
+
+ copy_constr = self.curr_decl.find_copy_constructor()
+ if not self.curr_decl.noncopyable and copy_constr and copy_constr.is_artificial:
+ cccc = code_creators.copy_constructor_wrapper_t( class_=self.curr_decl)
+ wrapper.adopt_creator( cccc )
+ trivial_constr = self.curr_decl.find_trivial_constructor()
+ if trivial_constr and trivial_constr.is_artificial and not noncopyable_vars:
+ tcons = code_creators.null_constructor_wrapper_t( class_=self.curr_decl )
+ wrapper.adopt_creator( tcons )
+
exposed = self.expose_overloaded_mem_fun_using_macro( cls_decl, cls_cc )
cls_parent_cc.adopt_creator( cls_cc )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-25 19:19:34
|
Revision: 1353
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1353&view=rev
Author: roman_yakovenko
Date: 2008-06-25 12:19:38 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
fix tester
Modified Paths:
--------------
pyplusplus_dev/unittests/data/global_variables_to_be_exported.cpp
pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp
pyplusplus_dev/unittests/global_variables_tester.py
Modified: pyplusplus_dev/unittests/data/global_variables_to_be_exported.cpp
===================================================================
--- pyplusplus_dev/unittests/data/global_variables_to_be_exported.cpp 2008-06-25 17:52:00 UTC (rev 1352)
+++ pyplusplus_dev/unittests/data/global_variables_to_be_exported.cpp 2008-06-25 19:19:38 UTC (rev 1353)
@@ -20,3 +20,5 @@
}
}
+
+const char someSin[3] = "AB";
\ No newline at end of file
Modified: pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp 2008-06-25 17:52:00 UTC (rev 1352)
+++ pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp 2008-06-25 19:19:38 UTC (rev 1353)
@@ -22,6 +22,6 @@
}
-extern const char someSin[256];
+extern const char someSin[3];
#endif//__global_variables_to_be_exported_hpp__
Modified: pyplusplus_dev/unittests/global_variables_tester.py
===================================================================
--- pyplusplus_dev/unittests/global_variables_tester.py 2008-06-25 17:52:00 UTC (rev 1352)
+++ pyplusplus_dev/unittests/global_variables_tester.py 2008-06-25 19:19:38 UTC (rev 1353)
@@ -27,7 +27,10 @@
self.failUnless( 10 == len( module.garray ) )
for index in range( 10 ):
self.failUnless( -index == module.garray[index].value )
-
+ self.failUnless( 3 == len( module.someSin )
+ and module.someSin[0] == 'A'
+ and module.someSin[1] == 'B'
+ and module.someSin[2] == '\0' )
def create_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(tester_t))
@@ -37,4 +40,4 @@
unittest.TextTestRunner(verbosity=2).run( create_suite() )
if __name__ == "__main__":
- run_suite()
\ No newline at end of file
+ run_suite()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-25 17:51:58
|
Revision: 1352
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1352&view=rev
Author: roman_yakovenko
Date: 2008-06-25 10:52:00 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
updating unit test to take into account artifical declarations
Modified Paths:
--------------
pyplusplus_dev/unittests/operators_tester.py
Modified: pyplusplus_dev/unittests/operators_tester.py
===================================================================
--- pyplusplus_dev/unittests/operators_tester.py 2008-06-25 08:40:21 UTC (rev 1351)
+++ pyplusplus_dev/unittests/operators_tester.py 2008-06-25 17:52:00 UTC (rev 1352)
@@ -12,9 +12,9 @@
class tester_t(fundamental_tester_base.fundamental_tester_base_t):
EXTENSION_NAME = 'operators'
-
+
def __init__( self, *args ):
- fundamental_tester_base.fundamental_tester_base_t.__init__(
+ fundamental_tester_base.fundamental_tester_base_t.__init__(
self
, tester_t.EXTENSION_NAME
, *args )
@@ -27,75 +27,77 @@
xxx_ref = declarations.reference_t( declarations.const_t( declarations.declarated_t( xxx ) ) )
oper = mb.global_ns.free_operator( '<<', arg_types=[None, xxx_ref] )
oper.include()
-
+
mb.class_( 'YYY' ).include()
-
+
rational = mb.class_('rational<long>')
rational.include()
rational.alias = "pyrational"
-
+
#Test query api.
- rational.operator( '=' )
- rational.operator( name='operator=' )
- rational.operator( symbol='=' )
+ #artificial declarations come back
+ #rational.operator( '=' )
+ #rational.operator( name='operator=' )
+ #rational.operator( symbol='=' )
rational.operators( '=' )
rational.operators( name='operator=' )
rational.operators( symbol='=' )
- rational.member_operator( '=' )
- rational.member_operator( name='operator=' )
- rational.member_operator( symbol='=' )
+ #artificial declarations come back
+ #rational.member_operator( '=' )
+ #rational.member_operator( name='operator=' )
+ #rational.member_operator( symbol='=' )
rational.member_operators( '=' )
rational.member_operators( name='operator=' )
rational.member_operators( symbol='=' )
mb.global_ns.free_operators( '<<' )
mb.global_ns.free_operators( name='operator<<' )
mb.global_ns.free_operators( symbol='<<' )
-
+
r_assign = rational.calldef( 'assign', recursive=False )
r_assign.call_policies = call_policies.return_self()
foperators = mb.free_operators( lambda decl: 'rational<long>' in decl.decl_string )
foperators.include()
-
+
bad_rational = mb.class_('bad_rational' )
bad_rational.include()
- def run_tests(self, module):
+ def run_tests(self, module):
pyrational = module.pyrational
self.failUnless( pyrational( 28, 7) == 4 )
self.failUnless( pyrational( 28, 7) == pyrational( 4 ) )
-
+
r1 = pyrational( 5, 7 )
-
+
r1 += pyrational( 4, 11 )
r2 = pyrational( 5*11 + 7*4, 7*11 )
self.failUnless( r1 == r2 )
-
+
r1 -= pyrational( 5, 7)
self.failUnless( r1 == pyrational( 4, 11) )
-
+
r1 *= 2
self.failUnless( r1 == pyrational( 8, 11) )
-
+
r1 /= 3
self.failUnless( r1 == pyrational( 8, 33) )
-
- r2 = not r1
+
+ r2 = not r1
self.failUnless( r2 == False )
-
+
self.failUnless( 0 < r1 )
-
+
r1 = pyrational( 5, 7 )
self.failUnless( r1.assign( 17 ) == pyrational( 17, 1 ) )
-
+
x = module.XXX()
print str( x )
-
+
y = module.YYY()
print str( y )
-
+
def create_suite():
- suite = unittest.TestSuite()
+ suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(tester_t))
return suite
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-25 08:40:11
|
Revision: 1351
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1351&view=rev
Author: roman_yakovenko
Date: 2008-06-25 01:40:21 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
small bug fix
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/class_declaration.py
Modified: pygccxml_dev/pygccxml/declarations/class_declaration.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/class_declaration.py 2008-06-25 06:43:06 UTC (rev 1350)
+++ pygccxml_dev/pygccxml/declarations/class_declaration.py 2008-06-25 08:40:21 UTC (rev 1351)
@@ -509,7 +509,7 @@
for mvar in mvars:
type_ = tt.remove_reference( mvar.type )
if tt.is_const( type_ ):
- no_const = remove_const( type_ )
+ no_const = tt.remove_const( type_ )
if tt.is_fundamental( no_const ) or tt.is_enum( no_const):
logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes const member variable - fundamental or enum" % self.decl_string )
noncopyable_vars.append( mvar )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-25 06:42:59
|
Revision: 1350
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1350&view=rev
Author: roman_yakovenko
Date: 2008-06-24 23:43:06 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
updating environment.py to boost svn version
Modified Paths:
--------------
pyplusplus_dev/environment.py
Modified: pyplusplus_dev/environment.py
===================================================================
--- pyplusplus_dev/environment.py 2008-06-25 06:39:31 UTC (rev 1349)
+++ pyplusplus_dev/environment.py 2008-06-25 06:43:06 UTC (rev 1350)
@@ -13,13 +13,10 @@
include = ''
class gccxml:
- gccxml_07_path = os.path.join( this_module_dir_path, '..', 'gccxml_bin', 'v07', sys.platform, 'bin' )
gccxml_09_path = os.path.join( this_module_dir_path, '..', 'gccxml_bin', 'v09', sys.platform, 'bin' )
gccxml_path = gccxml_09_path
gccxml_version = '__GCCXML_09__'
- if '0.7' in gccxml_version:
- gccxml_version = '__GCCXML_07__'
executable = gccxml_path
@@ -36,9 +33,9 @@
if sys.platform == 'win32':
scons.suffix = '.pyd'
- scons.ccflags = ['/MD', '/EHsc', '/GR', '/Zc:wchar_t', '/Zc:forScope' ]
- boost.libs = [ 'd:/dev/boost_cvs/libs/python/build/bin-stage' ]
- boost.include = 'd:/dev/boost_cvs'
+ scons.ccflags = ['/MD', '/EHsc', '/GR', '/Zc:wchar_t', '/Zc:forScope', '-DBOOST_PYTHON_NO_PY_SIGNATURES' ]
+ boost.libs = [ 'd:/dev/boost_svn/bin.v2/libs/python/build/msvc-7.1/release' ]
+ boost.include = 'd:/dev/boost_svn'
python.libs = 'e:/python25/libs'
python.include = 'e:/python25/include'
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-25 06:39:25
|
Revision: 1349
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1349&view=rev
Author: roman_yakovenko
Date: 2008-06-24 23:39:31 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
small refactoring in "noncopyable" area
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/class_declaration.py
pygccxml_dev/pygccxml/declarations/type_traits.py
Modified: pygccxml_dev/pygccxml/declarations/class_declaration.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/class_declaration.py 2008-06-24 06:52:49 UTC (rev 1348)
+++ pygccxml_dev/pygccxml/declarations/class_declaration.py 2008-06-25 06:39:31 UTC (rev 1349)
@@ -18,6 +18,7 @@
import algorithm
import declaration
import dependencies
+from pygccxml import utils
class ACCESS_TYPES:
"""class that defines "access" constants"""
@@ -498,5 +499,33 @@
return 'wstring'
else:
return get_partial_name( self.name )
+
+ def find_noncopyable_vars( self ):
+ """returns list of all noncopyable variables"""
+ import type_traits as tt#prevent cyclic dependencies
+ logger = utils.loggers.cxx_parser
+ mvars = self.vars( lambda v: not v.type_qualifiers.has_static, recursive=False, allow_empty=True )
+ noncopyable_vars = []
+ for mvar in mvars:
+ type_ = tt.remove_reference( mvar.type )
+ if tt.is_const( type_ ):
+ no_const = remove_const( type_ )
+ if tt.is_fundamental( no_const ) or tt.is_enum( no_const):
+ logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes const member variable - fundamental or enum" % self.decl_string )
+ noncopyable_vars.append( mvar )
+ if tt.is_class( no_const ):
+ logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes const member variable - class" % self.decl_string )
+ noncopyable_vars.append( mvar )
+ if tt.is_array( no_const ):
+ logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes const member variable - array" % self.decl_string )
+ noncopyable_vars.append( mvar )
+ if tt.is_class( type_ ):
+ cls = type_.declaration
+ if tt.is_noncopyable( cls ):
+ logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes member variable - class that is not copyable" % self.decl_string )
+ noncopyable_vars.append( mvar )
+ logger.debug( "__contains_noncopyable_mem_var - %s - false - doesn't contains noncopyable members" % self.decl_string )
+ return noncopyable_vars
+
class_types = ( class_t, class_declaration_t )
Modified: pygccxml_dev/pygccxml/declarations/type_traits.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/type_traits.py 2008-06-24 06:52:49 UTC (rev 1348)
+++ pygccxml_dev/pygccxml/declarations/type_traits.py 2008-06-25 06:39:31 UTC (rev 1349)
@@ -800,31 +800,6 @@
"""returns True, if source could be converted to target, otherwise False"""
return __is_convertible_t( source, target ).is_convertible()
-def __contains_noncopyable_mem_var( class_ ):
- """implementation details"""
- logger = utils.loggers.cxx_parser
- mvars = class_.vars( lambda v: not v.type_qualifiers.has_static, recursive=False, allow_empty=True )
- for mvar in mvars:
- type_ = remove_alias( mvar.type )
- type_ = remove_reference( type_ )
- if is_const( type_ ):
- no_const = remove_const( type_ )
- if is_fundamental( no_const ) or is_enum( no_const):
- logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes const member variable - fundamental or enum" % class_.decl_string )
- return True
- if is_class( no_const ):
- logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes const member variable - class" % class_.decl_string )
- return True
- if is_array( no_const ):
- logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes const member variable - array" % class_.decl_string )
- return True
- if is_class( type_ ):
- cls = type_.declaration
- if is_noncopyable( cls ):
- logger.debug( "__contains_noncopyable_mem_var - %s - TRUE - containes member variable - class that is not copyable" % class_.decl_string )
- return True
- logger.debug( "__contains_noncopyable_mem_var - %s - false - doesn't contains noncopyable members" % class_.decl_string )
-
def __is_noncopyable_single( class_):
"""implementation details"""
#It is not enough to check base classes, we should also to check
@@ -844,7 +819,7 @@
])
logger.debug( msg )
return False
- if __contains_noncopyable_mem_var( class_ ):
+ if class_.find_noncopyable_vars():
logger.debug( "__is_noncopyable_single(TRUE) - %s - contains noncopyable members" % class_.decl_string )
return True
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-24 06:52:40
|
Revision: 1348
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1348&view=rev
Author: roman_yakovenko
Date: 2008-06-23 23:52:49 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
bug fix: code generation for arrays defined in global namespace
Thanks to Hans Meine
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/code_creators/global_variable.py
pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp
Modified: pyplusplus_dev/pyplusplus/code_creators/global_variable.py
===================================================================
--- pyplusplus_dev/pyplusplus/code_creators/global_variable.py 2008-06-24 05:23:42 UTC (rev 1347)
+++ pyplusplus_dev/pyplusplus/code_creators/global_variable.py 2008-06-24 06:52:49 UTC (rev 1348)
@@ -122,7 +122,7 @@
def _create_namespaces(self):
ns_names = declarations.declaration_path( self.declaration.parent )
- if len(ns_names) > 1 and ns_names[0] == '::':
+ if len(ns_names) >= 1 and ns_names[0] == '::':
ns_names = ns_names[1:]
return ns_names
Modified: pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp 2008-06-24 05:23:42 UTC (rev 1347)
+++ pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp 2008-06-24 06:52:49 UTC (rev 1348)
@@ -21,4 +21,7 @@
}
+
+extern const char someSin[256];
+
#endif//__global_variables_to_be_exported_hpp__
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-24 05:23:35
|
Revision: 1347
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1347&view=rev
Author: roman_yakovenko
Date: 2008-06-23 22:23:42 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
small unit tests improvements
Modified Paths:
--------------
pygccxml_dev/unittests/complex_types_tester.py
pygccxml_dev/unittests/declarations_tester.py
Modified: pygccxml_dev/unittests/complex_types_tester.py
===================================================================
--- pygccxml_dev/unittests/complex_types_tester.py 2008-06-24 05:18:03 UTC (rev 1346)
+++ pygccxml_dev/unittests/complex_types_tester.py 2008-06-24 05:23:42 UTC (rev 1347)
@@ -3,6 +3,7 @@
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
+import sys
import unittest
import autoconfig
import parser_test_case
@@ -30,12 +31,13 @@
pass
def create_suite():
- suite = unittest.TestSuite()
- suite.addTest( unittest.makeSuite(tester_t))
+ suite = unittest.TestSuite()
+ if sys.platform != 'win32':
+ suite.addTest( unittest.makeSuite(tester_t))
return suite
def run_suite():
unittest.TextTestRunner(verbosity=2).run( create_suite() )
if __name__ == "__main__":
- run_suite()
\ No newline at end of file
+ run_suite()
Modified: pygccxml_dev/unittests/declarations_tester.py
===================================================================
--- pygccxml_dev/unittests/declarations_tester.py 2008-06-24 05:18:03 UTC (rev 1346)
+++ pygccxml_dev/unittests/declarations_tester.py 2008-06-24 05:23:42 UTC (rev 1347)
@@ -198,7 +198,7 @@
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(file_by_file_tester_t))
suite.addTest( unittest.makeSuite(all_at_once_tester_t))
- if sys.platform == 'win32':
+ if sys.platform == 'win32' and autoconfig.get_pdb_global_ns():
suite.addTest( unittest.makeSuite(pdb_based_tester_t))
return suite
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-24 05:17:54
|
Revision: 1346
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1346&view=rev
Author: roman_yakovenko
Date: 2008-06-23 22:18:03 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
updating gccxml version to the latest SVN
Modified Paths:
--------------
gccxml_bin/v09/win32/bin/gccxml.exe
gccxml_bin/v09/win32/bin/gccxml_cc1plus.exe
gccxml_bin/v09/win32/bin/gccxml_vcconfig.exe
Modified: gccxml_bin/v09/win32/bin/gccxml.exe
===================================================================
(Binary files differ)
Modified: gccxml_bin/v09/win32/bin/gccxml_cc1plus.exe
===================================================================
(Binary files differ)
Modified: gccxml_bin/v09/win32/bin/gccxml_vcconfig.exe
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-23 21:47:39
|
Revision: 1345
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1345&view=rev
Author: roman_yakovenko
Date: 2008-06-23 14:47:49 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
adding gccxml executable to the dialog, if it runs from the source tree
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/gui/ui.py
Modified: pyplusplus_dev/pyplusplus/gui/ui.py
===================================================================
--- pyplusplus_dev/pyplusplus/gui/ui.py 2008-06-23 21:46:49 UTC (rev 1344)
+++ pyplusplus_dev/pyplusplus/gui/ui.py 2008-06-23 21:47:49 UTC (rev 1345)
@@ -10,6 +10,7 @@
"""
import os
+import sys
import time
import Tkinter
import tkFileDialog
@@ -112,6 +113,13 @@
temp.grid( row=10, column=1, columnspan=2, sticky=Tkinter.NE + Tkinter.W)
map( lambda i: self.rowconfigure( i, weight=1 ), range(11) )
+
+ this_module_dir_path = os.path.abspath ( os.path.dirname( sys.modules[__name__].__file__) )
+ this_module_dir_path = this_module_dir_path.replace( '\\', '/' )
+ this_module_dir_path = this_module_dir_path.lower()
+ if this_module_dir_path.endswith( '/sources/pyplusplus_dev/pyplusplus/gui' ):
+ gccxml_09_path = os.path.join( this_module_dir_path, '..', '..', '..', 'gccxml_bin', 'v09', sys.platform, 'bin' )
+ self._gccxml_location.insert( 0, gccxml_09_path )
def _select_gccxml_executable( self ):
file_name = tkFileDialog.askopenfilename()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-23 21:46:40
|
Revision: 1344
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1344&view=rev
Author: roman_yakovenko
Date: 2008-06-23 14:46:49 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
updating to boost svn
Modified Paths:
--------------
pyplusplus_dev/environment.py
Modified: pyplusplus_dev/environment.py
===================================================================
--- pyplusplus_dev/environment.py 2008-06-23 20:23:05 UTC (rev 1343)
+++ pyplusplus_dev/environment.py 2008-06-23 21:46:49 UTC (rev 1344)
@@ -43,11 +43,11 @@
python.include = 'e:/python25/include'
else:
scons.suffix = '.so'
- boost.libs = ['/home/roman/boost_cvs/libs/python/build/bin-stage' ]
- boost.include = '/home/roman/boost_cvs'
- python.include = '/usr/include/python2.4'
+ scons.ccflags = ['-DBOOST_PYTHON_NO_PY_SIGNATURES' ]
+ boost.libs = ['/home/roman/include/libs' ]
+ boost.include = '/home/roman/boost_svn'
+ python.include = '/usr/include/python2.5'
-
_my_path = None
try:
import environment_path_helper
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-23 20:23:00
|
Revision: 1343
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1343&view=rev
Author: roman_yakovenko
Date: 2008-06-23 13:23:05 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
updating type_traits functionality
Modified Paths:
--------------
pygccxml_dev/unittests/type_traits_tester.py
Modified: pygccxml_dev/unittests/type_traits_tester.py
===================================================================
--- pygccxml_dev/unittests/type_traits_tester.py 2008-06-23 20:16:33 UTC (rev 1342)
+++ pygccxml_dev/unittests/type_traits_tester.py 2008-06-23 20:23:05 UTC (rev 1343)
@@ -42,11 +42,16 @@
self.failUnless( controller( decl.type )
, 'for type "%s" the answer to the question "%s" should be True'
% ( decl.type.decl_string, ns_name ) )
+ elif isinstance( decl, declarations.calldef_t ) and decl.name.startswith( 'test_' ):
+ continue
else:
self.failUnless( controller( decl )
, 'for type "%s" the answer to the question "%s" should be True'
% ( decl.decl_string, ns_name ) )
for decl in ns_no.declarations:
+ if isinstance( decl, declarations.calldef_t ) and decl.name.startswith( 'test_' ):
+ continue
+
self.failIf( controller( decl )
, 'for type "%s" the answer to the question "%s" should be False'
% ( decl.decl_string, ns_name ) )
@@ -234,9 +239,21 @@
for tester in filter( lambda decl: decl.name.startswith( 'x' ), ns_is_convertible.declarations ):
self.__is_convertible_impl( tester )
+class missing_decls_tester_t(unittest.TestCase):
+ def __init__(self, *args ):
+ unittest.TestCase.__init__(self, *args)
+ def test( self ):
+ config = autoconfig.cxx_parsers_cfg.gccxml
+ code = "struct const_item{ const int values[10]; };"
+ global_ns = parser.parse_string( code , config )[0]
+ ci = global_ns.class_( 'const_item' )
+ self.failUnless( len( ci.declarations ) == 5 )
+ #constructor, copy constructor, destructor, operator=, variable
+
def create_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(tester_t))
+ suite.addTest( unittest.makeSuite(missing_decls_tester_t))
return suite
def run_suite():
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-23 20:16:24
|
Revision: 1342
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1342&view=rev
Author: roman_yakovenko
Date: 2008-06-23 13:16:33 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
updating type_traits functionality
Modified Paths:
--------------
pygccxml_dev/unittests/data/type_traits.hpp
Modified: pygccxml_dev/unittests/data/type_traits.hpp
===================================================================
--- pygccxml_dev/unittests/data/type_traits.hpp 2008-06-23 20:15:20 UTC (rev 1341)
+++ pygccxml_dev/unittests/data/type_traits.hpp 2008-06-23 20:16:33 UTC (rev 1342)
@@ -156,8 +156,12 @@
struct const_item{ const int values[10]; };
+ void test_const_item(const_item by_value);
+
struct const_container{ const const_item items[10]; };
+ void test_const_container(const_container by_value);
+
enum semantic{ position, normal, binormal };
enum element_type{ float_, color, short_ };
@@ -182,9 +186,7 @@
typedef detail::d_t d_t;
typedef detail::dd_t dd_t;
typedef detail::f_t f_t;
- typedef detail::g_t g_t;
- typedef detail::const_item const_item_t;
- typedef detail::const_container const_container_t;
+ typedef detail::g_t g_t;
}
namespace no{
typedef std::string string_type;
@@ -193,6 +195,9 @@
typedef std::set< std::string > string_set_type;
typedef std::multimap< std::string, std::string > s2s_multimap_type;
typedef detail::vertex vertex_type;
+ typedef detail::const_container const_container_t;
+ typedef detail::const_item const_item_t;
+
}
}
@@ -523,10 +528,24 @@
namespace has_trivial_constructor{
+namespace details{
+
+ struct const_item{ const int values[10]; };
+
+ void test_const_item( const_item x = const_item() );
+
+ struct const_container{ const const_item items[10]; };
+
+ void test_const_container( const_container x = const_container() );
+
+}
+
namespace yes{
struct x{
x(){}
};
+ typedef details::const_item const_item;
+ typedef details::const_container const_container;
}
namespace no{
@@ -534,9 +553,6 @@
private:
y(){}
};
-
- struct const_item{ const int values[10]; };
- struct const_container{ const const_item items[10]; };
class singleton_t
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-23 20:15:12
|
Revision: 1341
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1341&view=rev
Author: roman_yakovenko
Date: 2008-06-23 13:15:20 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
removing "touch"
Modified Paths:
--------------
pygccxml_dev/unittests/data/core_cache.hpp
Modified: pygccxml_dev/unittests/data/core_cache.hpp
===================================================================
--- pygccxml_dev/unittests/data/core_cache.hpp 2008-06-23 20:14:02 UTC (rev 1340)
+++ pygccxml_dev/unittests/data/core_cache.hpp 2008-06-23 20:15:20 UTC (rev 1341)
@@ -21,5 +21,4 @@
} }
#endif//__core_cache_hpp__
-
-//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch
\ No newline at end of file
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-23 20:13:54
|
Revision: 1340
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1340&view=rev
Author: roman_yakovenko
Date: 2008-06-23 13:14:02 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
changing some of type_traits functions - adding support for artificial declarations
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/type_traits.py
Modified: pygccxml_dev/pygccxml/declarations/type_traits.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/type_traits.py 2008-06-23 20:10:56 UTC (rev 1339)
+++ pygccxml_dev/pygccxml/declarations/type_traits.py 2008-06-23 20:14:02 UTC (rev 1340)
@@ -111,7 +111,7 @@
def is_bool( type_ ):
"""returns True, if type represents C{bool}, False otherwise"""
return remove_alias( type_ ) in create_cv_types( cpptypes.bool_t() )
-
+
def is_void( type ):
"""returns True, if type represents C{void}, False otherwise"""
return remove_alias( type ) in create_cv_types( cpptypes.void_t() )
@@ -213,7 +213,7 @@
return remove_pointer( type_ )
else:
assert 0
-
+
def remove_reference(type):
"""removes reference from the type definition
@@ -348,115 +348,46 @@
assert isinstance( type, class_declaration.class_t )
return type.find_trivial_constructor()
-def has_trivial_constructor( type ):
- """returns True, if class has public trivial constructor, False otherwise"""
- logger = utils.loggers.cxx_parser
- true_header = "has_trivial_constructor(TRUE)- %s - " % type.decl_string
- false_header = "has_trivial_constructor(false)- %s - " % type.decl_string
-
- if '0.9' in type.compiler:
- trivial = type.constructors( lambda x: x.is_trivial_constructor
- , recursive=False
- , allow_empty=True )
- if trivial:
- if trivial[0].access_type == 'public':
- logger.debug( true_header + "there is user defined public trivial constructor" )
- return True
- else:
- logger.debug( false_header + "there is user defined non-public trivial constructor" )
- return False
- else:
- #there is no trivial constructor, so I should find out whether other constructors exist
- if type.constructors( recursive=False, allow_empty=True ):
- logger.debug( false_header + "there are other user defined constructors" )
- return False
- else:
- if __contains_noncopyable_mem_var( type ):
- logger.debug( false_header + "class doesn't have any user defined constructor and BUT it is NOT copyable" )
- return False
- else:
- logger.debug( true_header + "class doesn't have any user defined constructor and it is copyable" )
- return True
- else:
- cons = find_trivial_constructor( type )
- return cons and cons.access_type == 'public'
+def has_trivial_constructor( class_ ):
+ """if class has public trivial constructor, this function will return reference to it, None otherwise"""
+ class_ = class_traits.get_declaration( class_ )
+ trivial = class_.find_trivial_constructor()
+ if trivial and trivial.access_type == 'public':
+ return trivial
-"""
-Question: Do I have to define a copy constructor and assignment operator?
-
-Answer:
- C++ implicitly declares a copy constructor and an assignment operator
- for every class, struct and union unless the user declared them explicitly.
- A copy constructor isnot implicitly declared if the class has any user-declared
- constructor(s). Implicitly defined copy constructor and assignment operator
- are said to be trivial if:
-
- * their class has no virtual functions and no virtual base class(es)
- * all direct base classes and nonstatic data members of their class have trivial constructors
-
- Otherwise, the copy constructor and the assignment operator are non-trivial.
- Implicitly-declared non-trivial copy constructor and assignment operator are
- implicitly-defined.
-
-The assignment operator is called "copy assignment operator" in the standard.
-This verbosity doesnot convey any new or hidden meanings. Perhaps it's meant to
-differentiate between the assignment operator of fundamental types and the
-assignment operator member function of class types. In this series I will stick
-to the term assignment operator.
-"""
-
def has_copy_constructor( class_ ):
- """returns True, if class has public copy constructor, False otherwise"""
+ """if class has public copy constructor, this function will return reference to it, None otherwise"""
class_ = class_traits.get_declaration( class_ )
- if '0.9' in class_.compiler:
- copy_ = class_.find_copy_constructor()
- if copy_:
- if copy_.access_type == 'public':
- return True
- else:
- return False
- else:
- if __contains_noncopyable_mem_var( class_ ):
- return False
- else:
- return True
- else:
- constructors = filter( lambda x: isinstance( x, calldef.constructor_t ) \
- and x.is_copy_constructor
- , class_.public_members )
- return bool( constructors )
+ copy_constructor = class_.find_copy_constructor()
+ if copy_constructor and copy_constructor.access_type == 'public':
+ return copy_constructor
-def has_destructor(type):
- """returns True, if class has destructor, False otherwise"""
- assert isinstance( type, class_declaration.class_t )
- return bool( algorithm.find_declaration( type.get_members()
- , type=calldef.destructor_t
- , recursive=False ) )
+def has_destructor(class_):
+ """if class has destructor, this function will return reference to it, None otherwise"""
+ class_ = class_traits.get_declaration( class_ )
+ destructor = class_.decls( decl_type=calldef.destructor_t, recursive=False, allow_empty=True )
+ if destructor:
+ return destructor[0]
-def has_public_constructor(type):
- """returns True, if class has public constructor, False otherwise"""
- assert isinstance( type, class_declaration.class_t )
- decls = algorithm.find_all_declarations( type.public_members
- , type=calldef.constructor_t
- , recursive=False )
- constructors = filter( lambda decl: not decl.is_copy_constructor, decls )
- return bool( constructors ) or has_trivial_constructor( type )
+def has_public_constructor(class_):
+ """if class has any public constructor, this function will return list of them, otherwise None"""
+ class_ = class_traits.get_declaration(class_)
+ decls = class_.constructors( lambda c: not c.is_copy_constructor and c.access_type == 'public'
+ , recursive=False, allow_empty=True )
+ if decls:
+ return decls
-def has_public_assign(type):
+def has_public_assign(class_):
"""returns True, if class has public assign operator, False otherwise"""
- assert isinstance( type, class_declaration.class_t )
- decls = algorithm.find_all_declarations( type.public_members
- , type=calldef.member_operator_t
- , recursive=False )
- decls = filter( lambda decl: decl.symbol == '=', decls )
+ class_ = class_traits.get_declaration( class_ )
+ decls = class_.mem_opers( lambda o: o.symbol == '=' and o.access_type == 'public'
+ , recursive=False, allow_empty=True )
return bool( decls )
def has_public_destructor(type):
"""returns True, if class has public destructor, False otherwise"""
- assert isinstance( type, class_declaration.class_t )
- return bool( algorithm.find_declaration( type.public_members
- , type=calldef.destructor_t
- , recursive=False ) )
+ d = has_destructor( type )
+ return d and d.access_type == 'public'
def is_base_and_derived( based, derived ):
"""returns True, if there is "base and derived" relationship between classes, False otherwise"""
@@ -468,20 +399,20 @@
all_derived = ( [derived] )
else: #tuple
all_derived = derived
-
+
for derived_cls in all_derived:
for base_desc in derived_cls.recursive_bases:
if base_desc.related_class == based:
return True
return False
-
+
def has_any_non_copyconstructor( type):
- """returns True, if class has any non "copy constructor", otherwise False"""
- assert isinstance( type, class_declaration.class_t )
- constructors = filter( lambda x: isinstance( x, calldef.constructor_t ) \
- and not x.is_copy_constructor
- , type.public_members )
- return bool( constructors ) or has_trivial_constructor( type )
+ """if class has any public constructor, which is not copy constructor, this function will return list of them, otherwise None"""
+ class_ = class_traits.get_declaration( type )
+ decls = class_.constructors( lambda c: not c.is_copy_constructor and c.access_type == 'public'
+ , recursive=False, allow_empty=True )
+ if decls:
+ return decls
def has_public_binary_operator( type, operator_symbol ):
"""returns True, if type has public binary operator, otherwise False"""
@@ -916,18 +847,18 @@
if __contains_noncopyable_mem_var( class_ ):
logger.debug( "__is_noncopyable_single(TRUE) - %s - contains noncopyable members" % class_.decl_string )
return True
- else:
+ else:
logger.debug( "__is_noncopyable_single(FALSE) - %s - COPYABLE, because is doesn't contains noncopyable members" % class_.decl_string )
return False
def is_noncopyable( class_ ):
"""returns True, if class is noncopyable, False otherwise"""
- logger = utils.loggers.cxx_parser
+ logger = utils.loggers.cxx_parser
class_ = class_traits.get_declaration( class_ )
-
+
true_header = "is_noncopyable(TRUE) - %s - " % class_.decl_string
false_header = "is_noncopyable(false) - %s - " % class_.decl_string
-
+
if class_.class_type == class_declaration.CLASS_TYPES.UNION:
return False
@@ -935,17 +866,17 @@
logger.debug( true_header + "abstract client" )
return True
- #if class has public, user defined copy constructor, than this class is
+ #if class has public, user defined copy constructor, than this class is
#copyable
copy_ = class_.find_copy_constructor()
if copy_ and copy_.access_type == 'public' and not copy_.is_artificial:
return False
-
+
for base_desc in class_.recursive_bases:
- assert isinstance( base_desc, class_declaration.hierarchy_info_t )
+ assert isinstance( base_desc, class_declaration.hierarchy_info_t )
if base_desc.related_class.decl_string in ('::boost::noncopyable', '::boost::noncopyable_::noncopyable' ):
logger.debug( true_header + "derives from boost::noncopyable" )
- return True
+ return True
if not has_copy_constructor( base_desc.related_class ):
base_copy_ = base_desc.related_class.find_copy_constructor()
if base_copy_:
@@ -959,7 +890,7 @@
if __is_noncopyable_single( base_desc.related_class ):
logger.debug( true_header + "__is_noncopyable_single returned True" )
return True
-
+
if not has_copy_constructor( class_ ):
logger.debug( true_header + "does not have trival copy constructor" )
return True
@@ -1032,9 +963,9 @@
found = global_ns.decls( name=value_type_str
, function=lambda decl: not isinstance( decl, calldef.calldef_t )
, allow_empty=True )
- if not found:
+ if not found:
no_global_ns_value_type_str = value_type_str[2:]
- if cpptypes.FUNDAMENTAL_TYPES.has_key( no_global_ns_value_type_str ):
+ if cpptypes.FUNDAMENTAL_TYPES.has_key( no_global_ns_value_type_str ):
return cpptypes.FUNDAMENTAL_TYPES[ no_global_ns_value_type_str ]
elif is_std_string( value_type_str ):
string_ = global_ns.typedef( '::std::string' )
@@ -1137,8 +1068,8 @@
else:
type = remove_alias( type )
return remove_cv( type ).decl_string in decl_strings
-
+
def is_std_wostream( type ):
"""returns True, if type represents C++ std::string, False otherwise"""
decl_strings = [
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-23 20:10:53
|
Revision: 1339
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1339&view=rev
Author: roman_yakovenko
Date: 2008-06-23 13:10:56 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
adding new shortcut
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/scopedef.py
Modified: pygccxml_dev/pygccxml/declarations/scopedef.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/scopedef.py 2008-06-23 20:09:42 UTC (rev 1338)
+++ pygccxml_dev/pygccxml/declarations/scopedef.py 2008-06-23 20:10:56 UTC (rev 1339)
@@ -115,7 +115,7 @@
def _get_declarations_impl(self):
raise NotImplementedError()
-
+
def _get_declarations(self):
if True == self._optimized:
return self._all_decls_not_recursive
@@ -213,7 +213,7 @@
return name
else:
return function
-
+
def _build_operator_name( self, name, function, symbol ):
"""implementation details"""
def add_operator( sym ):
@@ -418,7 +418,7 @@
, header_file=header_file
, recursive=recursive)
var = variable #small alias
-
+
def variables( self, name=None, function=None, type=None, header_dir=None, header_file=None, recursive=None, allow_empty=None ):
"""returns a set of variable declarations, that are matched defined criterias"""
return self._find_multiple( self._impl_matchers[ scopedef_t.variable ]
@@ -430,7 +430,7 @@
, recursive=recursive
, allow_empty=allow_empty)
vars = variables #small alias
-
+
def calldef( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
"""returns reference to "calldef" declaration, that is matched defined criterias"""
return self._find_single( self._impl_matchers[ scopedef_t.calldef ]
@@ -495,7 +495,7 @@
, header_file=header_file
, recursive=recursive )
mem_fun = member_function
-
+
def member_functions( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None ):
"""returns a set of member function declarations, that are matched defined criterias"""
return self._find_multiple( self._impl_matchers[ scopedef_t.member_function ]
@@ -509,7 +509,7 @@
, recursive=recursive
, allow_empty=allow_empty)
mem_funs = member_functions
-
+
def constructor( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
"""returns reference to constructor declaration, that is matched defined criterias"""
return self._find_single( self._impl_matchers[ scopedef_t.constructor ]
@@ -547,7 +547,7 @@
, header_dir=header_dir
, header_file=header_file
, recursive=recursive )
-
+ mem_oper = member_operator
def member_operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None, allow_empty=None ):
"""returns a set of member operator declarations, that are matched defined criterias"""
return self._find_multiple( self._impl_matchers[ scopedef_t.member_operator ]
@@ -561,6 +561,7 @@
, header_file=header_file
, recursive=recursive
, allow_empty=allow_empty)
+ mem_opers = member_operators
def casting_operator( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
"""returns reference to casting operator declaration, that is matched defined criterias"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-23 20:09:44
|
Revision: 1338
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1338&view=rev
Author: roman_yakovenko
Date: 2008-06-23 13:09:42 -0700 (Mon, 23 Jun 2008)
Log Message:
-----------
updating to latest gccxml version
dropping support for gccxml version 0.7
Modified Paths:
--------------
gccxml_bin/v09/linux2/bin/gccxml
gccxml_bin/v09/linux2/bin/gccxml_cc1plus
Removed Paths:
-------------
gccxml_bin/v07/
Modified: gccxml_bin/v09/linux2/bin/gccxml
===================================================================
(Binary files differ)
Modified: gccxml_bin/v09/linux2/bin/gccxml_cc1plus
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-14 18:24:14
|
Revision: 1337
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1337&view=rev
Author: roman_yakovenko
Date: 2008-06-14 11:24:20 -0700 (Sat, 14 Jun 2008)
Log Message:
-----------
small bug fix
Modified Paths:
--------------
pygccxml_dev/unittests/patcher_tester.py
Modified: pygccxml_dev/unittests/patcher_tester.py
===================================================================
--- pygccxml_dev/unittests/patcher_tester.py 2008-06-12 07:10:06 UTC (rev 1336)
+++ pygccxml_dev/unittests/patcher_tester.py 2008-06-14 18:24:20 UTC (rev 1337)
@@ -66,7 +66,7 @@
'vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >()'
, 'vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >((&allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >()))'
]
- self.failUnless( clone_tree.arguments[0].default_value in default_values)
+ self.failUnless( clone_tree.arguments[0].default_value in default_values)
class tester_32_t( tester_impl_t ):
global_ns = None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-12 07:09:58
|
Revision: 1336
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1336&view=rev
Author: roman_yakovenko
Date: 2008-06-12 00:10:06 -0700 (Thu, 12 Jun 2008)
Log Message:
-----------
improving control over order of generated code for classes
Thanks to Jason Kankiewicz for the patch
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py
pyplusplus_dev/pyplusplus/module_creator/creator.py
pyplusplus_dev/unittests/classes_tester.py
Modified: pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py
===================================================================
--- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2008-06-12 06:24:44 UTC (rev 1335)
+++ pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2008-06-12 07:10:06 UTC (rev 1336)
@@ -178,7 +178,8 @@
self._held_type = None
self._noncopyable = None
self._wrapper_alias = None
- self._registration_code = []
+ self._registration_code_head = []
+ self._registration_code_tail = []
self._declaration_code = []
self._wrapper_code = []
self._null_constructor_body = ''
@@ -236,17 +237,33 @@
def declaration_code( self ):
"""
List of strings, that contains valid C++ code, that will be added to
- the class registration section
+ the class declaration section
"""
return self._declaration_code
@property
+ def registration_code_head( self ):
+ """
+ List of strings, that contains valid C++ code, that will be added to
+ the head of the class registration section
+ """
+ return self._registration_code_head
+
+ @property
+ def registration_code_tail( self ):
+ """
+ List of strings, that contains valid C++ code, that will be added to
+ the tail of the class registration section
+ """
+ return self._registration_code_tail
+
+ @property
def registration_code( self ):
"""
- List of strings, that contains valid C++ code, that will be added to
+ List of strings, that contains all C++ code, that will be added to
the class registration section
"""
- return self._registration_code
+ return self.registration_code_head + self.registration_code_tail
@property
def wrapper_code( self ):
@@ -311,13 +328,20 @@
"""adds the code to the declaration section"""
self.declaration_code.append( user_text.user_text_t( code ) )
- def add_registration_code( self, code, works_on_instance=True ):
+ def add_registration_code( self, code, works_on_instance=True, tail=True ):
"""adds the code to the class registration section
- works_on_instance: If true, the custom code can be applied directly to obj inst.
- Example: ObjInst."CustomCode"
+ @param works_on_instance: If true, the custom code can be applied directly to obj inst. Example: ObjInst.code
+ @type works_on_instance: bool
+
+ @param tail: if True, the custom code is appended to the end of the class registration code.
+ @type tail: bool
"""
- self.registration_code.append( user_text.class_user_text_t( code, works_on_instance ) )
+ if tail:
+ self.registration_code_tail.append( user_text.class_user_text_t( code, works_on_instance ) )
+ else:
+ self.registration_code_head.append( user_text.class_user_text_t( code, works_on_instance ) )
+
#preserving backward computability
add_code = add_registration_code
Modified: pyplusplus_dev/pyplusplus/module_creator/creator.py
===================================================================
--- pyplusplus_dev/pyplusplus/module_creator/creator.py 2008-06-12 06:24:44 UTC (rev 1335)
+++ pyplusplus_dev/pyplusplus/module_creator/creator.py 2008-06-12 07:10:06 UTC (rev 1336)
@@ -244,11 +244,15 @@
ctext_t = code_creators.custom_text_t
for cls_creator in class_creators:
cls_decl = cls_creator.declaration
- #uc = user code
- uc_creators = map( lambda uc: ctext_t( uc.text, uc.works_on_instance )
- , cls_decl.registration_code )
- cls_creator.adopt_creators( uc_creators )
+ uc_creators_head = map( lambda uc: ctext_t( uc.text, uc.works_on_instance )
+ , cls_decl.registration_code_head )
+ cls_creator.adopt_creators( uc_creators_head, 0 )
+
+ uc_creators_tail = map( lambda uc: ctext_t( uc.text, uc.works_on_instance )
+ , cls_decl.registration_code_tail )
+ cls_creator.adopt_creators( uc_creators_tail )
+
uc_creators = map( lambda uc: ctext_t( uc.text ), cls_decl.wrapper_code )
if uc_creators:
cls_creator.wrapper.adopt_creators( uc_creators )
Modified: pyplusplus_dev/unittests/classes_tester.py
===================================================================
--- pyplusplus_dev/unittests/classes_tester.py 2008-06-12 06:24:44 UTC (rev 1335)
+++ pyplusplus_dev/unittests/classes_tester.py 2008-06-12 07:10:06 UTC (rev 1336)
@@ -22,6 +22,8 @@
apple = mb.class_( 'apple' )
self.failUnless( apple.alias == 'the_tastest_fruit' )
apple.alias = 'apple'
+ apple.add_registration_code( "/*head*/", works_on_instance=False, tail=False )
+ apple.add_registration_code( "/*tail*/", works_on_instance=False, tail=True )
protected_static_t = mb.class_( 'protected_static_t' )
self.failUnless( 'PROTECTED_STATIC' in protected_static_t.alias)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-12 06:24:36
|
Revision: 1335
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1335&view=rev
Author: roman_yakovenko
Date: 2008-06-11 23:24:44 -0700 (Wed, 11 Jun 2008)
Log Message:
-----------
small unittest fixes
Modified Paths:
--------------
pygccxml_dev/unittests/autoconfig.py
pygccxml_dev/unittests/core_tester.py
Modified: pygccxml_dev/unittests/autoconfig.py
===================================================================
--- pygccxml_dev/unittests/autoconfig.py 2008-06-11 19:45:11 UTC (rev 1334)
+++ pygccxml_dev/unittests/autoconfig.py 2008-06-12 06:24:44 UTC (rev 1335)
@@ -52,11 +52,13 @@
if sys.platform == 'win32':
from pygccxml.msvc import pdb
pdb_file = os.path.join( data_directory, 'msvc_build', 'Debug', 'msvc_build.pdb' )
- pdb_loader = pdb.decl_loader_t( pdb_file )
- pdb_loader.read()
+ if os.path.exists( pdb_file ):
+ pdb_loader = pdb.decl_loader_t( pdb_file )
+ pdb_loader.read()
def get_pdb_global_ns():
- return cxx_parsers_cfg.pdb_loader.global_ns
+ if cxx_parsers_cfg.pdb_loader:
+ return cxx_parsers_cfg.pdb_loader.global_ns
#~ try:
#~ import pydsc
Modified: pygccxml_dev/unittests/core_tester.py
===================================================================
--- pygccxml_dev/unittests/core_tester.py 2008-06-11 19:45:11 UTC (rev 1334)
+++ pygccxml_dev/unittests/core_tester.py 2008-06-12 06:24:44 UTC (rev 1335)
@@ -17,6 +17,12 @@
from pygccxml.parser import *
from pygccxml.declarations import *
+def is_sub_path( root, some_path ):
+ root = normalize_path( root )
+ some_path = normalize_path( some_path )
+ return some_path.startswith( root )
+
+
class core_t( parser_test_case.parser_test_case_t ):
"""Tests core algorithms of GCC-XML and GCC-XML file reader.
Those most white-box testing.
@@ -68,7 +74,7 @@
def _test_ns_membership(self, ns, enum_name ):
unnamed_enum = ns.enum( lambda d: d.name == '' \
- and d.location.file_name.startswith( autoconfig.data_directory )
+ and is_sub_path( autoconfig.data_directory, d.location.file_name )
, recursive=False )
self.failUnless( unnamed_enum in ns.declarations
, "namespace '%s' does not contains unnamed enum." % ns.name )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-11 19:45:41
|
Revision: 1332
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1332&view=rev
Author: roman_yakovenko
Date: 2008-06-11 12:37:55 -0700 (Wed, 11 Jun 2008)
Log Message:
-----------
make output to be consistent
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/decl_printer.py
Modified: pygccxml_dev/pygccxml/declarations/decl_printer.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/decl_printer.py 2008-06-11 19:36:58 UTC (rev 1331)
+++ pygccxml_dev/pygccxml/declarations/decl_printer.py 2008-06-11 19:37:55 UTC (rev 1332)
@@ -173,6 +173,7 @@
if self.__inst.aliases:
aliases = map( lambda typedef: typedef.name, self.__inst.aliases )
+ aliases.sort()
msg = 'aliases: ' + `aliases`
self.writer( ' ' * curr_level * self.INDENT_SIZE + msg.ljust( self.JUSTIFY ))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-06-11 19:45:30
|
Revision: 1334
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1334&view=rev
Author: roman_yakovenko
Date: 2008-06-11 12:45:11 -0700 (Wed, 11 Jun 2008)
Log Message:
-----------
few bug fixes, after upgrading to latest gccxml version
Modified Paths:
--------------
pygccxml_dev/pygccxml/parser/scanner.py
Modified: pygccxml_dev/pygccxml/parser/scanner.py
===================================================================
--- pygccxml_dev/pygccxml/parser/scanner.py 2008-06-11 19:44:02 UTC (rev 1333)
+++ pygccxml_dev/pygccxml/parser/scanner.py 2008-06-11 19:45:11 UTC (rev 1334)
@@ -530,7 +530,7 @@
elif version <= 1.114:
logger.info ( 'GCCXML version - 0.7' )
self.__compiler = compilers.GCC_XML_07
- elif version in ( 1.115, 1.116, 1.117 ):
+ elif version in ( 1.115, 1.116, 1.117, 1.118, 1.119, 1.120, 1.121 ):
logger.info ( 'GCCXML version - 0.9 BUGGY' )
self.__compiler = compilers.GCC_XML_09_BUGGY
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|