Factory
模块: oapy._oa._common
导入: from oapy._oa import _common
概览
Factory 在 oapy 中可用,可通过 _common 模块访问。
本页汇总 Factory 当前在 oapy 中可用的 Python 接口。
详细说明
template class Factory< T > This class extends the FactoryBase class to add an implementation of the createInstance() function of the IFactory interface。 This template class is intended to be used as the factory for most implementations of OpenAccess plug-ins。 The template parameter T is the implementation class that this factory is responsible for creating。 The constructor value classID is the name of the plug-in。 For example, a plug-in called "SamplePlug" may have an implementation class as follows: class SamplePlug : public PlugInBase { public: SamplePlug(); ~SamplePlug(); // ISampleInterface functions: 。 。 。 private: static Factory factory; 。 。 。 } with a line in the .cpp file as follows: Factory SamplePlug::factory("SamplePlug"); Note that the class name and the Plug-in name do not have to be the same as they do in this example。
构造函数
_common.Factory(classID)
obj = _common.Factory(classID)
方法总览
| 状态 |
Python 调用 |
| ✅ |
obj.createInstance(reserved, interfaceID, ptr) |
方法说明
obj.createInstance(reserved, interfaceID, ptr)
绑定状态: 已绑定
Python 调用: obj.createInstance(reserved, interfaceID, ptr)
Python 示例
from oapy._oa import _common
# assume obj is a Factory
obj.createInstance(reserved, interfaceID, ptr)