Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InputterStream.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/inputter/InputterStream.cc
11 /// @brief InputterStream holds a list of of streams and does VERY basic things with them
12 /// like controls whether structures are duplicated across masters
13 /// and controls whether to take the list sequentially or round robin
14 /// @author Ken Jung
15 
16 // Unit Headers
19 
20 // tracer
21 #include <basic/Tracer.hh>
22 
23 namespace protocols {
24 namespace inputter {
25 
26 static basic::Tracer TR("protocols.inputter.InputterStream");
27 
28 #ifdef USELUA
29 void lregister_InputterStream( lua_State * lstate ) {
30  luabind::module(lstate, "protocols")
31  [
32  luabind::namespace_("inputter")
33  [
34  luabind::class_<InputterStream>("InputterStream")
35  ]
36  ];
37 }
38 #endif
39 
41 
43  input_itr itr = inputters_.begin();
44  while( itr != inputters_.end() ) {
45  if( (**itr).offset() ) {
46  if( (**itr).has_nth_pose( num_masters_ ) )
47  return true;
48  } else if ( (**itr).has_nth_pose( master_rank_ ) ){
49  return true;
50  }
51  // if we got here, this inputter is all out of poses for us
52  itr = inputters_.erase(itr);
53  }
54  return false;
55 }
56 
58  // it is assumed that you call has_pose before this
59  // so the first inputter always is valid
60  if( inputters_.front()->offset() ) {
61  return inputters_.front()->get_nth_pose( num_masters_ );
62  } else {
63  return inputters_.front()->get_nth_pose( master_rank_ );
64  }
65  // should never reach here
66  return core::pose::PoseSP();
67 }
68 
70  inputters_.push_back( inputter );
71 }
72 
73 void InputterStream::parse_def( utility::lua::LuaObject const & /*def*/ ) {
74 }
75 
76 } // inputter
77 } // protocols