当前位置: 首页>>代码示例>>Python>>正文


Python FFIRename.methodNameFromCppName方法代码示例

本文整理汇总了Python中FFIRename.methodNameFromCppName方法的典型用法代码示例。如果您正苦于以下问题:Python FFIRename.methodNameFromCppName方法的具体用法?Python FFIRename.methodNameFromCppName怎么用?Python FFIRename.methodNameFromCppName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FFIRename的用法示例。


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

示例1: constructGlobalFunction

# 需要导入模块: import FFIRename [as 别名]
# 或者: from FFIRename import methodNameFromCppName [as 别名]
 def constructGlobalFunction(self, globalIndex):
     descriptors = self.constructFunctionTypeDescriptors(globalIndex)
     if len(descriptors) == 0:
         return None
     funcSpecs = []
     for descriptor in descriptors:
         funcSpec = FFISpecs.GlobalFunctionSpecification()
         funcSpec.typeDescriptor = descriptor
         funcSpec.name = FFIRename.methodNameFromCppName(funcSpec.typeDescriptor.foreignTypeName)
         funcSpec.index = globalIndex
         funcSpecs.append(funcSpec)
     return funcSpecs
开发者ID:Wilee999,项目名称:TTRInjector,代码行数:14,代码来源:FFIInterrogateDatabase.py

示例2: constructMemberFunctionSpecifications

# 需要导入模块: import FFIRename [as 别名]
# 或者: from FFIRename import methodNameFromCppName [as 别名]
 def constructMemberFunctionSpecifications(self, typeIndex):
     funcSpecs = []
     numFuncs = interrogate_type_number_of_methods(typeIndex)
     for i in range(numFuncs):
         funcIndex = interrogate_type_get_method(typeIndex, i)
         typeDescs = self.constructFunctionTypeDescriptors(funcIndex)
         for typeDesc in typeDescs:
             funcSpec = FFISpecs.MethodSpecification()
             funcSpec.name = FFIRename.methodNameFromCppName(
                 interrogate_function_name(funcIndex),
                 getTypeName(typeIndex))
             funcSpec.typeDescriptor = typeDesc
             funcSpec.index = funcIndex
             funcSpecs.append(funcSpec)
     return funcSpecs
开发者ID:kralf,项目名称:panda3d,代码行数:17,代码来源:FFIInterrogateDatabase.py

示例3: constructDowncastFunctionSpecifications

# 需要导入模块: import FFIRename [as 别名]
# 或者: from FFIRename import methodNameFromCppName [as 别名]
    def constructDowncastFunctionSpecifications(self, typeIndex):
        """
        The strange thing about downcast functions is that they appear in the
        class they are being downcast TO, not downcast FROM. But they should be
        built into the class they are being downcast from. For instance, a method
        downcastToNode(ptrBoundedObject) will appear in Node's list of methods
        but should be compiled into BoundedObject's class
        UPDATE: These are no longer compiled into the from-class. That was
        preventing the libraries from being independent since the from class
        now had knowledge of the to class which is potentially in a library
        downstream. Now these functions are just global functions
        """
        numFuncs = interrogate_type_number_of_derivations(typeIndex)
        for i in range(numFuncs):
            # Make sure this downcast is possible
            if (not interrogate_type_derivation_downcast_is_impossible(typeIndex, i)):
                if interrogate_type_derivation_has_downcast(typeIndex, i):
                    funcIndex = interrogate_type_get_downcast(typeIndex, i)
                    typeDescs = self.constructFunctionTypeDescriptors(funcIndex)
                    for typeDesc in typeDescs:
                        funcSpec = FFISpecs.GlobalFunctionSpecification()
                        funcSpec.name = FFIRename.methodNameFromCppName(
                            interrogate_function_name(funcIndex),
                            getTypeName(typeIndex))
                        funcSpec.typeDescriptor = typeDesc
                        funcSpec.index = funcIndex
                        # Here we look for the class in the first argument
                        fromClass = typeDesc.argumentTypes[0].typeDescriptor.recursiveTypeDescriptor()

                        # Append the from class name on the method to uniquify it now
                        # that these are global methods
                        funcSpec.name = funcSpec.name + 'From' + fromClass.foreignTypeName
                        
                        # Append this funcSpec to that class's downcast methods
                        # fromClass.downcastMethods.append(funcSpec)
                        self.environment.addDowncastFunction(funcSpec)
开发者ID:kralf,项目名称:panda3d,代码行数:38,代码来源:FFIInterrogateDatabase.py


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