Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResidueLoader.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/chemical/ResidueLoader.fwd.hh
12 /// @brief implementation of the Residue Loader
13 /// @author Sam DeLuca
14 
19 
22 
23 
24 //utility headers
25 #include <utility/excn/Exceptions.hh>
26 
27 namespace core {
28 namespace chemical {
29 
30 basic::resource_manager::ResourceLoaderOP ResidueLoaderCreator::create_resource_loader() const
31 {
32  return new ResidueLoader;
33 }
34 
36 {
37  return "ResidueType";
38 }
39 
40 utility::pointer::ReferenceCountOP
42  basic::resource_manager::ResourceOptions const & options,
43  basic::resource_manager::LocatorID const & locator_id,
44  std::istream & /*istream*/
45 ) const
46 {
47  if ( ! dynamic_cast< ResidueLoaderOptions const * > ( &options ) ) {
48  throw utility::excn::EXCN_Msg_Exception( "ResidueLoader expected to be given a ResidueLoaderOptions object, " \
49  "but was given a non-ResidueLoaderOptions object of type '" + options.type() + "', which has the name '" + options.name() + "'." );
50  }
51 
52  ResidueLoaderOptions const & residue_options = static_cast<ResidueLoaderOptions const & >(options);
53 
55  ElementSetCAP element_set = ChemicalManager::get_instance()->element_set(residue_options.element_set_tag());
59 
60  ResidueTypeOP new_residue_type(read_topology_file(locator_id,atom_type_set,element_set,mm_atom_type_set,orbital_type_set,residue_type_set));
61  return new_residue_type;
62 
63 }
64 
65 basic::resource_manager::ResourceOptionsOP ResidueLoader::default_options() const
66 {
67  return new ResidueLoaderOptions();
68 }
69 
70 }
71 }