Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
pack
task
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
19
#include <
core/pack/task/TaskFactory.hh
>
20
21
// Package Headers
22
#include <
core/pack/task/PackerTask_.hh
>
// only place in all of mini where this gets #included (except PackerTask_.cc)
23
#include <
core/pack/task/operation/TaskOperation.hh
>
24
25
#include <utility/vector1.hh>
26
27
28
namespace
core {
29
namespace
pack {
30
namespace
task {
31
32
TaskFactory::TaskFactory
() :
parent
() {}
33
TaskFactory::TaskFactory
(
TaskFactory
const
& src)
34
:
35
parent
()
36
{
37
copy_operations
( src );
38
}
39
40
TaskFactoryOP
TaskFactory::clone
()
const
41
{
42
return
new
TaskFactory
(*
this
);
43
}
44
45
TaskFactory::~TaskFactory
() {}
46
47
TaskFactory
const
&
48
TaskFactory::operator =
(
TaskFactory
const
& rhs )
49
{
50
copy_operations
( rhs );
51
return
*
this
;
52
}
53
54
void
55
TaskFactory::modify_task
(
core::pose::Pose
const
& pose,
PackerTaskOP
task )
const
56
{
57
runtime_assert( task );
58
foreach
(
TaskOperationOP
const
taskop, *
this
)
59
taskop->apply( pose, *task );
60
}
61
62
// Non static version.
63
PackerTaskOP
64
TaskFactory::create_task_and_apply_taskoperations
(
pose::Pose
const
& pose )
const
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
73
TaskFactory::push_back
(
TaskOperationCOP
taskop )
74
{
75
operations_
.push_back( taskop->clone() );
76
}
77
78
void
79
TaskFactory::push_back
(
TaskOperationSP
taskop )
80
{
81
operations_
.push_back( taskop->clone() );
82
}
83
84
TaskFactory::const_iterator
85
TaskFactory::begin
()
const
86
{
87
return
operations_
.begin();
88
}
89
90
TaskFactory::const_iterator
91
TaskFactory::end
()
const
92
{
93
return
operations_
.end();
94
}
95
96
void
97
TaskFactory::clear
()
98
{
99
operations_
.clear();
100
}
101
102
103
PackerTaskOP
104
TaskFactory::create_packer_task
(
105
pose::Pose
const
& pose
106
)
107
{
108
return
new
PackerTask_
( pose );
109
}
110
111
void
112
TaskFactory::copy_operations
(
TaskFactory
const
& src )
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
122
core::Size
123
TaskFactory::size
()
const
124
{
125
core::Size
const
size
(
operations_
.size() );
126
return
(
size
);
127
}
128
129
}
//namespace task
130
}
//namespace pack
131
}
//namespace core
132
Generated on Sat Jun 1 2013 11:34:07 for Rosetta 3.5 by
1.8.4