本文整理汇总了C++中DeviceMap::end方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceMap::end方法的具体用法?C++ DeviceMap::end怎么用?C++ DeviceMap::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceMap
的用法示例。
在下文中一共展示了DeviceMap::end方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: myRelease
static ULONG __stdcall myRelease(ID3D10Device *pDevice) {
//TODO: Move logic to HardHook.
// Call base without active hook in case of no trampoline.
ReleaseType oRelease = (ReleaseType) hhRelease.call;
hhRelease.restore();
ULONG res = oRelease(pDevice);
hhRelease.inject();
Mutex m;
DeviceMap::iterator it = devices.find(pDevice);
if (it != devices.end()) {
D10State *ds = it->second;
// If we are receiving a lot of subsequent releases lets eagerly drop
// our state object. If the device presents something again a state
// object is created again just fine anyway.
if (res < ds->lHighMark / 2) {
ods("D3D10: Deleting resources %u < 0.5 * %u", res, ds->lHighMark);
devices.erase(it);
chains.erase(ds->pSwapChain);
delete ds;
ods("D3D10: Deleted");
ds = NULL;
}
}
return res;
}
示例2: AddDevice
int32_t CParseDevice::AddDevice(DeviceInfo& deviceInfo)
{
//check Id
DeviceMap::iterator deviceIter = g_deviceMap.find(deviceInfo.m_nId);
if (deviceIter != g_deviceMap.end())
{
return fail;
}
//new
DeviceInfo* pDeviceInfo = new DeviceInfo;
*pDeviceInfo = deviceInfo;
//bool bHasUserInfo = false;
//if ((0 != strlen(deviceInfo.m_szUser)) && (0 != strlen(deviceInfo.m_szPassword)))
//{
// bHasUserInfo = true;
//}
//if (0 == strcmp("DH", deviceInfo.m_szIdentifier))
//{
// if (deviceInfo.m_nRate)
// {
// sprintf(pDeviceInfo->m_szSourceUrl, "rtsp://%s:%d/cam/realmonitor?channel=2&subtype=1", deviceInfo.m_szIP, deviceInfo.m_nPort);
// }
// else
// {
// sprintf(pDeviceInfo->m_szSourceUrl, "rtsp://%s:%d/cam/realmonitor?channel=2&subtype=0", deviceInfo.m_szIP, deviceInfo.m_nPort);
// }
//}
//else if (0 == strcmp("HK", deviceInfo.m_szIdentifier))
//{
// if (deviceInfo.m_nRate)
// {
// sprintf(pDeviceInfo->m_szSourceUrl, "rtsp://%s:%d/h264/ch1/main/av_stream", deviceInfo.m_szIP, deviceInfo.m_nPort);
// }
// else
// {
// sprintf(pDeviceInfo->m_szSourceUrl, "rtsp://%s:%d/h264/ch1/sub/av_stream", deviceInfo.m_szIP, deviceInfo.m_nPort);
// }
//}
//else
//{
// delete pDeviceInfo;
// return fail;
//}
//±êʶÃû
//sprintf(pDeviceInfo->m_szIdname, "%s%s%d", deviceInfo.m_szIdentifier, deviceInfo.m_szModel, deviceInfo.m_nId);
//insert
g_deviceMap.insert(make_pair(pDeviceInfo->m_nId, pDeviceInfo));
return success;
}
示例3: Clear
void CParseDevice::Clear()
{
DeviceMap::iterator deviceIter = g_deviceMap.begin();
for (; deviceIter != g_deviceMap.end(); deviceIter++)
{
delete (*deviceIter).second;
}
g_deviceMap.clear();
}
示例4: 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);
}
示例5: 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);
}
}
}
}
示例6: DelDevice
int32_t CParseDevice::DelDevice(uint32_t nId)
{
//check Id
DeviceMap::iterator deviceIter = g_deviceMap.find(nId);
if (deviceIter == g_deviceMap.end())
{
return fail;
}
//delete
delete (*deviceIter).second;
g_deviceMap.erase(deviceIter);
return success;
}
示例7: myAddRef
static ULONG __stdcall myAddRef(ID3D10Device *pDevice) {
//TODO: Move logic to HardHook.
// Call base without active hook in case of no trampoline.
AddRefType oAddRef = (AddRefType) hhAddRef.call;
hhAddRef.restore();
ULONG res = oAddRef(pDevice);
hhAddRef.inject();
Mutex m;
DeviceMap::iterator it = devices.find(pDevice);
if (it != devices.end()) {
it->second->lHighMark = res;
}
return res;
}
示例8: 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;
}
示例9:
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;
}
示例10: AddDevice
int32_t CParseDevice::AddDevice(DeviceInfo& deviceInfo)
{
//check Id
pthread_mutex_lock(&dmt);
DeviceMap::iterator deviceIter = g_deviceMap.find(deviceInfo.m_szSourceUrl);
if (deviceIter != g_deviceMap.end())
{
printf("INFO::%s exsit\n",deviceInfo.m_szSourceUrl);
pthread_mutex_unlock(&dmt);
return success;
}
//new
DeviceInfo* pDeviceInfo = new DeviceInfo;
*pDeviceInfo = deviceInfo;
//insert
g_deviceMap.insert(make_pair(pDeviceInfo->m_szSourceUrl, pDeviceInfo));
pthread_mutex_unlock(&dmt);
return success;
}