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
sequence
ScoringSchemeFactory.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/sequence/ScoringSchemeFactory.cc
11
/// @brief Factory for creating various types of ScoringSchemes for use
12
/// in sequence alignment.
13
/// @author James Thompson
14
15
// Unit headers
16
#include <
core/sequence/ScoringScheme.hh
>
17
#include <
core/sequence/ScoringSchemeFactory.hh
>
18
19
// Package headers
20
#include <
core/sequence/SimpleScoringScheme.hh
>
21
#include <
core/sequence/MatrixScoringScheme.hh
>
22
#include <
core/sequence/DPScoringScheme.hh
>
23
#include <
core/sequence/L1ScoringScheme.hh
>
24
#include <
core/sequence/ProfSimScoringScheme.hh
>
25
#include <
core/sequence/CompassScoringScheme.hh
>
26
#include <
core/sequence/CompositeScoringScheme.hh
>
27
#include <
core/sequence/ChemicalShiftScoringScheme.hh
>
28
29
#include <utility/exit.hh>
30
31
namespace
core {
32
namespace
sequence {
33
34
void
35
ScoringSchemeFactory::add_type
(
ScoringSchemeOP
new_scheme ) {
36
std::string
const
type_name( new_scheme->type() );
37
scheme_types_
[ type_name ] = new_scheme;
38
}
39
40
ScoringSchemeOP
41
ScoringSchemeFactory::get_scoring_scheme
(
42
std::string
const
& type
43
)
const
{
44
ScoringSchemeTypes::const_iterator iter =
scheme_types_
.find( type );
45
if
( iter !=
scheme_types_
.end() ) {
46
return
iter->second->clone();
47
}
else
{
48
utility_exit_with_message(
49
"ScoringSchemeFactory: unknown ScoringScheme type: "
+ type
50
);
51
return
NULL;
52
}
53
}
54
55
ScoringSchemeFactory::ScoringSchemeFactory
(
void
) {
56
// initialization of ScoringSchemes which this factory knows how to
57
// instantiate
58
add_type
(
new
SimpleScoringScheme
() );
59
add_type
(
new
MatrixScoringScheme
() );
60
add_type
(
new
L1ScoringScheme
() );
61
add_type
(
new
DPScoringScheme
() );
62
add_type
(
new
ProfSimScoringScheme
() );
63
add_type
(
new
CompassScoringScheme
() );
64
add_type
(
new
CompositeScoringScheme
() );
65
add_type
(
new
ChemicalShiftScoringScheme
() );
66
}
67
68
}
// namespace sequence
69
}
// namespace core
Generated on Sat Jun 1 2013 11:40:23 for Rosetta 3.5 by
1.8.4