Example #1
0
 /*! \brief Retrieve constant iterator from map given object identifier
  * \param[in] objID  the object's identification string
  */
 CallbackConstIter retrieve(const std::string & objID) const {
   if (objID.empty())
     PCMSOLVER_ERROR("No object identification string provided to the Factory.");
   CallbackConstIter i = callbacks_.find(objID);
   if (i == callbacks_.end())
     PCMSOLVER_ERROR("The unknown object ID " + objID +
                     " occurred in the Factory.");
   return i;
 }
Example #2
0
static IniCallbackData* get_callback(const std::string& name) {
  CallbackMap::iterator iter = s_system_ini_callbacks.find(name.data());
  if (iter == s_system_ini_callbacks.end()) {
    iter = s_user_callbacks->find(name.data());
    if (iter == s_user_callbacks->end()) {
      return nullptr;
    }
  }
  return &iter->second;
}