16 #include <utility/exit.hh>
17 #include <utility/tag/Tag.hh>
19 #include <utility/vector0.hh>
20 #include <utility/vector1.hh>
25 namespace scoring_grid {
57 runtime_assert(creator);
60 if(grid_type ==
"UNDEFINED NAME")
62 utility_exit_with_message(
"can't map derived grid with undefined type name.");
66 utility_exit_with_message(
"GridFactory::factory_register already has a move creator with name \"" + grid_type +
"\". Conflicting grid names");
68 grid_creator_map_.insert(std::pair<std::string,GridCreatorOP>(grid_type,creator));
82 utility_exit_with_message(
"Error: GridCreatorOP prototype for "+type+
" is NULL!");
85 return iter->second->create_grid(tag);
89 utility_exit_with_message(type +
" is not known to the GridFactory. Was it registered via a GridRegistrator in one of the init.cc files");
102 utility::json_spirit::mObject::iterator type_it(data.find(
"type"));
103 if(type_it != data.end())
106 type = type_it->second.get_str();
111 utility::json_spirit::mObject base_data(data[
"base_data"].get_obj());
112 type = base_data[
"type"].get_str();
122 utility_exit_with_message(
"Error: GridCreatorOP prototype for "+type+
" is NULL!");
124 new_grid = iter->second->create_grid();
128 utility_exit_with_message(type +
" is not known to the GridFactory. Was it registered via a GridRegistrator in one of the init.cc files");
133 new_grid->deserialize(data);