Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>
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 
31 private:
33 
34  SilentStructFactory(SilentStructFactory const &); // unimplemented
35  SilentStructFactory const & operator=( SilentStructFactory const & ); // unimplemented
36 public:
38 
40 
41  ///@brief test if the specified silent struct type name is
42  ///associated with a registered silent struct type.
43  bool
45  std::string const & type_name );
46 
47  ///@brief pretty print a list of the available silent struct types.
48  void
50  std::ostream & out);
51 
54 
55  /// @brief Replace the load-time SilentStructCreator with another creator.
57 
59  get_creator( std::string const & type_name );
60 
64 
65 private:
66 
68 
69  typedef std::map< std::string, io::silent::SilentStructCreatorCOP > SilentStructCreatorMap;
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:
85 };
86 
87 
88 } //silent
89 } //io
90 } //core
91 
92 #endif