#include <DeviceParameterManager.h>
设备参数管理器
DeviceParameterManager 用于管理设备参数组,如下列表介绍了一部分关于它的常用操作
- 可以完成对参数组的遍历、增加、删除、切换、保存等操作
- 可以直接获取参数节点,灵活处理各种类型的参数
- 可以直接对参数做更新、重置操作
- 自从
- 0.1.0
在文件 DeviceParameterManager.h 第 49 行定义.
◆ DeviceParameterManager() [1/3]
ALSON::DeviceParameterManager::DeviceParameterManager |
( |
ClientContextPtr | clientContextPtr | ) |
|
|
explicit |
◆ DeviceParameterManager() [2/3]
◆ DeviceParameterManager() [3/3]
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ getAllIds()
std::vector< std::string > ALSON::DeviceParameterManager::getAllIds |
( |
| ) |
|
获取全部参数组的ID,容器中的第一个元素是默认参数组的ID
- 返回
- 全部参数组的ID
- 异常
-
- 自从
- 0.1.0
◆ getCurrent()
获取当前参数组
- 返回
- 当前参数组
- 异常
-
- 自从
- 0.1.0
◆ saveCurrent()
void ALSON::DeviceParameterManager::saveCurrent |
( |
| ) |
|
◆ loadCurrent()
DeviceParameter ALSON::DeviceParameterManager::loadCurrent |
( |
const std::string & | id | ) |
|
加载指定ID的参数组,使其成为新的当前参数组,旧的当前参数组将不会被自动保存
- 参数
-
- 返回
- 参数组对象
- 异常
-
- 自从
- 0.1.0
◆ cloneCurrent()
DeviceParameter ALSON::DeviceParameterManager::cloneCurrent |
( |
const std::string & | newId | ) |
|
先保存当前参数组。然后从当前参数组克隆一个新的参数组,并保存新参数组
- 参数
-
- 返回
- 新参数组
- 异常
-
- 自从
- 0.1.0
◆ cloneAndSwitchCurrent()
DeviceParameter ALSON::DeviceParameterManager::cloneAndSwitchCurrent |
( |
const std::string & | newId | ) |
|
先保存当前参数组。然后从当前参数组克隆一个新的参数组,并保存新参数组。最后切换到新参数组
- 参数
-
- 返回
- 新参数组
- 异常
-
- 自从
- 0.1.0
◆ updateCurrentValue()
void ALSON::DeviceParameterManager::updateCurrentValue |
( |
const std::string & | newValue | ) |
|
更新当前参数组的值。该接口已弃用,请不要在使用
- 参数
-
object | 当前参数组的新值,是一个 json 字符串 |
- 异常
-
- 自从
- 0.1.0
◆ updateCurrentDefinition()
DeviceParameter ALSON::DeviceParameterManager::updateCurrentDefinition |
( |
const std::string & | options | ) |
|
更新当前参数组的定义。该接口已弃用,请不要在使用
- 参数
-
- 返回
- 更新后的参数
- 异常
-
- 自从
- 0.1.0
◆ setDefault()
void ALSON::DeviceParameterManager::setDefault |
( |
| ) |
|
将当前参数组设置为默认参数组
- 异常
-
- 自从
- 0.1.0
◆ switchCurrent()
DeviceParameter ALSON::DeviceParameterManager::switchCurrent |
( |
const std::string & | id | ) |
|
先保存当前参数组,再切换到目标参数组
- 参数
-
- 返回
- 目标参数组
- 异常
-
- 自从
- 0.1.0
◆ deleteCurrentAndSwitchToDefault()
DeviceParameter ALSON::DeviceParameterManager::deleteCurrentAndSwitchToDefault |
( |
| ) |
|
删除当前参数组并切换到默认参数组
- 返回
- 默认参数组
- 异常
-
- 自从
- 0.1.0
◆ getLanguageType()
std::string ALSON::DeviceParameterManager::getLanguageType |
( |
| ) |
|
获取服务端当前使用的语言类型
- 返回
- 语言类型
- 异常
-
- 自从
- 0.2.4
◆ setLanguageType()
void ALSON::DeviceParameterManager::setLanguageType |
( |
const std::string & | languageType | ) |
|
◆ getBooleanParameterNode()
获取布尔类型参数节点的智能指针
- 参数
-
- 返回
- 布尔类型参数节点的智能指针
- 异常
-
- 自从
- 0.3.0
◆ getEnumerationParameterNode()
获取枚举类型参数节点的智能指针
- 参数
-
- 返回
- 枚举类型参数节点的智能指针
- 异常
-
- 自从
- 0.3.0
◆ getIntegerParameterNode()
获取整型参数节点的智能指针
- 参数
-
- 返回
- 整型参数节点的智能指针
- 异常
-
- 自从
- 0.3.0
◆ getFloatParameterNode()
获取浮点类型参数节点的智能指针
- 参数
-
- 返回
- 浮点型参数节点的智能指针
- 异常
-
- 自从
- 0.3.0
◆ getArrayParameterNode()
获取数组类型参数节点的智能指针
- 参数
-
- 返回
- 数组类型参数节点的智能指针
- 异常
-
- 自从
- 0.3.0
◆ updateCurrentBooleanValue()
void ALSON::DeviceParameterManager::updateCurrentBooleanValue |
( |
const std::string & | key, |
|
|
bool | value ) |
更新当前参数组中指定的布尔类型参数的值
- 参数
-
key | 参数节点的 key |
value | 更新后的参数值 |
- 异常
-
- 自从
- 0.3.0
◆ updateCurrentEnumerationValue()
void ALSON::DeviceParameterManager::updateCurrentEnumerationValue |
( |
const std::string & | key, |
|
|
const std::string & | value ) |
更新当前参数组中指定的枚举类型参数的值
- 参数
-
key | 参数节点的 key |
value | 更新后的参数值 |
- 异常
-
- 自从
- 0.3.0
◆ updateCurrentIntegerValue()
void ALSON::DeviceParameterManager::updateCurrentIntegerValue |
( |
const std::string & | key, |
|
|
int | value ) |
更新当前参数组中指定的整型参数的值
- 参数
-
key | 参数节点的 key |
value | 更新后的参数值 |
- 异常
-
- 自从
- 0.3.0
◆ updateCurrentFloatValue()
void ALSON::DeviceParameterManager::updateCurrentFloatValue |
( |
const std::string & | key, |
|
|
float | value ) |
更新当前参数组中指定的浮点型参数的值
- 参数
-
key | 参数节点的 key |
value | 更新后的参数值 |
- 异常
-
- 自从
- 0.3.0
◆ updateCurrentStringValue()
void ALSON::DeviceParameterManager::updateCurrentStringValue |
( |
const std::string & | key, |
|
|
const std::string & | value ) |
更新当前参数组中指定的字符串类型参数的值
- 参数
-
key | 参数节点的 key |
value | 更新后的参数值 |
- 异常
-
- 自从
- 0.3.0
◆ addArrayElementForCurrent()
void ALSON::DeviceParameterManager::addArrayElementForCurrent |
( |
const std::string & | arrayKey | ) |
|
在当前参数组中,向指定的数组类型参数中添加一个元素
- 参数
-
- 异常
-
- 自从
◆ deleteArrayElementFromCurrent()
void ALSON::DeviceParameterManager::deleteArrayElementFromCurrent |
( |
const std::string & | arrayKey, |
|
|
int | index ) |
在当前参数组中,删除指定数组类型参数中的一个元素
- 参数
-
arrayKey | 参数节点的 key |
index | 被删除元素的索引 |
- 异常
-
- 自从
- 0.3.0
◆ resetCurrentValue() [1/2]
void ALSON::DeviceParameterManager::resetCurrentValue |
( |
| ) |
|
重置当前参数组中所有参数的值,所有的参数都会恢复默认值
- 异常
-
- 自从
- 0.3.0
◆ resetCurrentValue() [2/2]
void ALSON::DeviceParameterManager::resetCurrentValue |
( |
const std::string & | key | ) |
|
在当前参数组中,重置指定参数的值,被指定的参数及其下级参数都会恢复默认值
- 参数
-
- 异常
-
- 自从
- 0.3.0