Trees | Indices | Help |
|
---|
|
1 # Copyright 2004-2008 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 7 import os 8 import algorithm 9 import registration_based 10 from pyplusplus import code_repository 11 from pyplusplus.decl_wrappers import call_policies 12 from pyplusplus.decl_wrappers import python_traits 13 from pygccxml import declarations 1416 """ 17 This class creates code that register static sized array 18 """7020 registration_based.registration_based_t.__init__( self ) 21 self._array_type = array_type 22 self._call_policies = self._guess_call_policies() 23 self.works_on_instance = False24 29 array_type = property( _get_array_type, _set_array_type ) 30 35 call_policies = property( _get_call_policies, _set_call_policies ) 3638 item_type = declarations.array_item_type(self.array_type) 39 return "__array_1_%(type)s_%(size)d" \ 40 % dict( type=algorithm.create_valid_name( item_type.decl_string ) 41 , size=declarations.array_size(self.array_type) )4244 item_type = declarations.array_item_type( self.array_type ) 45 if python_traits.is_immutable( item_type ): 46 return call_policies.default_call_policies() 47 else: 48 return call_policies.return_internal_reference()4951 templates = declarations.templates 52 call_invocation = declarations.call_invocation 53 ns_name = code_repository.array_1.namespace 54 if declarations.is_const( self.array_type ): 55 fn_name = 'register_const_array_1' 56 else: 57 fn_name = 'register_array_1' 58 59 fn_def_tmpl_args = [ declarations.array_item_type(self.array_type).decl_string 60 , str( declarations.array_size(self.array_type) ) ] 61 if not self.call_policies.is_default(): 62 fn_def_tmpl_args.append( 63 self.call_policies.create(self, call_policies.CREATION_POLICY.AS_TEMPLATE_ARGUMENT ) ) 64 65 fn_def = templates.join( '::'.join( [ns_name, fn_name] ), fn_def_tmpl_args ) 66 return call_invocation.join( fn_def, [ '"%s"' % self._create_name() ] ) + ';'67
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 20 08:51:22 2008 | http://epydoc.sourceforge.net |