Package pyplusplus :: Package function_transformers

Source Code for Package pyplusplus.function_transformers

 1  # Helper classes for wrapper function creation 
 2   
 3  """This sub-package provides text substitution services for creating C++ functions. 
 4   
 5  The helper classes in this package are meant to be used by the actual 
 6  calldef code creators (that are not part of this sub-package). They 
 7  implement the core of the "arg policy" mechanism which can be used by 
 8  a user to modify the source code for a function. 
 9   
10  The main class of this sub-package is the class L{substitution_manager_t}. This 
11  class maintains two sets of special variables, one for the wrapper function 
12  and one for the virtual function, and provides text substitution services. 
13  The variables contain parts of source code that can be inserted into the 
14  function source code template which is generated by the user of the class. 
15   
16   
17  """ 
18   
19  from transformer import transformer_t 
20  import transformers 
21  from function_transformation import function_transformation_t 
22   
23 -def output( *args, **keywd ):
24 def creator( function ): 25 return transformers.output_t( function, *args, **keywd )
26 return creator 27
28 -def input( *args, **keywd ):
29 def creator( function ): 30 return transformers.input_t( function, *args, **keywd )
31 return creator 32
33 -def inout( *args, **keywd ):
34 def creator( function ): 35 return transformers.inout_t( function, *args, **keywd )
36 return creator 37
38 -def input_static_array( *args, **keywd ):
39 def creator( function ): 40 return transformers.input_static_array_t( function, *args, **keywd )
41 return creator 42
43 -def output_static_array( *args, **keywd ):
44 def creator( function ): 45 return transformers.output_static_array_t( function, *args, **keywd )
46 return creator 47
48 -def modify_type( *args, **keywd ):
49 def creator( function ): 50 return transformers.type_modifier_t( function, *args, **keywd )
51 return creator 52
53 -def input_c_buffer( *args, **keywd ):
54 def creator( function ): 55 return transformers.input_c_buffer_t( function, *args, **keywd )
56 return creator 57
58 -def transfer_ownership( *args, **keywd ):
59 def creator( function ): 60 return transformers.transfer_ownership_t( function, *args, **keywd )
61 return creator 62
63 -def from_address( *args, **keywd ):
64 def creator( function ): 65 return transformers.from_address_t( function, *args, **keywd )
66 return creator 67