Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GridFactory.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 src/protocols/qsar/scoring_grid/GridFactory.hh
11 /// @author Sam DeLuca
12 
13 #ifndef INCLUDED_protocols_qsar_scoring_grid_GridFactory_HH
14 #define INCLUDED_protocols_qsar_scoring_grid_GridFactory_HH
15 
16 //Unit Headers
19 #include <utility/json_spirit/json_spirit_reader.h>
20 
21 // Utility Headers
22 #include <utility/factory/WidgetRegistrator.hh>
23 #include <utility/pointer/ReferenceCount.hh>
24 #include <utility/tag/Tag.fwd.hh>
25 #include <utility/vector1.hh>
26 // c++ headers
27 #include <map>
28 
29 namespace protocols {
30 namespace qsar {
31 namespace scoring_grid {
32 
33 /// @brief this templated class will register an instance of a
34 /// GridCreator (class T) with the GridFactory. It will ensure that
35 /// no GridCreator is registered twice and centralizes the registration logic
36 template< class T >
37 class GridRegistrator : public utility::factory::WidgetRegistrator<GridFactory,T>
38 {
39 public:
40  typedef utility::factory::WidgetRegistrator<GridFactory,T> parent;
41 public:
43 };
44 
46 {
47 public:
48 
49  typedef std::map<std::string, GridCreatorOP > GridMap;
50  typedef utility::tag::Tag Tag;
52 
53 public:
54  virtual ~GridFactory();
55 
56  static
58 
59  void factory_register(GridCreatorOP creator);
60 
61  ///@brief create Grid given grid tag
62  GridBaseOP new_grid(utility::tag::TagPtr const tag) const;
63 
64  ///@brief create Grid given a serialized grid object
65  GridBaseOP new_grid(utility::json_spirit::mObject data ) const;
66 
67 private:
68  GridFactory();
69  //unimplemented -- uncopyable
70  GridFactory(GridFactory const & );
71  GridFactory const & operator = (GridFactory const &);
72 
73 private:
76 
77 };
78 
79 }
80 }
81 }
82 
83 
84 #endif /* GRIDFACTORY_HH_ */