AuboStudio SDK 0.6.3

Public 成员函数 | Private 成员函数 | Private 属性 | 友元 | 所有成员列表
arcs::aubo_scope::FunctionModel类 参考

`#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)
FunctionPtr | getFunction (const std::string &name)
std::vector< FunctionPtr > | getFunctions ()

## Private 成员函数
| FunctionModel ()

## Private 属性
void * | d_ { nullptr }

## 友元
class | DataSwitch

## 详细描述

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.

在文件 function_model.h 第 33 行定义.

## 构造及析构函数说明

## ◆ FunctionModel() [1/3]

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

## ◆ FunctionModel() [2/3]

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

## ◆ ~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 | Name of the function. Safe names must match regex [a-zA-Z][a-zA-Z0-9_]{0,24} for a total of 25 characters. A range of Universal Robots reserved names exists and cannot be used. In case of an illegal or reserved name, an FunctionException will be thrown.
  argumentNames | Is a list of hints (for the function arguments) to be shown comma separated inside angle brackets in the Expression Editor. No more than five arguments can be specified. The hints must also match the regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters. Otherwise an FunctionException will be thrown.

返回
  If the script function was successfully added, an object representing the Function will be returned. Null otherwise (e.g. if a function with the same name was already added).

异常

  FunctionException | if the name is illegal or more than five arguments are specified.

## ◆ getFunction()

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

参数

  name | The name of the function.

返回
  The function if found, otherwise null.

## ◆ getFunctions()

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

参数

  filter | The filter being applied to the full list of added functions (by aubo_studio plugins).

返回
  A collection of added functions that meet the filter criteria.

## ◆ removeFunction()

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

参数

  function | Function to be removed. Only functions added by this AuboCap can be removed.

返回
  `true`, if the function was successfully removed. `false` otherwise (e.g. if the function was not added by this AuboCap).

## 友元及相关函数文档

## ◆ DataSwitch

friend class DataSwitch
| friend

在文件 function_model.h 第 84 行定义.

## 类成员变量说明

## ◆ d_

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

在文件 function_model.h 第 86 行定义.

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

- include/aubo_caps/domain/function/function_model.h