OPC UA 变量
更多...
#include <rmvl/opcua/variable.hpp>
|
| | Variable ()=default |
| template<typename Tp, typename DecayT = typename std::decay_t<Tp>, typename = std::enable_if_t<std::is_fundamental_v<DecayT>>> |
| | Variable (Tp val) |
| | 单值构造
|
| | Variable (const std::string &str) |
| | 字符串构造
|
| template<std::size_t N> |
| | Variable (const char(&str)[N]) |
| | 字符串字面量构造
|
| template<typename Tp, typename Enable = std::enable_if_t<std::is_fundamental_v<Tp> && !std::is_same_v<bool, Tp>>> |
| | Variable (const std::vector< Tp > &arr) |
| | 列表构造
|
| template<typename Tp, typename Enable = std::enable_if_t<std::is_fundamental_v<Tp> && !std::is_same_v<bool, Tp>>> |
| | Variable (std::initializer_list< Tp > il) |
| | 初始化列表构造,设置默认值
|
| bool | operator== (const Variable &val) const |
| | 比较两个变量是否相等,当且仅当两个变量的数据类型、维数、数据值均相等时返回 true,而不考虑变量的名称、描述等信息
|
| bool | operator!= (const Variable &val) const |
| | 比较两个变量是否不等
|
| bool | empty () const |
| | 判断变量节点是否为空
|
| const auto & | data () const |
| | 获取数据
|
| template<typename Tp> |
| Tp | cast () const |
| | 将变量节点转化为指定类型的数据
|
| template<typename Tp, typename DecayT = typename std::decay_t<Tp>, typename = std::enable_if_t<std::is_fundamental_v<DecayT>>> |
| | operator Tp () const |
| | 基本数据类型转换函数
|
| | operator std::string () const |
| | 字符串数据类型转换函数
|
| template<typename Tp, typename Enable = std::enable_if_t<std::is_fundamental_v<Tp> && !std::is_same_v<bool, Tp>>> |
| | operator std::vector< Tp > () const |
| | 列表数据类型转换函数
|
| const VariableType | type () const |
| | 获取用 rm::VariableType 表示的变量类型
|
| DataType | getDataType () const |
| | 获取形如 UA_TYPES_<xxx> 的数据类型
|
| int | size () const |
| | 获取大小
|
◆ Variable() [1/6]
| rm::Variable::Variable |
( |
| ) |
|
|
default |
| Python: |
|---|
| rm.Variable( | | ) -> | <Variable object> |
| rm.Variable( | val | ) -> | <Variable object> |
◆ Variable() [2/6]
template<typename Tp, typename DecayT = typename std::decay_t<Tp>, typename = std::enable_if_t<std::is_fundamental_v<DecayT>>>
| rm::Variable::Variable |
( |
Tp | val | ) |
|
|
inline |
| Python: |
|---|
| rm.Variable( | | ) -> | <Variable object> |
| rm.Variable( | val | ) -> | <Variable object> |
单值构造
- 模板参数
-
| Tp | 变量的存储数据类型,必须是可包含 cv 限定符的基础类型及其引用类型 |
- 参数
-
◆ Variable() [3/6]
| rm::Variable::Variable |
( |
const std::string & | str | ) |
|
|
inline |
| Python: |
|---|
| rm.Variable( | | ) -> | <Variable object> |
| rm.Variable( | val | ) -> | <Variable object> |
◆ Variable() [4/6]
template<std::size_t N>
| rm::Variable::Variable |
( |
const char(&) | str[N] | ) |
|
|
inline |
| Python: |
|---|
| rm.Variable( | | ) -> | <Variable object> |
| rm.Variable( | val | ) -> | <Variable object> |
◆ Variable() [5/6]
template<typename Tp, typename Enable = std::enable_if_t<std::is_fundamental_v<Tp> && !std::is_same_v<bool, Tp>>>
| rm::Variable::Variable |
( |
const std::vector< Tp > & | arr | ) |
|
|
inline |
| Python: |
|---|
| rm.Variable( | | ) -> | <Variable object> |
| rm.Variable( | val | ) -> | <Variable object> |
列表构造
- 模板参数
-
| Tp | 变量的存储数据类型,必须是非 bool 的基础类型 |
- 参数
-
◆ Variable() [6/6]
template<typename Tp, typename Enable = std::enable_if_t<std::is_fundamental_v<Tp> && !std::is_same_v<bool, Tp>>>
| rm::Variable::Variable |
( |
std::initializer_list< Tp > | il | ) |
|
|
inline |
| Python: |
|---|
| rm.Variable( | | ) -> | <Variable object> |
| rm.Variable( | val | ) -> | <Variable object> |
◆ cast() [1/2]
template<typename Tp>
| Tp rm::Variable::cast |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| rm.Variable.cast( | | ) -> | <Real Type Value> |
将变量节点转化为指定类型的数据
- 模板参数
-
- 返回
- 该数据类型的数据
◆ cast() [2/2]
template<typename Tp>
| Python: |
|---|
| rm.Variable.cast( | | ) -> | <Real Type Value> |
◆ data()
| const auto & rm::Variable::data |
( |
| ) |
const |
|
inline |
◆ empty()
| bool rm::Variable::empty |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| rm.Variable.empty( | | ) -> | <Is Empty ?> |
◆ getDataType()
| DataType rm::Variable::getDataType |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| rm.Variable.getDataType( | | ) -> | <DataType> |
获取形如 UA_TYPES_<xxx> 的数据类型
◆ makeFrom()
从变量类型创建新的变量节点
- 参数
-
- 返回
- 新的变量节点
◆ operator std::string()
| rm::Variable::operator std::string |
( |
| ) |
const |
|
inline |
◆ operator std::vector< Tp >()
template<typename Tp, typename Enable = std::enable_if_t<std::is_fundamental_v<Tp> && !std::is_same_v<bool, Tp>>>
| rm::Variable::operator std::vector< Tp > |
( |
| ) |
const |
|
inline |
◆ operator Tp()
template<typename Tp, typename DecayT = typename std::decay_t<Tp>, typename = std::enable_if_t<std::is_fundamental_v<DecayT>>>
| rm::Variable::operator Tp |
( |
| ) |
const |
|
inline |
◆ operator!=()
| bool rm::Variable::operator!= |
( |
const Variable & | val | ) |
const |
|
inline |
◆ operator==()
| bool rm::Variable::operator== |
( |
const Variable & | val | ) |
const |
比较两个变量是否相等,当且仅当两个变量的数据类型、维数、数据值均相等时返回 true,而不考虑变量的名称、描述等信息
- 参数
-
- 返回
- 是否相等
◆ size()
| int rm::Variable::size |
( |
| ) |
const |
|
inline |
| Python: |
|---|
| rm.Variable.size( | | ) -> | <Size> |
获取大小
- 注解
- 未初始化、空列表则返回 0,标量则返回 -1
◆ type()
| Python: |
|---|
| rm.Variable.type( | | ) -> | <VariableType> |
◆ access_level
| uint8_t rm::Variable::access_level {3U} |
◆ browse_name
| std::string rm::Variable::browse_name {} |
◆ description
| std::string rm::Variable::description {} |
◆ display_name
| std::string rm::Variable::display_name {} |
◆ ns
| uint16_t rm::Variable::ns {1U} |
该类的文档由以下文件生成: