首页 / common / IBase

IBase

模块: oapy._oa._common 导入: from oapy._oa import _common

概览

IBaseoapy 中可用,可通过 _common 模块访问。

本页汇总 IBase 当前在 oapy 中可用的 Python 接口。

详细说明

This is the base interface class for all interface definitions in the OpenAccess plug-in system。 It should be used as the base for all third party interface definitions as well。 It defines the functions required for reference counting and interface discovery。 Various utility classes, such as SPtr , rely on this base class to manage interface pointers for client code。 See PlugInBase for a simple, single interface implementation of IBase。

方法总览

状态 Python 调用
obj.queryInterface(id, iPtr)
obj.addRef()
obj.release()

方法说明

obj.queryInterface(id, iPtr)

绑定状态: 已绑定

Python 调用: obj.queryInterface(id, iPtr)

This function is used to query the implementing component for other interfaces。 The id of the required interface is passed, and the component tests it against the id's of the interfaces that it implements。 If there is a match, the component sets the iPtr parameter to a pointer to that interface and returns IBase::cOK 。 由 FactoryBase、StringImp 和 PlugInBase 实现。

参数

  • id: The interface id of the desired interface。
  • iPtr: This parameter is set to a pointer to the required interface if this component implements it。 Otherwise it's set to NULL。

Python 示例

from oapy._oa import _common

# assume obj is a IBase
obj.queryInterface(id, iPtr)

obj.addRef()

绑定状态: 已绑定

Python 调用: obj.addRef()

This function is used to increment the reference count on a component。 Each copy of an interface pointer that is in use by a client will have a corresponding reference on the component。 Use the SPtr to help manage the references on components in client code。 由 FactoryBase、StringImp 和 PlugInBase 实现。

Python 示例

from oapy._oa import _common

# assume obj is a IBase
obj.addRef()

obj.release()

绑定状态: 已绑定

Python 调用: obj.release()

This function is used to decrement the reference count on a component。 Each copy of an interface pointer that is in use by a client will have a corresponding reference on the component。 When the reference count of a component is decremented to zero then the component will delete itself。 Use the SPtr to help manage the references on components in client code。 由 FactoryBase、StringImp 和 PlugInBase 实现。

Python 示例

from oapy._oa import _common

# assume obj is a IBase
obj.release()