当前位置: 首页>>代码示例>>C++>>正文


C++ DeviceMap::begin方法代码示例

本文整理汇总了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();
}
开发者ID:AresDice,项目名称:EasyDarwin,代码行数:10,代码来源:ParseDevice.cpp

示例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);
}
开发者ID:parsons-smith,项目名称:DarwinServer,代码行数:11,代码来源:ParseDevice.cpp

示例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);
			}
		}
	}
}
开发者ID:jubalh,项目名称:IXPDIMMSW,代码行数:53,代码来源:EventMonitor.cpp

示例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;
}
开发者ID:AresDice,项目名称:EasyDarwin,代码行数:19,代码来源:ParseDevice.cpp

示例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;
}
开发者ID:jubalh,项目名称:IXPDIMMSW,代码行数:21,代码来源:EventMonitor.cpp


注:本文中的DeviceMap::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。