AuboStudio SDK 0.6.3

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

`#include <data_model.h>`

## Public 成员函数
| DataModel (DataModel &f)
| DataModel (DataModel &&f)
| ~DataModel ()
void | set (const std::string &key, bool value)
| Assign a `bool` value to the specified key. 更多...
bool | get (const std::string &key, bool default_value) const
| Get the `bool` value assigned to the specified key. 更多...
void | set (const std::string &key, int value)
| Assign an `int` value to the specified key. 更多...
int | get (const std::string &key, int default_value) const
| Get the `int` value assigned to the specified key. 更多...
void | set (const std::string &key, long value)
| Assign a `long` value to the specified key. 更多...
void | set (const std::string &key, uint64_t value)
long | get (const std::string &key, long default_value) const
| Get the `long` value assigned to the specified key. 更多...
uint64_t | get (const std::string &key, uint64_t default_value) const
void | set (const std::string &key, float value)
| Assign a `float` value to the specified key. 更多...
float | get (const std::string &key, float default_value) const
| Get the `float` value assigned to the specified key. 更多...
void | set (const std::string &key, double value)
| Assign a `double` value to the specified key. 更多...
double | get (const std::string &key, double default_value) const
| Get the `double` value assigned to the specified key. 更多...
void | set (const std::string &key, const std::string &value)
| Assign a `std::string` value to the specified key. 更多...
std::string | get (const std::string &key, const std::string &default_value) const
| Get the `std::string` value assigned to the specified key. 更多...
void | set (const std::string &key, VariablePtr value)
| Assign a `Variable` value to the specified key. 更多...
void | set (const std::string &key, ExpressionPtr value)
void | set (const std::string &key, PayloadPtr value)
void | set (const std::string &key, IoPtr value)
void | set (const std::string &key, WaypointPtr value)
VariablePtr | get (const std::string &key, VariablePtr default_value) const
| Get the `Variable` value assigned to the specified key. 更多...
ExpressionPtr | get (const std::string &key, ExpressionPtr default_value) const
PayloadPtr | get (const std::string &key, PayloadPtr default_value) const
IoPtr | get (const std::string &key, IoPtr default_value) const
WaypointPtr | get (const std::string &key, WaypointPtr default_value) const
void | set (const std::string &key, const std::vector< bool > &value)
| Assign a `bool[]` as value to the specified key. 更多...
std::vector< bool > | get (const std::string &key, const std::vector< bool > &default_value) const
| Get the `bool[]` as value assigned to the specified key. 更多...
void | set (const std::string &key, const std::vector< int > &value)
| Assign a `int[]` as value to the specified key. 更多...
std::vector< int > | get (const std::string &key, const std::vector< int > &default_value) const
| Get the `int[]` as value assigned to the specified key. 更多...
void | set (const std::string &key, const std::vector< long > &value)
| Assign a `long[]` as value to the specified key. 更多...
void | set (const std::string &key, const std::vector< uint64_t > &value)
std::vector< long > | get (const std::string &key, const std::vector< long > &default_value) const
| Get the `long[]` as value assigned to the specified key. 更多...
std::vector< uint64_t > | get (const std::string &key, const std::vector< uint64_t > &default_value) const
void | set (const std::string &key, const std::vector< float > &value)
| Assign a `float[]` as value to the specified key. 更多...
std::vector< float > | get (const std::string &key, const std::vector< float > &default_value) const
| Get the `float[]` as value assigned to the specified key. 更多...
void | set (const std::string &key, const std::vector< double > &value)
| Assign a `double[]` as value to the specified key. 更多...
std::vector< double > | get (const std::string &key, const std::vector< double > &default_value) const
| Get the `double[]` as value assigned to the specified key. 更多...
void | set (const std::string &key, const std::vector< std::string > &value)
| Assign a `std::string[]` as value to the specified key. 更多...
std::vector< std::string > | get (const std::string &key, const std::vector< std::string > &default_value) const
| Get the `std::string[]` as value assigned to the specified key. 更多...
void | set (const std::string &key, TCPPtr value)
| Assign a `TCP` value to the specified key. 更多...
TCPPtr | get (const std::string &key, TCPPtr default_value) const
| Get the `TCP value assigned to the specified key.` 更多...
void | set (const std::string &key, FeaturePtr value)
| Assign a `Feature` value to the specified key. 更多...
FeaturePtr | get (const std::string &key, FeaturePtr default_value) const
| Get the `Feature` value assigned to the specified key. 更多...
std::set< std::string > | getKeys () const
| Get a set of all the keys in the data model. 更多...
bool | isSet (const std::string &key) const
| Check if a key is present in the data model. 更多...
bool | remove (const std::string &key)
| Remove a key-value pair from the data model. 更多...

## Private 成员函数
| DataModel ()

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

## 友元
class | DataSwitch

## 详细描述

This interface is used for storing and managing data that represents the current configuration of, e.g. a ProgramNodeContribution or InstallationNodeContribution. Methods for adding, removing, retrieving and changing values in a dictionary are provided.

Setting a new value for a key already in use, will overwrite the current value with the new value. This happens regardless of the type of value (e.g. storing the value `true` under the key myBool and afterwards storing an `Angle` object under the same key will overwrite the value `true` with the provided `Angle` object).

A auboCap installation screen has an underlying `DataModel` object. That object is saved and loaded along with each AuboScope installation.

Similarly, each contributed program node instance has an underlying `DataModel` object. That object is saved and loaded along with the program where the node occurs. Undo/redo actions are supported for all modifications to the `DataModel` object in HTML-based program node contributions. Swing-based aubo_studio plugins must use the {} to record the changes on the undo/redo stack.

When retrieving an object, both key and object type must match what was previously stored. This means that if a `TCP` object was stored using the key myAngle, then attempting to retrieve it using get(std::string key, Angle default_value) with the key myAngle will not return the stored value, since the types do not match. Instead the provided `default_value` will be returned.

在文件 data_model.h 第 65 行定义.

## 构造及析构函数说明

## ◆ DataModel() [1/3]

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

## ◆ DataModel() [2/3]

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

## ◆ ~DataModel()

arcs::aubo_scope::DataModel::~DataModel | ( |  | ) |

## ◆ DataModel() [3/3]

arcs::aubo_scope::DataModel::DataModel | ( |  | ) |
| private

## 成员函数说明

## ◆ get() [1/21]

bool arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | bool | default_value
| ) |  | const

Get the `bool` value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [2/21]

std::string arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | const std::string & | default_value
| ) |  | const

Get the `std::string` value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [3/21]

std::vector<bool> arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | const std::vector< bool > & | default_value
| ) |  | const

Get the `bool[]` as value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [4/21]

std::vector<double> arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | const std::vector< double > & | default_value
| ) |  | const

Get the `double[]` as value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [5/21]

std::vector<float> arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | const std::vector< float > & | default_value
| ) |  | const

Get the `float[]` as value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [6/21]

std::vector<int> arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | const std::vector< int > & | default_value
| ) |  | const

Get the `int[]` as value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [7/21]

std::vector<long> arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | const std::vector< long > & | default_value
| ) |  | const

Get the `long[]` as value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [8/21]

std::vector<std::string> arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | const std::vector< std::string > & | default_value
| ) |  | const

Get the `std::string[]` as value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [9/21]

std::vector<uint64_t> arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | const std::vector< uint64_t > & | default_value
| ) |  | const

## ◆ get() [10/21]

double arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | double | default_value
| ) |  | const

Get the `double` value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [11/21]

ExpressionPtr arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | ExpressionPtr | default_value
| ) |  | const

## ◆ get() [12/21]

FeaturePtr arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | FeaturePtr | default_value
| ) |  | const

Get the `Feature` value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [13/21]

float arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | float | default_value
| ) |  | const

Get the `float` value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [14/21]

int arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | int | default_value
| ) |  | const

Get the `int` value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [15/21]

IoPtr arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | IoPtr | default_value
| ) |  | const

## ◆ get() [16/21]

long arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | long | default_value
| ) |  | const

Get the `long` value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [17/21]

PayloadPtr arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | PayloadPtr | default_value
| ) |  | const

## ◆ get() [18/21]

TCPPtr arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | TCPPtr | default_value
| ) |  | const

Get the `TCP value assigned to the specified key.`

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [19/21]

uint64_t arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | uint64_t | default_value
| ) |  | const

## ◆ get() [20/21]

VariablePtr arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | VariablePtr | default_value
| ) |  | const

Get the `Variable` value assigned to the specified key.

参数

  key | key in the data model.
  default_value | value to be returned, if key does not exist.

返回
  the value assigned to the key. If not exist, default_value is returned.

## ◆ get() [21/21]

WaypointPtr arcs::aubo_scope::DataModel::get | ( | const std::string & | key,
|  | WaypointPtr | default_value
| ) |  | const

## ◆ getKeys()

std::set<std::string> arcs::aubo_scope::DataModel::getKeys | ( |  | ) | const

Get a set of all the keys in the data model.

返回
  A Set of keys.

## ◆ isSet()

bool arcs::aubo_scope::DataModel::isSet | ( | const std::string & | key | ) | const

Check if a key is present in the data model.

参数

  key | key in the data model (not `null` and not an empty `std::string`).

返回
  `true`, if key exist, otherwise `false`.

## ◆ remove()

bool arcs::aubo_scope::DataModel::remove | ( | const std::string & | key | ) |

Remove a key-value pair from the data model.

参数

  key | key in the data model (not `null` and not an empty `std::string`).

返回
  `true`, if succeed, otherwise `false`.

异常

  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [1/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | bool | value
| ) |  |

Assign a `bool` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [2/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | const std::string & | value
| ) |  |

Assign a `std::string` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {UndoRedoManager).

## ◆ set() [3/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | const std::vector< bool > & | value
| ) |  |

Assign a `bool[]` as value to the specified key.

参数

  key | key in the data model (not `null} and not an empty `std::string`).`
  value | `value assigned to key.`

异常

  IllegalArgumentException | `if the key is `null` or an empty `std::string`.`
  IllegalStateException | `if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {UndoRedoManager).`

## ◆ set() [4/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | const std::vector< double > & | value
| ) |  |

Assign a `double[]` as value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [5/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | const std::vector< float > & | value
| ) |  |

Assign a `float[]` as value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [6/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | const std::vector< int > & | value
| ) |  |

Assign a `int[]` as value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [7/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | const std::vector< long > & | value
| ) |  |

Assign a `long[]` as value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null} or an empty `std::string`.`
  IllegalStateException | `if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).`

## ◆ set() [8/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | const std::vector< std::string > & | value
| ) |  |

Assign a `std::string[]` as value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [9/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | const std::vector< uint64_t > & | value
| ) |  |

## ◆ set() [10/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | double | value
| ) |  |

Assign a `double` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [11/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | ExpressionPtr | value
| ) |  |

## ◆ set() [12/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | FeaturePtr | value
| ) |  |

Assign a `Feature` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [13/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | float | value
| ) |  |

Assign a `float` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [14/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | int | value
| ) |  |

Assign an `int` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [15/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | IoPtr | value
| ) |  |

## ◆ set() [16/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | long | value
| ) |  |

Assign a `long` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [17/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | PayloadPtr | value
| ) |  |

## ◆ set() [18/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | TCPPtr | value
| ) |  |

Assign a `TCP` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [19/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | uint64_t | value
| ) |  |

## ◆ set() [20/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | VariablePtr | value
| ) |  |

Assign a `Variable` value to the specified key.

参数

  key | key in the data model (not `null` and not an empty `std::string`).
  value | value assigned to key.

异常

  IllegalArgumentException | if the key is `null` or an empty `std::string`.
  IllegalStateException | if called from a Swing-based AuboCap program node outside of an UndoableChanges scope (see also {}).

## ◆ set() [21/21]

void arcs::aubo_scope::DataModel::set | ( | const std::string & | key,
|  | WaypointPtr | value
| ) |  |

## 友元及相关函数文档

## ◆ DataSwitch

friend class DataSwitch
| friend

在文件 data_model.h 第 497 行定义.

## 类成员变量说明

## ◆ d_

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

在文件 data_model.h 第 499 行定义.

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

- include/aubo_caps/domain/data/data_model.h