本文整理汇总了Python中vital.ConfigBlock.c_ptr_type方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigBlock.c_ptr_type方法的具体用法?Python ConfigBlock.c_ptr_type怎么用?Python ConfigBlock.c_ptr_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vital.ConfigBlock
的用法示例。
在下文中一共展示了ConfigBlock.c_ptr_type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_config
# 需要导入模块: from vital import ConfigBlock [as 别名]
# 或者: from vital.ConfigBlock import c_ptr_type [as 别名]
def get_config(self, cb=None):
"""
Return this algorithm's current configuration.
As algorithms are named, the configuration returned will be contained
inside a sub-block whose name matches this algorithm's name in order
to separate
:param cb: An optional existing ConfigBlock instance to add this
algorithm's configuration to.
:type cb: ConfigBlock
:return: This named algorithm's current configuration. If a config block
was given to this method, the same config block is returned.
:rtype: vital.ConfigBlock
"""
if cb is None:
cb = ConfigBlock()
self._call_cfunc(
'vital_algorithm_%s_get_type_config' % self.type_name(),
[ctypes.c_char_p, self.C_TYPE_PTR, ConfigBlock.c_ptr_type()],
[self.name, self, cb],
ConfigBlock.c_ptr_type()
)
return cb
示例2: check_config
# 需要导入模块: from vital import ConfigBlock [as 别名]
# 或者: from vital.ConfigBlock import c_ptr_type [as 别名]
def check_config(self, cb):
"""
Check the given configuration block for valid algorithm configuration
:param cb: Configuration to check.
:type cb: ConfigBlock
:return: True if the given configuration block contains a valid
configuration for this algorithm type and implementation.
:rtype: bool
"""
return self._call_cfunc(
'vital_algorithm_%s_check_type_config' % self.type_name(),
[ctypes.c_char_p, ConfigBlock.c_ptr_type()],
[self.name, cb],
ctypes.c_bool
)