Esempio n. 1
0
BaseField::Ptr Registry::create(const io::Node& node) const {
  Map::const_iterator it = mMap.find(node.getName());
  if(it == mMap.end()) {
    throw KeyError(node.getName() + ": not a registered field type");
  }
  return it->second(node);
}
Esempio n. 2
0
 bool dispatch (Request& req)
 {
     Map::const_iterator const iter (m_map.find (req.method));
     if (iter == m_map.end())
         return false;
     iter->second (req);
     return true;
 }