按 name 参数指定的那样定义节点类,它受指定为 factoryObject 参数的节点工厂支持。当装入 LIL 时,在 bipGetMessageFlowNodeFactory 执行期间此函数由节点调用。
如果执行了 cniGetAttribute 和 cniGetAttribute2,或 cniGetAttributeName 和 cniGetAttributeName2,则 cniDefineNodeClass 和 CCI_INV_IMPL_FUNCTION 失败。
void cniDefineNodeClass( int* returnCode, CciFactory* factoryObject, CciChar* name, CNI_VFT* functbl);
vftable.iFpCreateNodeContext = _Transform_createNodeContext; vftable.iFpDeleteNodeContext = _deleteNodeContext; vftable.iFpGetAttributeName2 = _getAttributeName2; vftable.iFpSetAttribute = _setAttribute; vftable.iFpGetAttribute2 = _getAttribute2; vftable.iFpEvaluate = _Transform_evaluate; /* if not an input node */ vftable.iFRun = _run /* if an input node */
您通常将仅定义最后 2 个条目中的一个,即,您为消息处理节点定义 vftable.iFpEvaluate = _Transform_evaluate;,或为输入节点定义 vftable.iFpRun = _run;。