bool Map::addEntry(MapEntry& mpe) { //cout << mpe; std::list<MapEntry>::iterator it = std::find_if(m_table.begin(), m_table.end(), ndn::bind(&mapEntryCompareByRouter, _1, mpe.getRouter())); if (it == m_table.end()) { m_table.push_back(mpe); return true; } return false; }
static bool mapEntryCompareByRouter(MapEntry& mpe1, const ndn::Name& rtrName) { return mpe1.getRouter() == rtrName; }