[pygccxml-commit] SF.net SVN: pygccxml: [219] pygccxml_dev/pygccxml/declarations/type_traits.py
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-06-17 06:29:54
|
Revision: 219 Author: roman_yakovenko Date: 2006-06-16 23:29:46 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=219&view=rev Log Message: ----------- fixing small bug Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/type_traits.py Modified: pygccxml_dev/pygccxml/declarations/type_traits.py =================================================================== --- pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-13 12:24:40 UTC (rev 218) +++ pygccxml_dev/pygccxml/declarations/type_traits.py 2006-06-17 06:29:46 UTC (rev 219) @@ -820,6 +820,8 @@ type = remove_alias( type ) type = remove_cv( type ) type = remove_declarated( type ) + if not isinstance( type, ( class_declaration.class_declaration_t, class_declaration.class_t ) ): + return False if not is_defined_in_xxx( 'boost', type ): return False return type.decl_string.startswith( '::boost::shared_ptr<' ) @@ -832,7 +834,9 @@ cls = remove_cv( type ) cls = remove_declarated( type ) if isinstance( cls, class_declaration.class_t ): - return remove_declarated( cls.typedef( "value_type" ).type ) + return remove_declarated( cls.typedef( "value_type" ).type ) + elif not isinstance( cls, ( class_declaration.class_declaration_t, class_declaration.class_t ) ): + raise RuntimeError( "Unable to find out shared_ptr value type. shared_ptr class is: %s" % cls.decl_string ) else: value_type_str = templates.args( cls.name )[0] found = cls.top_parent.classes( value_type_str, allow_empty=True ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |