Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WorkUnitList.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/moves/WorkUnitList.cc
11 /// @brief
12 /// @author Mike Tyka
13 
17 #include <basic/Tracer.hh>
18 #include <utility/exit.hh>
19 
20 #include <utility/vector1.hh>
21 
22 
23 namespace protocols {
24 namespace wum {
25 
26 static basic::Tracer TR("WorkUnitList");
27 
29  the_work_unit->set_wu_type( name );
30  work_unit_list_[ name ] = the_work_unit;
31 }
32 
34  TR.Debug << "Getting WorkUnit.." << std::endl;
35  std::map< std::string, WorkUnitBaseCOP >::const_iterator iter = work_unit_list_.find( name );
36  if( iter == work_unit_list_.end() ){
37  utility_exit_with_message( "ERROR: Cannot find WorkUnit named '" + name + "'" );
38  }
39  return iter->second();
40 }
41 
42 // Copy over all the WorkUnitOPs from source to the current workUnitlist.
43 void WorkUnitList::merge( const WorkUnitList & source ){
44  for( std::map< std::string, WorkUnitBaseCOP >::const_iterator it = source.work_unit_list_.begin();
45  it != source.work_unit_list_.end(); it ++ ){
46  work_unit_list_[ it->first ] = it->second();
47  }
48 }
49 
50 }
51 }
52 
53