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
evaluation
EvaluatorFactory.hh
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 src/protocols/evaluation/EvaluatorFactory.hh
11
/// @brief Factory for creating Evaluator objects
12
/// @author Matthew O'Meara (mattjomeara@gmail.com)
13
14
15
#ifndef INCLUDED_protocols_evaluation_EvaluatorFactory_hh
16
#define INCLUDED_protocols_evaluation_EvaluatorFactory_hh
17
18
// Unit Headers
19
#include <
protocols/evaluation/EvaluatorFactory.fwd.hh
>
20
21
// Project Headers
22
#include <
protocols/evaluation/PoseEvaluator.fwd.hh
>
23
#include <
protocols/evaluation/EvaluatorCreator.fwd.hh
>
24
25
// Platform Headers
26
#include <
core/pose/Pose.fwd.hh
>
27
#include <
protocols/filters/Filter.fwd.hh
>
28
#include <
protocols/moves/Mover.fwd.hh
>
29
#include <
protocols/moves/DataMap.fwd.hh
>
30
#include <utility/tag/Tag.fwd.hh>
31
#include <utility/factory/WidgetRegistrator.hh>
32
33
// C++ Headers
34
#include <map>
35
36
#include <utility/vector1.hh>
37
38
39
namespace
protocols {
40
namespace
evaluation {
41
42
/// Create Evaluator Reporters
43
class
EvaluatorFactory
{
44
45
// Private constructor to make it singleton managed
46
EvaluatorFactory
();
47
EvaluatorFactory
(
const
EvaluatorFactory
& src);
// unimplemented
48
49
EvaluatorFactory
const
&
50
operator=
(
EvaluatorFactory
const
& );
// unimplemented
51
52
public
:
53
54
// Warning this is not called because of the singleton pattern
55
virtual
~EvaluatorFactory
();
56
57
static
EvaluatorFactory
*
get_instance
();
58
59
void
factory_register
(
EvaluatorCreatorCOP
creator );
60
void
add_evaluators
(
61
std::string
const
& type_name,
62
MetaPoseEvaluator
& eval);
63
64
void
add_all_evaluators
(
65
MetaPoseEvaluator
& eval);
66
67
/// @brief Replace the load-time EvaluatorCreator with another creator.
68
// undefined, commenting out to fix PyRosetta build void replace_creator( EvaluatorCreatorCOP creator );
69
70
// undefined, commenting out to fix PyRosetta build EvaluatorCreatorCOP
71
// get_creator( std::string const & type_name );
72
73
private
:
74
75
static
EvaluatorFactory
*
instance_
;
76
77
// This is a vector rather than a map so the canonical order of the
78
// evaluators is determined by how they are inserted.
79
typedef
std::vector< std::pair< std::string, EvaluatorCreatorCOP > >
EvaluatorCreatorMap
;
80
EvaluatorCreatorMap
types_
;
81
};
82
83
84
/// @brief This templated class will register an instance of an
85
/// EvaluatorCreator (class T) with the
86
/// EvaluatorFactory. It will ensure that no
87
/// EvaluatorCreator is registered twice, and, centralizes this
88
/// registration logic so that thread safety issues can be handled in
89
/// one place
90
template
<
class
T >
91
class
EvaluatorRegistrator
:
public
utility::factory::WidgetRegistrator< EvaluatorFactory, T >
92
{
93
public
:
94
typedef
utility::factory::WidgetRegistrator< EvaluatorFactory, T >
parent
;
95
public
:
96
EvaluatorRegistrator
() :
parent
() {}
97
};
98
99
100
101
}
// namespace
102
}
// namespace
103
104
#endif
Generated on Sat Jun 1 2013 11:48:50 for Rosetta 3.5 by
1.8.4