• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python declarations.dummy_type_t函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pygccxml.declarations.dummy_type_t函数的典型用法代码示例。如果您正苦于以下问题:Python dummy_type_t函数的具体用法?Python dummy_type_t怎么用?Python dummy_type_t使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dummy_type_t函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __configure_sealed

    def __configure_sealed(self, controller):
        global _seq2arr
        global _arr2seq
        w_arg = controller.find_wrapper_arg( self.arg.name )
        w_arg.type = declarations.dummy_type_t( "boost::python::object" )

        # Declare a variable that will hold the C array...
        native_array = controller.declare_variable( self.array_item_type
                                                    , "native_" + self.arg.name
                                                    , '[%d]' % self.array_size )

        copy_pylist2arr = _seq2arr.substitute( type=self.array_item_type
                                                , pylist=w_arg.name
                                                , array_size=self.array_size
                                                , native_array=native_array )

        controller.add_pre_call_code( copy_pylist2arr )
        controller.modify_arg_expression( self.arg_index, native_array )
        
        # Declare a Python list which will receive the output...
        pylist = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" )
                                              , 'py_' + self.arg.name )

        copy_arr2pylist = _arr2seq.substitute( native_array=native_array
                                              , array_size=self.array_size
                                              , pylist=pylist )
        controller.add_post_call_code( copy_arr2pylist )

        #adding the variable to return variables list
        controller.return_variable( pylist )
开发者ID:asford,项目名称:pyplusplus,代码行数:30,代码来源:transformers.py


示例2: wrapper_return_type

 def wrapper_return_type( self ):
     return_vars_count = len( self.return_variables )
     if not declarations.is_void( self.function.return_type ):
         return_vars_count += 1
     if 0 == return_vars_count:
         return self.function.return_type #return type is void
     elif 1 == return_vars_count:
         return declarations.dummy_type_t( 'boost::python::object' )
     else:
         return declarations.dummy_type_t( 'boost::python::tuple' )
开发者ID:Sandern,项目名称:py-source-sdk-2013,代码行数:10,代码来源:controllers.py


示例3: __configure_v_mem_fun_override

    def __configure_v_mem_fun_override(self, controller):
        global _arr2seq
        pylist = controller.declare_py_variable(declarations.dummy_type_t("boost::python::list"), "py_" + self.arg.name)

        copy_arr2pylist = _arr2seq.substitute(native_array=self.arg.name, array_size=self.array_size, pylist=pylist)

        controller.add_py_pre_call_code(copy_arr2pylist)
开发者ID:ISoirar,项目名称:pypp11,代码行数:7,代码来源:transformers.py


示例4: __configure_sealed

    def __configure_sealed(self, controller):
        global _pymatrix2cmatrix
        global _cmatrix2pymatrix
        w_arg = controller.find_wrapper_arg(self.arg.name)
        w_arg.type = declarations.dummy_type_t("boost::python::object")

        # Declare a variable that will hold the C matrix...
        native_matrix = controller.declare_variable(
            self.matrix_item_type, "native_" + self.arg.name, "[%d][%d]" % (self.rows, self.columns)
        )

        conversion_code = _pymatrix2cmatrix.substitute(
            type=self.matrix_item_type,
            pymatrix=w_arg.name,
            columns="%d" % self.columns,
            row=controller.register_variable_name("row"),
            rows="%d" % self.rows,
            native_matrix=native_matrix,
        )

        controller.add_pre_call_code(conversion_code)

        controller.modify_arg_expression(self.arg_index, native_matrix)

        # adding just declared variable to the original function call expression
        controller.modify_arg_expression(self.arg_index, native_matrix)

        # Declare a Python list which will receive the output...
        pymatrix = controller.declare_variable(declarations.dummy_type_t("boost::python::list"), "py_" + self.arg.name)

        conversion_code = _cmatrix2pymatrix.substitute(
            pymatrix=pymatrix,
            columns="%d" % self.columns,
            row=controller.register_variable_name("row"),
            pyrow=controller.register_variable_name("pyrow"),
            rows="%d" % self.rows,
            native_matrix=native_matrix,
        )

        controller.add_post_call_code(conversion_code)

        # adding the variable to return variables list
        controller.return_variable(pymatrix)
开发者ID:ISoirar,项目名称:pypp11,代码行数:43,代码来源:transformers.py


示例5: __init__

     def __init__( self, function ):
         controller_base_t.__init__( self, function )
         self.__py_vars_manager = create_variables_manager( function )
         self.__py_function_var \
             = self.__py_vars_manager.register_name( 'func_' + function.alias )
         self.__py_pre_call = []
         self.__py_post_call = []
         self.__py_result_var = variable_t( declarations.dummy_type_t( 'boost::python::object' )
                                            , self.register_py_variable_name( 'py_result' ) )
 
         self.__py_arg_expressions = [ arg.name for arg in function.arguments ]
开发者ID:Sandern,项目名称:py-source-sdk-2013,代码行数:11,代码来源:controllers.py


示例6: wrapper_type

    def wrapper_type( self ):
        tmpl = "%(namespace)s::%(constness)sarray_1_t< %(item_type)s, %(array_size)d>"

        constness = ''
        if declarations.is_const( self.declaration.type ):
            constness = 'const_'
        result = tmpl % {
                'namespace' : code_repository.array_1.namespace
              , 'constness' : constness
              , 'item_type' : declarations.array_item_type( self.declaration.type ).decl_string
              , 'array_size': declarations.array_size( self.declaration.type )
        }
        return declarations.dummy_type_t( result )
开发者ID:CTrauma,项目名称:pypp11,代码行数:13,代码来源:member_variable.py


示例7: __init__

    def __init__(self, function, arg_ref):
        """Constructor.

        The specified argument must be a reference or a pointer.

        :param arg_ref: Index of the argument that is an output value
        :type arg_ref: int
        """
        modifier = lambda type_: declarations.dummy_type_t('size_t')
        type_modifier_t.__init__( self, function, arg_ref, modifier )

        if not is_ptr_or_array( self.arg.type ):
            raise ValueError( '%s\nin order to use "from_address_t" transformation, argument %s type must be a pointer or a array (got %s).' ) \
                  % ( function, self.arg_ref.name, arg.type)
开发者ID:yacc143,项目名称:pyplusplus,代码行数:14,代码来源:transformers.py


示例8: wrapper_type

    def wrapper_type( self ):
        tmpl = "%(namespace)s::%(constness)sarray_1_t< %(item_type)s, %(array_size)d>"

        item_type = declarations.array_item_type(self.declaration.decl_type)
        is_noncopyable = not declarations.is_fundamental(item_type) and \
            declarations.is_noncopyable(item_type)

        constness = ''
        if declarations.is_const(self.declaration.decl_type) or is_noncopyable:
            constness = 'const_'
        result = tmpl % {
                'namespace' : code_repository.array_1.namespace
              , 'constness' : constness
              , 'item_type' : declarations.array_item_type( self.declaration.decl_type ).decl_string
              , 'array_size': declarations.array_size( self.declaration.decl_type )
        }
        return declarations.dummy_type_t( result )
开发者ID:Sandern,项目名称:py-source-sdk-2013,代码行数:17,代码来源:member_variable.py


示例9: __configure_sealed

    def __configure_sealed(self, controller):
        global _seq2arr, _cleanUp
        w_arg = controller.find_wrapper_arg( self.arg.name )
        w_arg.type = declarations.dummy_type_t( "boost::python::str" )

        # Declare a variable that will hold the C array...
        native_pointer = controller.declare_variable( self.array_item_rawtype
                                                    , "native_" + self.arg.name
                                                    , '' )

        copy_pylist2arr = _seq2arr.substitute( type=self.array_item_type
                                                , pylist=w_arg.name
                                                , max_size=self.max_size
                                                , native_pointer=native_pointer )

        cleanUp = _cleanUp.substitute ( native_name =   "native_" + self.arg.name )                                                                                               

        controller.add_pre_call_code( copy_pylist2arr )
        
        controller.add_post_call_code ( cleanUp )

        controller.modify_arg_expression( self.arg_index, native_pointer )
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:22,代码来源:PO_FuncTransform.py


示例10: in

# checkRange
for z in sb.mb.free_funs('checkRange'):
    z.include()
    z._transformer_creators.append(FT.output_type1(2))
    z._transformer_kwds['alias'] = 'checkRange'

# kmeans
z = sb.mb.free_fun('kmeans')
z.include()
z._transformer_creators.append(FT.output_type1('centers'))

# calcCovarMatrix
for z in sb.mb.free_funs('calcCovarMatrix'):
    z.include()
    if z.arguments[0].type == D.dummy_type_t('::cv::Mat const *'):
        z._transformer_creators.append(FT.input_array1d('samples', 'nsamples'))
    z._transformer_kwds['alias'] = 'calcCovarMatrix'
        
# theRNG
z = sb.mb.free_fun('theRNG')
z.include()
z.call_policies = CP.return_value_policy(CP.reference_existing_object)

# fillConvexPoly
z = sb.mb.free_fun('fillConvexPoly')
z.include()
z._transformer_creators.append(FT.input_array1d('pts', 'npts'))

# fillPoly
for t in ('fillPoly', 'polylines'):
开发者ID:BackupGGCode,项目名称:pyopencv,代码行数:30,代码来源:cxcore_hpp_gen.py



注:本文中的pygccxml.declarations.dummy_type_t函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python declarations.find_declaration函数代码示例发布时间:2022-05-25
下一篇:
Python declarations.declarated_t函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap