本文整理汇总了C++中DeviceMap::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceMap::begin方法的具体用法?C++ DeviceMap::begin怎么用?C++ DeviceMap::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceMap
的用法示例。
在下文中一共展示了DeviceMap::begin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Clear
void CParseDevice::Clear()
{
DeviceMap::iterator deviceIter = g_deviceMap.begin();
for (; deviceIter != g_deviceMap.end(); deviceIter++)
{
delete (*deviceIter).second;
}
g_deviceMap.clear();
}
示例2: Clear
void CParseDevice::Clear()
{
pthread_mutex_lock(&dmt);
DeviceMap::iterator deviceIter = g_deviceMap.begin();
for (; deviceIter != g_deviceMap.end(); deviceIter++)
{
delete (*deviceIter).second;
}
g_deviceMap.clear();
pthread_mutex_unlock(&dmt);
}
示例3: logging
void monitor::EventMonitor::processTopologyModifiedDimms(const DeviceMap &devices,
const std::vector<std::string> &replacedUids)
{
LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__);
for (DeviceMap::const_iterator iter = devices.begin();
iter != devices.end(); iter++)
{
const std::string &uidStr = iter->first;
const struct deviceInfo &device = iter->second;
// device has moved (handle has changed)
if (device.discovered && device.stored &&
(device.discovery.device_handle.handle !=
device.storedState.device_handle))
{
store_event_by_parts(EVENT_TYPE_CONFIG,
EVENT_SEVERITY_INFO,
EVENT_CODE_CONFIG_TOPOLOGY_MOVED_DEVICE,
device.discovery.uid,
false,
uidStr.c_str(),
NULL,
NULL,
DIAGNOSTIC_RESULT_UNKNOWN);
}
// old device not discovered
else if (device.stored && !device.discovered)
{
// Make sure it's not in the replaced UIDs list
// if so it's already been covered by replacement events
if (std::find(replacedUids.begin(), replacedUids.end(),
uidStr) == replacedUids.end())
{
NVM_UID uid;
uid_copy(uidStr.c_str(), uid);
store_event_by_parts(EVENT_TYPE_CONFIG,
EVENT_SEVERITY_CRITICAL,
EVENT_CODE_CONFIG_TOPOLOGY_MISSING_DEVICE,
uid,
false,
uidStr.c_str(),
NULL,
NULL,
DIAGNOSTIC_RESULT_UNKNOWN);
// since the dimm is missing,
// automatically acknowledge any action required events for this dimm
acknowledgeEvent(-1, uid);
}
}
}
}
示例4: GetDeviceInfoByIdName
DeviceInfo* CParseDevice::GetDeviceInfoByIdName(const char *pszIdName)
{
DeviceMap::iterator deviceIter = g_deviceMap.begin();
for (; deviceIter != g_deviceMap.end(); deviceIter++)
{
DeviceInfo* pDeviceInfo = (*deviceIter).second;
if (NULL == pDeviceInfo)
{
continue;
}
if (0 == strcmp(pszIdName, pDeviceInfo->m_szIdname))
{
return pDeviceInfo;
}
}
return NULL;
}
示例5:
std::string monitor::EventMonitor::getReplacedDimmUid(
const DeviceMap &devices, const NVM_UINT32 &handle)
{
std::string replacedUid = "";
// find a stored device with the same handle that is no longer discovered
// this would indicated a new dimm replaced an old dimm
for (DeviceMap::const_iterator iter = devices.begin();
iter != devices.end(); iter++)
{
const struct deviceInfo &device = iter->second;
if (!device.discovered &&
device.stored &&
device.storedState.device_handle == handle)
{
replacedUid = device.storedState.uid;
break;
}
}
return replacedUid;
}