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

\chinese 函数模型 此接口提供在表达式编辑器中添加和删除脚本函数的方法,该编辑器可从赋值和 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)
 \chinese 添加脚本函数到表达式编辑器。
bool removeFunction (FunctionPtr func)
 \chinese 移除函数。只能移除此AuboCap添加的函数。
FunctionPtr getFunction (const std::string &name)
 \chinese 根据名称获取函数
std::vector< FunctionPtr > getFunctions ()
 \chinese 获取所有已添加的函数

Private 成员函数

 FunctionModel ()

Private 属性

void * d_ { nullptr }

友元

class DataSwitch

详细描述

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

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

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

另请参见 Function。 \endchinese \english FunctionModel This interface provides methods to add and remove script functions in the Expression Editor accessible from Assignment and If program nodes among others.

Added functions merely serve as an easy way for the end customer to use the contributed functions. The implementation of a given script function must be added in the preamble of program through the use of InstallationNodeContribution#generateScript(ScriptWriter).

The full set of functions which can be contributed must be added in the preamble at all times, regardless of whether they are added to the Expression Editor or not. Otherwise old programs that rely on a script function contribution might stop working.

See also Function. \endenglish

在文件 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 )

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

参数
name函数名称。有效名称必须匹配正则表达式[a-zA-Z][a-zA-Z0-9_]{0,24}, 共25个字符。部分AUBO Robot保留名称不可使用。
argumentNames函数参数提示列表,在表达式编辑器中以逗号分隔显示在尖括号 内。最多指定五个参数。
返回
成功添加返回表示函数的对象,否则返回null。
异常
FunctionException如果名称非法或指定了超过五个参数。 \endchinese \english Add a script function to the Expression Editor.
参数
nameName of the function. Safe names must match regex [a-zA-Z][a-zA-Z0-9_]{0,24} for a total of 25 characters.
argumentNamesIs a list of hints for the function arguments.
返回
If the script function was successfully added, an object representing the Function will be returned. Null otherwise.
异常
FunctionExceptionif the name is illegal or more than five arguments are specified. \endenglish

◆ getFunction()

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

\chinese 根据名称获取函数

参数
name函数名称。
返回
找到返回函数,否则返回null。 \endchinese \english Get a function by name.
参数
nameThe name of the function.
返回
The function if found, otherwise null. \endenglish

◆ getFunctions()

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

\chinese 获取所有已添加的函数

返回
已添加函数的集合。 \endchinese \english Get all added functions.
A collection of added functions. \endenglish

◆ removeFunction()

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

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

参数
function要移除的函数。
返回
成功移除返回true,否则返回false。 \endchinese \english Remove a function. Only functions added by this AuboCap can be removed.
参数
functionFunction to be removed.
返回
true, if the function was successfully removed. \endenglish

◆ DataSwitch

friend class DataSwitch
friend

在文件 function_model.h117 行定义.

引用了 DataSwitch.

被这些函数引用 DataSwitch.

类成员变量说明

◆ d_

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

在文件 function_model.h119 行定义.


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