24 if (deviceName.empty())
throw Exception();
27 IDMap_t::iterator lbID = m_idMap.lower_bound(deviceID);
28 if ((m_idMap.end() != lbID) && (deviceID == lbID->first))
throw Exception();
31 NameMap_t::iterator lbName = m_nameMap.lower_bound(deviceName);
32 if ((m_nameMap.end() != lbName) && (deviceName == lbName->first))
throw Exception();
35 m_idMap.insert(lbID, std::make_pair(deviceID, deviceName));
36 m_nameMap.insert(lbName, std::make_pair(deviceName, deviceID));
43 IDMap_t::iterator itID = m_idMap.find(deviceID);
44 if (m_idMap.end() == itID)
return false;
47 NameMap_t::iterator itName = m_nameMap.find(itID->second);
51 m_nameMap.erase(itName);
59 NameMap_t::iterator itName = m_nameMap.find(deviceName);
60 if (m_nameMap.end() == itName)
return false;
63 IDMap_t::iterator itID = m_idMap.find(itName->second);
67 m_nameMap.erase(itName);
81 return m_idMap.size();
88 if (m_idMap.size() <= index)
throw Exception();
90 IDMap_t::const_iterator it = m_idMap.begin();
91 std::advance(it, index);
99 IDMap_t::const_iterator it = m_idMap.find(deviceID);
101 if (m_idMap.end() == it)
return std::string();
109 NameMap_t::const_iterator it = m_nameMap.find(deviceName);
111 if (m_nameMap.end() == it)
return 0;