本文整理汇总了C++中ConfigItem::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigItem::GetName方法的具体用法?C++ ConfigItem::GetName怎么用?C++ ConfigItem::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigItem
的用法示例。
在下文中一共展示了ConfigItem::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MsgAnswer
bool BasicConfig::MsgAnswer(SchemaObject& msg)
{
if(msg.GetMsgType() != SchemaObject::cmnd)
{
LOG_VERBOSE(m_Log) << "Not a command message.";
LOG_EXIT_OK;
return false;
}
if(msg.GetClass() != "config")
{
LOG_VERBOSE(m_Log) << "Not a config class.";
LOG_EXIT_OK;
return false;
}
if(msg.GetType() == "current")
{
LOG_VERBOSE(m_Log) << "current type...";
if(msg.GetValue("command") != "request")
{
LOG_VERBOSE(m_Log) << "but not command request";
LOG_EXIT_OK;
return false;
}
LOG_VERBOSE(m_Log) << "send config.current message";
SchemaConfigCurrent configCurrent;
configCurrent = ToConfigCurrent();
m_xPLDevice->SendMessage(&configCurrent, msg.GetSource());
LOG_EXIT_OK;
return true;
}
if(msg.GetType() == "list")
{
LOG_VERBOSE(m_Log) << "list type...";
if(msg.GetValue("command") != "request")
{
LOG_VERBOSE(m_Log) << "but not command request";
LOG_EXIT_OK;
return false;
}
LOG_VERBOSE(m_Log) << "send config.list message";
SchemaConfigList configList;
configList = ToConfigList();
m_xPLDevice->SendMessage(&configList, msg.GetSource());
LOG_EXIT_OK;
return true;
}
if(msg.GetType() == "response")
{
LOG_VERBOSE(m_Log) << "response type";
size_t i;
SchemaObject::SchemaItem* pSchemaItem;
ConfigItem* pConfigItem;
SchemaObject::SchemaItem::Iterator itValue;
for(i=0; i<m_ConfigItems.size(); i++)
{
pConfigItem = m_ConfigItems[i];
pSchemaItem = msg.GetItem(pConfigItem->GetName());
if(pSchemaItem==nullptr) continue;
pConfigItem->ClearValues();
for(itValue=pSchemaItem->begin(); itValue!=pSchemaItem->end(); ++itValue)
pConfigItem->AddValue(*itValue);
}
if(m_CallBackConfig != nullptr) m_CallBackConfig->Configure();
m_xPLDevice->SaveConfig();
LOG_EXIT_OK;
return true;
}
LOG_VERBOSE(m_Log) << "Not a current|list|response type.";
LOG_EXIT_OK;
return false;
}