PDF
AuboStudio SDK  0.6.3
arcs::aubo_scope::FunctionModel类 参考

函数模型 此接口提供在表达式编辑器中添加和删除脚本函数的方法,该编辑器可从赋值和 If 程序节点等位置访问。 更多...

#include <function_model.h>

Public 成员函数

 FunctionModel (FunctionModel &f)
 FunctionModel (FunctionModel &&f)
 ~FunctionModel ()
FunctionPtr addFunction (const std::string &name, const std::vector< std::string > &argumentNames)
 添加脚本函数到表达式编辑器。
bool removeFunction (FunctionPtr func)
 移除函数。只能移除此AuboCap添加的函数。
FunctionPtr getFunction (const std::string &name)
 根据名称获取函数
std::vector< FunctionPtr > getFunctions ()
 获取所有已添加的函数

Private 成员函数

 FunctionModel ()

Private 属性

void * d_ { nullptr }

友元

class DataSwitch

详细描述

函数模型 此接口提供在表达式编辑器中添加和删除脚本函数的方法,该编辑器可从赋值和 If 程序节点等位置访问。

添加的函数仅为终端用户提供了一种便捷的方式来使用贡献的函数。特定脚本函数的实现 必须通过 InstallationNodeContribution#generateScript(ScriptWriter) 添加到程序的前导部分。

所有可贡献的函数都必须始终添加到前导部分,无论它们是否被添加到表达式编辑器中。 否则,依赖脚本函数贡献的旧程序可能会停止工作。

另请参见 Function

在文件 function_model.h45 行定义.

构造及析构函数说明

◆ FunctionModel() [1/3]

arcs::aubo_scope::FunctionModel::FunctionModel ( FunctionModel & f)

引用了 FunctionModel().

被这些函数引用 FunctionModel() , 以及 FunctionModel().

函数调用图:
这是这个函数的调用关系图:

◆ FunctionModel() [2/3]

arcs::aubo_scope::FunctionModel::FunctionModel ( FunctionModel && f)

引用了 FunctionModel().

函数调用图:

◆ ~FunctionModel()

arcs::aubo_scope::FunctionModel::~FunctionModel ( )

◆ FunctionModel() [3/3]

arcs::aubo_scope::FunctionModel::FunctionModel ( )
private

成员函数说明

◆ addFunction()

FunctionPtr arcs::aubo_scope::FunctionModel::addFunction ( const std::string & name,
const std::vector< std::string > & argumentNames )

添加脚本函数到表达式编辑器。

参数
name函数名称。有效名称必须匹配正则表达式[a-zA-Z][a-zA-Z0-9_]{0,24}, 共25个字符。部分AUBO Robot保留名称不可使用。
argumentNames函数参数提示列表,在表达式编辑器中以逗号分隔显示在尖括号 内。最多指定五个参数。
返回
成功添加返回表示函数的对象,否则返回null。
异常
FunctionException如果名称非法或指定了超过五个参数。

◆ getFunction()

FunctionPtr arcs::aubo_scope::FunctionModel::getFunction ( const std::string & name)

根据名称获取函数

参数
name函数名称。
返回
找到返回函数,否则返回null。

◆ getFunctions()

std::vector< FunctionPtr > arcs::aubo_scope::FunctionModel::getFunctions ( )

获取所有已添加的函数

返回
已添加函数的集合。

◆ removeFunction()

bool arcs::aubo_scope::FunctionModel::removeFunction ( FunctionPtr func)

移除函数。只能移除此AuboCap添加的函数。

参数
function要移除的函数。
返回
成功移除返回true,否则返回false

◆ DataSwitch

friend class DataSwitch
friend

在文件 function_model.h117 行定义.

引用了 DataSwitch.

被这些函数引用 DataSwitch.

类成员变量说明

◆ d_

void* arcs::aubo_scope::FunctionModel::d_ { nullptr }
private

在文件 function_model.h119 行定义.


该类的文档由以下文件生成: