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
jd2
JobInputterFactory.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 protocols/jd2/JobInputterFactory.hh
11
/// @brief JobInputterFactory
12
/// @author Steven Lewis smlewi@gmail.com, Brian Weitzner brian.weitzner@gmail.com
13
14
15
#ifndef INCLUDED_protocols_jd2_JobInputterFactory_hh
16
#define INCLUDED_protocols_jd2_JobInputterFactory_hh
17
18
// Unit Headers
19
#include <
protocols/jd2/JobInputterFactory.fwd.hh
>
20
#include <
protocols/jd2/JobInputterCreator.hh
>
21
#include <
protocols/jd2/JobInputter.fwd.hh
>
22
23
// Utility Headers
24
#include <utility/factory/WidgetRegistrator.hh>
25
#include <utility/pointer/ReferenceCount.hh>
26
27
// c++ headers
28
#include <map>
29
30
#include <utility/vector1.hh>
31
32
33
namespace
protocols {
34
namespace
jd2 {
35
36
/// @brief This templated class will register an instance of an
37
/// JobInputterCreator (class T) with the JobInputterFactory. It will ensure
38
/// that no JobInputterCreator is registered twice, and, centralizes
39
/// this registration logic so that thread safety issues can be handled in
40
/// one place
41
template
<
class
T >
42
class
JobInputterRegistrator
:
public
utility::factory::WidgetRegistrator< JobInputterFactory, T >
43
{
44
public
:
45
typedef
utility::factory::WidgetRegistrator< JobInputterFactory, T >
parent
;
46
public
:
47
JobInputterRegistrator
() :
parent
() {}
48
};
49
50
51
class
JobInputterFactory
52
{
53
public
:
54
typedef
std::map< std::string, JobInputterCreatorOP >
JobInputterMap
;
55
56
public
:
57
virtual
~JobInputterFactory
();
58
59
static
60
JobInputterFactory
*
get_instance
();
61
62
void
factory_register
(
JobInputterCreatorOP
creator );
63
64
///@brief return JobInputter defined by input parameters (contained in option system and #defines for MPI, etc)
65
JobInputterOP
get_new_JobInputter
();
66
67
private
:
68
JobInputterOP
get_JobInputter_from_string
(
std::string
const
& job_inputter_type );
69
70
JobInputterFactory
();
71
72
// Unimplemented -- uncopyable
73
JobInputterFactory
(
JobInputterFactory
const
& );
74
JobInputterFactory
const
&
operator =
(
JobInputterFactory
const
& );
75
76
private
:
77
static
JobInputterFactory
*
instance_
;
78
79
JobInputterMap
job_inputter_creator_map_
;
80
81
};
82
83
}
//namespace jd2
84
}
//namespace protocols
85
86
#endif //INCLUDED_protocols_jd2_JobInputterFactory_hh
Generated on Sat Jun 1 2013 11:54:51 for Rosetta 3.5 by
1.8.4