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
protocols
topology_broker
TopologyClaimerFactory.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/topology_broker/TopologyClaimerFactory.cc
11
/// @author Oliver Lange
12
/// @author Christopher Miles (cmiles@uw.edu)
13
14
// Unit Headers
15
#include <
protocols/topology_broker/TopologyClaimerFactory.hh
>
16
17
// Package Headers
18
#include <
protocols/topology_broker/TopologyClaimer.fwd.hh
>
19
#include <
protocols/topology_broker/RigidChunkClaimer.hh
>
20
#include <
protocols/topology_broker/ConstraintClaimer.hh
>
21
#include <
protocols/topology_broker/FragmentClaimer.hh
>
22
#include <
protocols/topology_broker/JumpClaimer.hh
>
23
#include <
protocols/topology_broker/DisulfJumpClaimer.hh
>
24
#include <
protocols/topology_broker/SequenceClaimer.hh
>
25
#include <
protocols/topology_broker/MetalloClaimer.hh
>
26
#include <
protocols/topology_broker/MembraneTopologyClaimer.hh
>
27
#include <
protocols/topology_broker/TemplateJumpClaimer.hh
>
28
#include <
protocols/topology_broker/CoordConstraintClaimer.hh
>
29
#include <
protocols/topology_broker/StartStructClaimer.hh
>
30
#include <
protocols/topology_broker/CutBiasClaimer.hh
>
31
#include <
protocols/topology_broker/DensityScoringClaimer.hh
>
32
#include <
protocols/topology_broker/FoldandDockClaimer.hh
>
33
#include <
protocols/topology_broker/AsymFoldandDockClaimer.hh
>
34
#include <
protocols/topology_broker/PseudocontactShiftEnergyController.hh
>
35
#include <
protocols/topology_broker/PcsEnergyController.hh
>
36
#include <
protocols/topology_broker/FibrilModelingClaimer.hh
>
37
38
// Utility headers
39
#include <basic/Tracer.hh>
40
41
// C/C++ headers
42
#include <sstream>
43
#include <string>
44
45
#include <utility/vector1.hh>
46
47
48
static
basic::Tracer
tr
(
"protocols.topo_broker"
, basic::t_info);
49
50
namespace
protocols {
51
namespace
topology_broker {
52
53
// Singleton initialization
54
TopologyClaimerFactory*
TopologyClaimerFactory::instance_
= NULL;
55
56
// Registers commonly used claimers with the name returned by claimer->type()
57
TopologyClaimerFactory::TopologyClaimerFactory
() {
58
add_type
(
new
RigidChunkClaimer
());
59
add_type
(
new
SequenceClaimer
());
60
add_type
(
new
JumpClaimer
());
61
add_type
(
new
DisulfJumpClaimer
());
62
add_type
(
new
FragmentClaimer
());
63
add_type
(
new
ConstraintClaimer
());
64
add_type
(
new
MembraneTopologyClaimer
());
65
add_type
(
new
MetalloClaimer
());
66
add_type
(
new
TemplateJumpClaimer
());
67
add_type
(
new
CoordConstraintClaimer
());
68
add_type
(
new
StartStructClaimer
());
69
add_type
(
new
CutBiasClaimer
());
70
add_type
(
new
DensityScoringClaimer
());
71
add_type
(
new
PseudocontactShiftEnergyController
());
72
add_type
(
new
PcsEnergyController
());
73
add_type
(
new
FoldandDockClaimer
());
74
add_type
(
new
FibrilModelingClaimer
());
75
add_type
(
new
AsymFoldandDockClaimer
());
76
}
77
78
TopologyClaimerFactory::~TopologyClaimerFactory
() {
79
delete
instance_
;
80
}
81
82
TopologyClaimerFactory
const
&
TopologyClaimerFactory::get_instance
() {
83
if
(!
instance_
)
84
instance_
=
new
TopologyClaimerFactory
();
85
86
return
*
instance_
;
87
}
88
89
void
TopologyClaimerFactory::add_type
(
TopologyClaimerOP
claimer) {
90
add_type
(claimer->type(), claimer);
91
}
92
93
void
TopologyClaimerFactory::add_type
(
const
std::string
& name,
TopologyClaimerOP
claimer) {
94
claimers_
[name] = claimer;
95
}
96
97
TopologyClaimerOP
TopologyClaimerFactory::newTopologyClaimer
(
const
std::string
& name)
const
{
98
using
std::stringstream;
99
100
if
(
claimers_
.find(name) !=
claimers_
.end()) {
101
return
claimers_
[name]->clone();
102
}
else
{
103
stringstream ss;
104
ss << name
105
<<
" does not name a known TopologyClaimer -->"
106
<<
" check spelling or register the type via the add_type() method"
;
107
utility_exit_with_message(ss.str());
108
109
// purely superficial return statement to quiet the compiler
110
return
NULL;
111
}
112
}
113
114
}
115
}
Generated on Sat Jun 1 2013 12:25:03 for Rosetta 3.5 by
1.8.4