Trees | Indices | Help |
|
---|
|
1 # Copyright 2006 Roman Yakovenko. 2 # Distributed under the Boost Software License, Version 1.0. (See 3 # accompanying file LICENSE_1_0.txt or copy at 4 # http://www.boost.org/LICENSE_1_0.txt) 5 6 """This module contains the class L{function_transformation_t}. 7 """ 8 import md5 9 import controllers 10 from pygccxml import declarations 11 from pyplusplus import code_repository15 """Constructor. """ 16 self.__function = function 17 self.__controller = None 18 if isinstance( function.parent, declarations.class_t ): 19 if declarations.VIRTUALITY_TYPES.NOT_VIRTUAL == function.virtuality: 20 self.__controller = controllers.mem_fun_controller_t( function ) 21 else: 22 self.__controller = controllers.virtual_mem_fun_controller_t( function ) 23 else: 24 self.__controller = controllers.free_fun_controller_t( function ) 25 self.__transformers = map( lambda tr_creator: tr_creator( function ), transformer_creator ) 26 self.__thread_safe = keywd.get( 'thread_safe', False ) 27 self.__controller.apply( self.__transformers ) 28 self.__unique_name = None 29 self.__alias = keywd.get( 'alias', None )30 31 @property33 if None is self.__unique_name: 34 obj = md5.new() 35 if self.__function.mangled: # free functions don't have a mangled value 36 obj.update( self.__function.mangled ) 37 else: 38 obj.update( self.__function.decl_string ) 39 obj.update( self.__function.location.file_name ) 40 obj.update( str( self.__function.location.line ) ) 41 self.__unique_name = self.__function.name + '_' + obj.hexdigest () 42 return self.__unique_name43 44 @property46 if None is self.__alias: 47 if self.__function.overloads: 48 self.__alias = self.unique_name 49 else: 50 self.__alias = self.__function.alias 51 return self.__alias52 53 @property 56 57 @property 6062 headers = [] 63 map( lambda transformer: headers.extend( transformer.required_headers() ) 64 , self.transformers ) 65 if self.__function.call_policies: 66 headers.append( code_repository.call_policies.file_name ) 67 return headers68 69 @property 72
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 20 08:51:43 2008 | http://epydoc.sourceforge.net |