string transform(const string& src, MapPtr& rule) { auto des = rule->find(src); if (des != rule->end()) { return des->second; } else return src; }
int CustomerData::query(const std::string& customer, const std::string& stock) const { MapPtr data = getData(); Map::const_iterator entries = data->find(customer); std::cout << "CustomerData::query " << customer << ", " << stock << std::endl; if(entries != data->end()) { return findEntry(entries->second, stock); } else return -1; }