0.4.3
ALSON::DeviceParameterManager类 参考

#include <DeviceParameterManager.h>

Public 成员函数

 DeviceParameterManager (ClientContextPtr clientContextPtr)
 
 DeviceParameterManager (const DeviceParameterManager &)=default
 
DeviceParameterManageroperator= (const DeviceParameterManager &)=default
 
 DeviceParameterManager (DeviceParameterManager &&)=default
 
DeviceParameterManageroperator= (DeviceParameterManager &&)=default
 
std::vector< std::string > getAllIds ()
 
DeviceParameter getCurrent ()
 
void saveCurrent ()
 
DeviceParameter loadCurrent (const std::string &id)
 
DeviceParameter cloneCurrent (const std::string &newId)
 
DeviceParameter cloneAndSwitchCurrent (const std::string &newId)
 
void updateCurrentValue (const std::string &newValue)
 
DeviceParameter updateCurrentDefinition (const std::string &options)
 
void setDefault ()
 
DeviceParameter switchCurrent (const std::string &id)
 
DeviceParameter deleteCurrentAndSwitchToDefault ()
 
std::string getLanguageType ()
 
void setLanguageType (const std::string &languageType)
 
BooleanParameterNodePtr getBooleanParameterNode (const std::string &key)
 
EnumerationParameterNodePtr getEnumerationParameterNode (const std::string &key)
 
IntegerParameterNodePtr getIntegerParameterNode (const std::string &key)
 
FloatParameterNodePtr getFloatParameterNode (const std::string &key)
 
ArrayParameterNodePtr getArrayParameterNode (const std::string &key)
 
void updateCurrentBooleanValue (const std::string &key, bool value)
 
void updateCurrentEnumerationValue (const std::string &key, const std::string &value)
 
void updateCurrentIntegerValue (const std::string &key, int value)
 
void updateCurrentFloatValue (const std::string &key, float value)
 
void updateCurrentStringValue (const std::string &key, const std::string &value)
 
void addArrayElementForCurrent (const std::string &arrayKey)
 
void deleteArrayElementFromCurrent (const std::string &arrayKey, int index)
 
void resetCurrentValue ()
 
void resetCurrentValue (const std::string &key)
 

详细描述

设备参数管理器

DeviceParameterManager 用于管理设备参数组,如下列表介绍了一部分关于它的常用操作

  • 可以完成对参数组的遍历、增加、删除、切换、保存等操作
  • 可以直接获取参数节点,灵活处理各种类型的参数
  • 可以直接对参数做更新、重置操作
自从
0.1.0

在文件 DeviceParameterManager.h49 行定义.

构造及析构函数说明

◆ DeviceParameterManager() [1/3]

ALSON::DeviceParameterManager::DeviceParameterManager ( ClientContextPtr clientContextPtr)
explicit

◆ DeviceParameterManager() [2/3]

ALSON::DeviceParameterManager::DeviceParameterManager ( const DeviceParameterManager & )
default

◆ DeviceParameterManager() [3/3]

ALSON::DeviceParameterManager::DeviceParameterManager ( DeviceParameterManager && )
default

成员函数说明

◆ operator=() [1/2]

DeviceParameterManager & ALSON::DeviceParameterManager::operator= ( const DeviceParameterManager & )
default

◆ operator=() [2/2]

DeviceParameterManager & ALSON::DeviceParameterManager::operator= ( DeviceParameterManager && )
default

◆ getAllIds()

std::vector< std::string > ALSON::DeviceParameterManager::getAllIds ( )

获取全部参数组的ID,容器中的第一个元素是默认参数组的ID

返回
全部参数组的ID
异常
ClientException
自从
0.1.0

◆ getCurrent()

DeviceParameter ALSON::DeviceParameterManager::getCurrent ( )

获取当前参数组

返回
当前参数组
异常
ClientException
自从
0.1.0

◆ saveCurrent()

void ALSON::DeviceParameterManager::saveCurrent ( )

保存当前参数组

异常
ClientException

◆ loadCurrent()

DeviceParameter ALSON::DeviceParameterManager::loadCurrent ( const std::string & id)

加载指定ID的参数组,使其成为新的当前参数组,旧的当前参数组将不会被自动保存

参数
id指定参数组的ID
返回
参数组对象
异常
ClientException
自从
0.1.0

◆ cloneCurrent()

DeviceParameter ALSON::DeviceParameterManager::cloneCurrent ( const std::string & newId)

先保存当前参数组。然后从当前参数组克隆一个新的参数组,并保存新参数组

参数
newId指定新参数组的ID
返回
新参数组
异常
ClientException
自从
0.1.0

◆ cloneAndSwitchCurrent()

DeviceParameter ALSON::DeviceParameterManager::cloneAndSwitchCurrent ( const std::string & newId)

先保存当前参数组。然后从当前参数组克隆一个新的参数组,并保存新参数组。最后切换到新参数组

参数
newId指定新参数组的ID
返回
新参数组
异常
ClientException
自从
0.1.0

◆ updateCurrentValue()

void ALSON::DeviceParameterManager::updateCurrentValue ( const std::string & newValue)

更新当前参数组的值。该接口已弃用,请不要在使用

参数
object当前参数组的新值,是一个 json 字符串
异常
ClientException
自从
0.1.0

◆ updateCurrentDefinition()

DeviceParameter ALSON::DeviceParameterManager::updateCurrentDefinition ( const std::string & options)

更新当前参数组的定义。该接口已弃用,请不要在使用

参数
options参数组的新值
返回
更新后的参数
异常
ClientException
自从
0.1.0

◆ setDefault()

void ALSON::DeviceParameterManager::setDefault ( )

将当前参数组设置为默认参数组

异常
ClientException
自从
0.1.0

◆ switchCurrent()

DeviceParameter ALSON::DeviceParameterManager::switchCurrent ( const std::string & id)

先保存当前参数组,再切换到目标参数组

参数
id目标参数组的ID
返回
目标参数组
异常
ClientException
自从
0.1.0

◆ deleteCurrentAndSwitchToDefault()

DeviceParameter ALSON::DeviceParameterManager::deleteCurrentAndSwitchToDefault ( )

删除当前参数组并切换到默认参数组

返回
默认参数组
异常
ClientException
自从
0.1.0

◆ getLanguageType()

std::string ALSON::DeviceParameterManager::getLanguageType ( )

获取服务端当前使用的语言类型

返回
语言类型
异常
ClientException
自从
0.2.4

◆ setLanguageType()

void ALSON::DeviceParameterManager::setLanguageType ( const std::string & languageType)

设置服务端语言类型

参数
languageType语言类型
异常
ClientException
自从
0.2.4

◆ getBooleanParameterNode()

BooleanParameterNodePtr ALSON::DeviceParameterManager::getBooleanParameterNode ( const std::string & key)

获取布尔类型参数节点的智能指针

参数
key参数节点的 key
返回
布尔类型参数节点的智能指针
异常
ClientException
自从
0.3.0

◆ getEnumerationParameterNode()

EnumerationParameterNodePtr ALSON::DeviceParameterManager::getEnumerationParameterNode ( const std::string & key)

获取枚举类型参数节点的智能指针

参数
key参数节点的 key
返回
枚举类型参数节点的智能指针
异常
ClientException
自从
0.3.0

◆ getIntegerParameterNode()

IntegerParameterNodePtr ALSON::DeviceParameterManager::getIntegerParameterNode ( const std::string & key)

获取整型参数节点的智能指针

参数
key参数节点的 key
返回
整型参数节点的智能指针
异常
ClientException
自从
0.3.0

◆ getFloatParameterNode()

FloatParameterNodePtr ALSON::DeviceParameterManager::getFloatParameterNode ( const std::string & key)

获取浮点类型参数节点的智能指针

参数
key参数节点的 key
返回
浮点型参数节点的智能指针
异常
ClientException
自从
0.3.0

◆ getArrayParameterNode()

ArrayParameterNodePtr ALSON::DeviceParameterManager::getArrayParameterNode ( const std::string & key)

获取数组类型参数节点的智能指针

参数
key参数节点的 key
返回
数组类型参数节点的智能指针
异常
ClientException
自从
0.3.0

◆ updateCurrentBooleanValue()

void ALSON::DeviceParameterManager::updateCurrentBooleanValue ( const std::string & key,
bool value )

更新当前参数组中指定的布尔类型参数的值

参数
key参数节点的 key
value更新后的参数值
异常
ClientException
自从
0.3.0

◆ updateCurrentEnumerationValue()

void ALSON::DeviceParameterManager::updateCurrentEnumerationValue ( const std::string & key,
const std::string & value )

更新当前参数组中指定的枚举类型参数的值

参数
key参数节点的 key
value更新后的参数值
异常
ClientException
自从
0.3.0

◆ updateCurrentIntegerValue()

void ALSON::DeviceParameterManager::updateCurrentIntegerValue ( const std::string & key,
int value )

更新当前参数组中指定的整型参数的值

参数
key参数节点的 key
value更新后的参数值
异常
ClientException
自从
0.3.0

◆ updateCurrentFloatValue()

void ALSON::DeviceParameterManager::updateCurrentFloatValue ( const std::string & key,
float value )

更新当前参数组中指定的浮点型参数的值

参数
key参数节点的 key
value更新后的参数值
异常
ClientException
自从
0.3.0

◆ updateCurrentStringValue()

void ALSON::DeviceParameterManager::updateCurrentStringValue ( const std::string & key,
const std::string & value )

更新当前参数组中指定的字符串类型参数的值

参数
key参数节点的 key
value更新后的参数值
异常
ClientException
自从
0.3.0

◆ addArrayElementForCurrent()

void ALSON::DeviceParameterManager::addArrayElementForCurrent ( const std::string & arrayKey)

在当前参数组中,向指定的数组类型参数中添加一个元素

参数
arrayKey参数节点的 key
异常
ClientException
自从

◆ deleteArrayElementFromCurrent()

void ALSON::DeviceParameterManager::deleteArrayElementFromCurrent ( const std::string & arrayKey,
int index )

在当前参数组中,删除指定数组类型参数中的一个元素

参数
arrayKey参数节点的 key
index被删除元素的索引
异常
ClientException
自从
0.3.0

◆ resetCurrentValue() [1/2]

void ALSON::DeviceParameterManager::resetCurrentValue ( )

重置当前参数组中所有参数的值,所有的参数都会恢复默认值

异常
ClientException
自从
0.3.0

◆ resetCurrentValue() [2/2]

void ALSON::DeviceParameterManager::resetCurrentValue ( const std::string & key)

在当前参数组中,重置指定参数的值,被指定的参数及其下级参数都会恢复默认值

参数
key参数节点的 key
异常
ClientException
自从
0.3.0
My Custom Doxygen Footer
Data Processing Programmer's Guide 0.4.3
Copyright © 2014-2024 Henan Alson Intelligent Technology Co, Ltd 河南埃尔森智能科技有限公司 版权所有 豫ICP备15002212号