本文整理匯總了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'