本文整理汇总了Python中pybindgen.cppclass.CppClassRefParameter方法的典型用法代码示例。如果您正苦于以下问题:Python cppclass.CppClassRefParameter方法的具体用法?Python cppclass.CppClassRefParameter怎么用?Python cppclass.CppClassRefParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pybindgen.cppclass
的用法示例。
在下文中一共展示了cppclass.CppClassRefParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Attribute_customizations
# 需要导入模块: from pybindgen import cppclass [as 别名]
# 或者: from pybindgen.cppclass import CppClassRefParameter [as 别名]
def Attribute_customizations(module):
# Fix up for the "const AttributeValue &v = EmptyAttribute()"
# case, as used extensively by helper classes.
# Here's why we need to do this: pybindgen.gccxmlscanner, when
# scanning parameter default values, is only provided with the
# value as a simple C expression string. (py)gccxml does not
# report the type of the default value.
# As a workaround, here we iterate over all parameters of all
# methods of all classes and tell pybindgen what is the type of
# the default value for attributes.
for cls in module.classes:
for meth in cls.get_all_methods():
for param in meth.parameters:
if isinstance(param, cppclass.CppClassRefParameter):
if param.cpp_class.name == 'AttributeValue' \
and param.default_value is not None \
and param.default_value_type is None:
param.default_value_type = 'ns3::EmptyAttributeValue'