Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TaskFactory.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 core/pack/task/TaskFactory.hh
11 /// @brief Task class to describe packer's behavior header
12 /// @author Andrew Leaver-Fay (leaverfa@email.unc.edu)
13 
14 #include <utility/exit.hh>
15 #include <boost/foreach.hpp>
16 #define foreach BOOST_FOREACH
17 
18 // Unit Headers
20 
21 // Package Headers
22 #include <core/pack/task/PackerTask_.hh> // only place in all of mini where this gets #included (except PackerTask_.cc)
24 
25 #include <utility/vector1.hh>
26 
27 
28 namespace core {
29 namespace pack {
30 namespace task {
31 
34 :
35  parent()
36 {
37  copy_operations( src );
38 }
39 
41 {
42  return new TaskFactory(*this);
43 }
44 
46 
47 TaskFactory const &
49 {
50  copy_operations( rhs );
51  return *this;
52 }
53 
54 void
56 {
57  runtime_assert( task );
58  foreach( TaskOperationOP const taskop, *this )
59  taskop->apply( pose, *task );
60 }
61 
62 // Non static version.
65 {
66  PackerTaskOP task = new PackerTask_( pose );
67  modify_task( pose, task );
68  return task;
69 }
70 
71 // clones the input task, and pushes it back into the list
72 void
74 {
75  operations_.push_back( taskop->clone() );
76 }
77 
78 void
80 {
81  operations_.push_back( taskop->clone() );
82 }
83 
86 {
87  return operations_.begin();
88 }
89 
92 {
93  return operations_.end();
94 }
95 
96 void
98 {
99  operations_.clear();
100 }
101 
102 
105  pose::Pose const & pose
106 )
107 {
108  return new PackerTask_( pose );
109 }
110 
111 void
113 {
114  for ( std::list< TaskOperationOP >::const_iterator
115  taskop_iter = src.begin(),
116  taskop_iter_end = src.end();
117  taskop_iter != taskop_iter_end; ++taskop_iter ) {
118  operations_.push_back( (*taskop_iter)->clone() );
119  }
120 }
121 
124 {
125  core::Size const size( operations_.size() );
126  return( size );
127 }
128 
129 } //namespace task
130 } //namespace pack
131 } //namespace core
132