Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LoopsFileLoader.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/loops/LoopsFileLoader.cc
11 /// @brief
12 /// @author
13 
14 //unit headers
17 
18 //package headers
21 
22 //utility headers
23 #include <utility/excn/Exceptions.hh>
24 
25 // numeric headers
26 
27 //C++ headers
28 #include <istream>
29 
30 namespace protocols {
31 namespace loops {
32 
35 
36 utility::pointer::ReferenceCountOP
38  basic::resource_manager::ResourceOptions const & options,
39  basic::resource_manager::LocatorID const & locator_id,
40  std::istream & istream
41 ) const
42 {
43  if ( ! dynamic_cast< LoopsFileOptions const * > ( &options ) ) {
44  throw utility::excn::EXCN_Msg_Exception( "LoopsFileLoader expected to be given a LoopsFileOptions object, " \
45  "but was given a non-LoopsFileOptions object of type '" + options.type() + "', which has the name '" + options.name() + "'." );
46  }
47  LoopsFileOptions const & loops_opts = static_cast< LoopsFileOptions const & > ( options );
48  LoopsFileIO lfio;
49  LoopsFileDataOP lfd = lfio.read_loop_file_stream( istream, locator_id, loops_opts.prohibit_single_residue_loops() );
50  return lfd;
51 }
52 
53 basic::resource_manager::ResourceOptionsOP
55 {
56  return new LoopsFileOptions;
57 }
58 
59 basic::resource_manager::ResourceLoaderOP LoopsFileLoaderCreator::create_resource_loader() const
60 {
61  return new LoopsFileLoader();
62 }
63 
65 {
66  return "LoopsFile";
67 }
68 
69 } // namespace loops
70 } // namespace protocols