20 #include <basic/Tracer.hh>
22 #include <utility/tag/Tag.hh>
26 #include <utility/vector0.hh>
29 #include <boost/foreach.hpp>
30 #define foreach BOOST_FOREACH
36 #include <utility/vector1.hh>
47 using std::stringstream;
55 static basic::Tracer
tr(
"protocols.features.FeaturesReporterFactory");
83 types_[ creator->type_name() ] = creator;
89 string const & type_name
91 tr.Trace <<
"generate features reporter of type " << type_name << std::endl;
92 FeaturesReporterCreatorMap::const_iterator iter =
types_.find( type_name );
93 if (iter !=
types_.end()) {
94 return iter->second->create_features_reporter();
96 stringstream error_msg;
98 <<
"Attempting to create unrecognized FeaturesReporter "
99 <<
"'" << type_name <<
"'." << endl
100 <<
"check spelling or "
101 <<
"register a new FeaturesReporter in the FeaturesReporterFactory" << endl
102 <<
"known FeaturesReporter types are:" << endl;
104 foreach(
const FeaturesReporterCreatorMap::value_type& type,
types_){
105 error_msg <<
"\t" << type.first << endl;
107 utility_exit_with_message(error_msg.str());
114 FeaturesReporterCreatorMap::const_iterator iter =
types_.begin();
115 while ( iter !=
types_.end() ) {
116 collection.push_back(iter->first);
130 assert(tag->getName() ==
"feature");
133 if(!tag->hasOption(
"name")){
134 utility_exit_with_message(
"'feature' tags require a name field");
136 type_name = tag->getOption<
string>(
"name");
141 features_reporter->parse_my_tag(tag, data, filters, movers, pose);
142 return features_reporter;