OPC UA 变量
更多...
#include <rmvl/opcua/variable.hpp>
|
| | Variable ()=default |
| |
| template<unsigned int N> |
| | Variable (const char(&str)[N]) |
| | 字面量字符串构造,设置默认值
|
| |
| template<typename Tp , typename Enable = std::enable_if_t<std::is_fundamental_v<Tp> || std::is_same_v<Tp, const char *>>> |
| | Variable (const Tp &val) |
| | 单值构造
|
| |
| 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) |
| | 列表构造
|
| |
| | Variable (VariableType &vtype) |
| | 从变量类型构造新的变量节点
|
| |
| bool | operator== (const Variable &val) const |
| | 比较两个变量是否相等,当且仅当两个变量的数据类型、维数、数据值均相等时返回 true,而不考虑变量的名称、描述等信息
|
| |
| bool | operator!= (const Variable &val) const |
| | 比较两个变量是否不等
|
| |
| constexpr bool | empty () const |
| | 判断变量节点是否为空
|
| |
| template<typename Tp > |
| Tp | cast () |
| | 将变量节点转化为指定类型的数据
|
| |
| const VariableType * | type () const |
| | 获取用 rm::VariableType 表示的变量类型
|
| |
| const auto & | data () const |
| | 获取数据
|
| |
| DataType | getDataType () const |
| | 获取形如 UA_TYPES_<xxx> 的数据类型
|
| |
| UA_UInt32 | size () const |
| | 获取大小
|
| |
◆ Variable() [1/5]
| rm::Variable::Variable |
( |
| ) |
|
|
default |
◆ Variable() [2/5]
template<unsigned int N>
| rm::Variable::Variable |
( |
const char(&) | str[N] | ) |
|
|
inline |
◆ Variable() [3/5]
template<typename Tp , typename Enable = std::enable_if_t<std::is_fundamental_v<Tp> || std::is_same_v<Tp, const char *>>>
| rm::Variable::Variable |
( |
const Tp & | val | ) |
|
|
inline |
单值构造
- 模板参数
-
| Tp | 变量的存储数据类型,必须是基础类型、const char * 或 const char (&)[N] 表示的字符串类型 |
- 参数
-
◆ Variable() [4/5]
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 |
列表构造
- 模板参数
-
| Tp | 变量的存储数据类型,必须是非 bool 的基础类型 |
- 参数
-
◆ Variable() [5/5]
◆ cast() [1/2]
template<typename Tp >
| Tp rm::Variable::cast |
( |
| ) |
|
|
inline |
将变量节点转化为指定类型的数据
- 模板参数
-
- 返回
- 该数据类型的数据
◆ cast() [2/2]
将变量节点转化为指定类型的数据
- 模板参数
-
- 参数
-
- 返回
- Tp 该数据类型的数据
◆ data()
| const auto & rm::Variable::data |
( |
| ) |
const |
|
inline |
◆ empty()
| bool rm::Variable::empty |
( |
| ) |
const |
|
inlineconstexpr |
◆ getDataType()
| DataType rm::Variable::getDataType |
( |
| ) |
const |
|
inline |
获取形如 UA_TYPES_<xxx> 的数据类型
◆ operator!=()
| bool rm::Variable::operator!= |
( |
const Variable & | val | ) |
const |
|
inline |
比较两个变量是否不等
- 参见
rm::Variable::operator==
- 参数
-
- 返回
- 是否不等
◆ operator==()
| bool rm::Variable::operator== |
( |
const Variable & | val | ) |
const |
比较两个变量是否相等,当且仅当两个变量的数据类型、维数、数据值均相等时返回 true,而不考虑变量的名称、描述等信息
- 参数
-
- 返回
- 是否相等
◆ size()
| UA_UInt32 rm::Variable::size |
( |
| ) |
const |
|
inline |
◆ type()
◆ access_level
| uint8_t rm::Variable::access_level {} |
◆ 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} |
该类的文档由以下文件生成: