25 #include <basic/Tracer.hh>
27 #include <utility/exit.hh>
28 #include <utility/io/izstream.hh>
29 #include <utility/tag/Tag.hh>
30 #include <utility/vector1.hh>
32 #include <utility/vector0.hh>
39 static basic::Tracer
TR(
"core.pack.task.operation.TaskOperationFactory");
62 utility_exit_with_message(
"Factory Name Conflict: Two or more TaskOperationCreators registered with the name " + creator->keyname() );
71 runtime_assert( creator );
116 TaskOperationOP task_operation( iter->second->create_task_operation() );
118 if ( tag.get() != NULL ) task_operation->parse_tag( tag );
119 return task_operation;
121 TR<<
"Available options: ";
123 TR<<to_iter->first<<
", ";
125 utility_exit_with_message( type +
" is not known to the TaskOperationFactory. Was its taskOperationCreator class registered at initialization?" );
135 TR.Trace <<
"Tag name " << tag->getName();
136 if ( tag->getTags().empty() ) {
TR.Trace <<
" (empty)" << std::endl;
return; }
137 else TR.Trace << std::endl;
138 TagPtrs
const subtags( tag->getTags() );
139 if ( tag->getName() ==
"TASKOPERATIONS" ) {
140 for( TagPtrs::const_iterator tp( subtags.begin() ), tp_e( subtags.end() ); tp != tp_e; ++tp ) {
143 runtime_assert( new_to );
144 tops.push_back( new_to );
145 TR <<
"Created and parsed anonymous TaskOperation of type " << type << std::endl;
149 for( TagPtrs::const_iterator tp( subtags.begin() ), tp_e( subtags.end() ); tp != tp_e; ++tp ) {
157 utility::io::izstream fin;
158 fin.open( tagfilename.c_str() );
159 runtime_assert( fin.good() );
160 TagPtr tag = utility::tag::Tag::create(fin);
162 TR <<
"TaskOperationFactory parsing " << tagfilename <<
" to create TaskOperations:" << std::endl;
163 TR << tag << std::endl;