Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MoverFactory.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/moves/MoverFactory.hh
11 /// @brief
12 /// @author ashworth
13 
14 #ifndef INCLUDED_protocols_moves_MoverFactory_hh
15 #define INCLUDED_protocols_moves_MoverFactory_hh
16 
17 // Unit Headers
22 #include <protocols/filters/Filter.fwd.hh> // Filters_map (typedef)
23 
24 #include <core/pose/Pose.fwd.hh>
25 
26 // Utility Headers
27 #include <utility/factory/WidgetRegistrator.hh>
28 #include <utility/pointer/ReferenceCount.hh>
29 #include <utility/tag/Tag.fwd.hh>
30 
31 // c++ headers
32 #include <map>
33 #include <set>
34 #include <utility/vector1.hh>
35 
36 
37 namespace protocols {
38 namespace moves {
39 
40 /// @brief This templated class will register an instance of an
41 /// MoverCreator (class T) with the MoverFactory. It will ensure
42 /// that no MoverCreator is registered twice, and, centralizes
43 /// this registration logic so that thread safety issues can be handled in
44 /// one place
45 template < class T >
46 class MoverRegistrator : public utility::factory::WidgetRegistrator< MoverFactory, T >
47 {
48 public:
49  typedef utility::factory::WidgetRegistrator< MoverFactory, T > parent;
50 public:
52 };
53 
54 
55 class MoverFactory // Singleton: should not derive from ReferenceCount
56 {
57 public:
58  typedef std::map< std::string, MoverCreatorOP > MoverMap;
59  typedef utility::tag::Tag Tag;
62 
63 public:
64  virtual ~MoverFactory();
65 
66  static
68 
69  void factory_register( MoverCreatorOP creator );
70 
71  /// @brief Create a mover given its identifying string
72  MoverOP newMover( std::string const & );
73 
74  ///@brief return new Mover by Tag parsing; the identifying string for the Mover is in the Tag
75  MoverOP
76  newMover(
77  TagPtr const,
78  DataMap &,
80  Movers_map const &,
81  Pose const &
82  );
83 
84 private:
85  MoverFactory();
86 
87  // Unimplemented -- uncopyable
88  MoverFactory( MoverFactory const & );
89  MoverFactory const & operator = ( MoverFactory const & );
90 
91 private:
93 
95 
96  std::set< std::string > forbidden_names_; //certain names have historic meanings and shouldn't be assigned to new movers
97 
98 };
99 
100 } //namespace moves
101 } //namespace protocols
102 
103 #endif