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
io
silent
SilentStructFactory.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/io/silent/SilentStructFactory.hh
11
/// @brief Factory for creating various types of SilentStruct objects.
12
/// @author James Thompson
13
14
#ifndef INCLUDED_core_io_silent_SilentStructFactory_hh
15
#define INCLUDED_core_io_silent_SilentStructFactory_hh
16
17
#include <
core/pose/Pose.fwd.hh
>
18
#include <
core/io/silent/SilentStruct.fwd.hh
>
19
#include <
core/io/silent/SilentStructCreator.fwd.hh
>
20
21
#include <utility/vector1.hh>
22
#include <utility/factory/WidgetRegistrator.hh>
23
24
#include <map>
25
26
namespace
core {
27
namespace
io {
28
namespace
silent {
29
30
class
SilentStructFactory
{
31
private
:
32
SilentStructFactory
();
33
34
SilentStructFactory
(
SilentStructFactory
const
&);
// unimplemented
35
SilentStructFactory
const
&
operator=
(
SilentStructFactory
const
& );
// unimplemented
36
public
:
37
static
SilentStructFactory
*
get_instance
();
38
39
void
factory_register
(
SilentStructCreatorCOP
creator );
40
41
///@brief test if the specified silent struct type name is
42
///associated with a registered silent struct type.
43
bool
44
has_silent_struct_type
(
45
std::string
const
& type_name );
46
47
///@brief pretty print a list of the available silent struct types.
48
void
49
show_available_silent_struct_types
(
50
std::ostream & out);
51
52
io::silent::SilentStructOP
get_silent_struct
(
std::string
const
& type_name );
53
utility::vector1< std::string >
get_ss_names
()
const
;
54
55
/// @brief Replace the load-time SilentStructCreator with another creator.
56
void
replace_creator
(
SilentStructCreatorCOP
creator );
57
58
SilentStructCreatorCOP
59
get_creator
(
std::string
const
& type_name );
60
61
SilentStructOP
get_silent_struct_in
();
62
SilentStructOP
get_silent_struct_out
();
63
SilentStructOP
get_silent_struct_out
(
core::pose::Pose
const
& pose );
64
65
private
:
66
67
static
SilentStructFactory
*
instance_
;
68
69
typedef
std::map< std::string, io::silent::SilentStructCreatorCOP >
SilentStructCreatorMap
;
70
SilentStructCreatorMap
ss_types_
;
71
};
72
73
/// @brief This templated class will register an instance of an
74
/// SilentStructCreator (class T) with the SilentStructFactory. It will ensure
75
/// that no SilentStructCreator is registered twice, and, centralizes
76
/// this registration logic so that thread safety issues can be handled in
77
/// one place
78
template
<
class
T >
79
class
SilentStructRegistrator
:
public
utility::factory::WidgetRegistrator< SilentStructFactory, T >
80
{
81
public
:
82
typedef
utility::factory::WidgetRegistrator< SilentStructFactory, T >
parent
;
83
public
:
84
SilentStructRegistrator
() :
parent
() {}
85
};
86
87
88
}
//silent
89
}
//io
90
}
//core
91
92
#endif
Generated on Sat Jun 1 2013 11:33:05 for Rosetta 3.5 by
1.8.4