C++ STL集合vector

Posted on 2018-01-03 09:35  yacbo  阅读(197)  评论(0编辑  收藏  举报
//清空相机表数据. 
vector<cEquip_camera*>::iterator iter = vec_equip_camera.begin();
for (; iter != vec_equip_camera.end();) {
  delete *iter;
  iter = vec_equip_camera.erase(iter);
}

for (auto it = vec_files.begin(); it != vec_files.end();it++)
{
  Mat im = imread(*it);
  if (im.data != NULL)
  {
    vec_files_new.push_back(*it);
  }
}

for (auto iter : vec_equip_camera) {
if ((iter->ID == devId) || (iter->IP == pRegisterMsg->m_DeviceIp && iter->PORT == pRegisterMsg->m_Port)) {
std::string logStr = "[CameraAdd] Failed!!! the camera ID exist!!! ID:" + std::to_string(devId) + "\n";
TRACE_LOG(LOG_INFO, logStr.data());
std::string log = "增加设备失败.设备已存摄像机名" + devName;
logToPlatform(Module_Type_RealTime_CapServer, log);
delete pData;
delete pHeader;
return;
}
}

 

Copyright © 2024 yacbo
Powered by .NET 9.0 on Kubernetes