Пример #1
0
 def element_type( self, type ):
     """returns reference to the class value\\mapped type declaration"""
     cls = self.class_declaration( type )
     if isinstance( cls, class_declaration.class_t ):
         value_type = cls.typedef( self.element_type_typedef, recursive=False ).type
         return type_traits.remove_declarated( value_type )
     else:
         value_type_str = templates.args( cls.name )[self.element_type_index]
         ref = type_traits.impl_details.find_value_type( cls.top_parent, value_type_str )
         if None is ref:
             raise RuntimeError( "Unable to find out %s '%s' value type."
                                 % ( self.name, cls.decl_string ) )
         return ref
Пример #2
0
 def __find_xxx_type( self, type, xxx_index, xxx_typedef, cache_property_name ):
     cls = self.class_declaration( type )
     result = getattr( cls.cache, cache_property_name )
     if not result:            
         if isinstance( cls, class_declaration.class_t ):
             xxx_type = cls.typedef( xxx_typedef, recursive=False ).type
             result = type_traits.remove_declarated( xxx_type )
         else:
             xxx_type_str = templates.args( cls.name )[xxx_index]
             result = type_traits.impl_details.find_value_type( cls.top_parent, xxx_type_str )
             if None is result:
                 raise RuntimeError( "Unable to find out %s '%s' key\\value type."
                                     % ( self.name(), cls.decl_string ) )
         setattr( cls.cache, cache_property_name, result )
     return result
Пример #3
0
 def element_type(self, type):
     """returns reference to the class value\\mapped type declaration"""
     cls = self.class_declaration(type)
     if isinstance(cls, class_declaration.class_t):
         value_type = cls.typedef(self.element_type_typedef,
                                  recursive=False).type
         return type_traits.remove_declarated(value_type)
     else:
         value_type_str = templates.args(cls.name)[self.element_type_index]
         ref = type_traits.impl_details.find_value_type(
             cls.top_parent, value_type_str)
         if None is ref:
             raise RuntimeError("Unable to find out %s '%s' value type." %
                                (self.name, cls.decl_string))
         return ref
Пример #4
0
 def __find_xxx_type( self, type, xxx_index, xxx_typedef, cache_property_name ):
     cls = self.class_declaration( type )
     result = getattr( cls.cache, cache_property_name )
     if not result:
         if isinstance( cls, class_declaration.class_t ):
             xxx_type = cls.typedef( xxx_typedef, recursive=False ).type
             result = type_traits.remove_declarated( xxx_type )
         else:
             xxx_type_str = templates.args( cls.name )[xxx_index]
             result = type_traits.impl_details.find_value_type( cls.top_parent, xxx_type_str )
             if None is result:
                 raise RuntimeError( "Unable to find out %s '%s' key\\value type."
                                     % ( self.name(), cls.decl_string ) )
         setattr( cls.cache, cache_property_name, result )
     return result