Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResidueFeatureFactory.cc
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/comparative_modeling/features/ResidueFeatureFactory.cc
11 /// @brief Factory for creating various types of ResidueFeatures.
12 /// @author James Thompson
13 
14 // Unit headers
18 
19 // Package headers
22 
23 #include <utility/exit.hh>
24 
25 #include <utility/vector1.hh>
26 
27 
28 namespace protocols {
29 namespace comparative_modeling {
30 namespace features {
31 
32 void
34  std::string const type_name( new_feature->type() );
35  feature_types_[ type_name ] = new_feature;
36 }
37 
40  std::string const & type
41 ) const {
42  ResidueFeatureTypes::const_iterator iter = feature_types_.find( type );
43  if ( iter != feature_types_.end() ) {
44  return iter->second->clone();
45  } else {
46  utility_exit_with_message(
47  "ResidueFeatureFactory: unknown ResidueFeature type: " + type
48  );
49  return NULL;
50  }
51 }
52 
54  // initialization of ResidueFeatures which this factory knows how to
55  // instantiate
56  add_type( new SSFeature() );
57  add_type( new TorsionFeature() );
58 }
59 
60 } // namespace features
61 } // namespace comparative_modeling
62 } // namespace core