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
scoring
constraints
ConstraintFactory.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 core/scoring/constraints/ConstraintFactory.hh
11
/// @brief Factory for creating various types of constraints.
12
/// @author Greg Taylor <gktaylor@u.washington.edu>
13
14
#ifndef INCLUDED_core_scoring_constraints_ConstraintFactory_hh
15
#define INCLUDED_core_scoring_constraints_ConstraintFactory_hh
16
17
// Unit headers
18
19
// Package headers
20
#include <
core/scoring/constraints/Constraint.fwd.hh
>
21
#include <
core/scoring/constraints/ConstraintCreator.fwd.hh
>
22
23
// Utility headers
24
#include <utility/factory/WidgetRegistrator.hh>
25
26
// C++ Headers
27
#include <map>
28
29
namespace
core {
30
namespace
scoring {
31
namespace
constraints {
32
33
class
ConstraintFactory
{
34
private
:
35
ConstraintFactory
();
36
37
ConstraintFactory
(
ConstraintFactory
const
&);
// unimplemented
38
ConstraintFactory
const
&
operator=
(
ConstraintFactory
const
& );
// unimplemented
39
public
:
40
static
ConstraintFactory
*
get_instance
();
41
42
//void add_type( std::string const & type_name, ConstraintOP new_cst );
43
//void add_type( ConstraintOP new_cst );
44
45
void
factory_register
(
ConstraintCreatorCOP
creator );
46
scoring::constraints::ConstraintOP
newConstraint
(
std::string
const
& type_name );
47
utility::vector1< std::string >
get_cst_names
()
const
;
48
49
/// @brief Replace the load-time ConstraintCreator with another creator.
50
void
replace_creator
(
ConstraintCreatorCOP
creator );
51
52
ConstraintCreatorCOP
53
get_creator
(
std::string
const
& type_name );
54
private
:
55
56
static
ConstraintFactory
*
instance_
;
57
58
typedef
std::map< std::string, scoring::constraints::ConstraintCreatorCOP >
ConstraintCreatorMap
;
59
ConstraintCreatorMap
cst_types_
;
60
};
61
62
/// @brief This templated class will register an instance of an
63
/// ConstraintCreator (class T) with the ConstraintFactory. It will ensure
64
/// that no ConstraintCreator is registered twice, and, centralizes
65
/// this registration logic so that thread safety issues can be handled in
66
/// one place
67
template
<
class
T >
68
class
ConstraintRegistrator
:
public
utility::factory::WidgetRegistrator< ConstraintFactory, T >
69
{
70
public
:
71
typedef
utility::factory::WidgetRegistrator< ConstraintFactory, T >
parent
;
72
public
:
73
ConstraintRegistrator
() :
parent
() {}
74
};
75
76
77
}
//constraints
78
}
//scoring
79
}
//core
80
81
#endif
Generated on Sat Jun 1 2013 11:35:13 for Rosetta 3.5 by
1.8.4