Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Inputter.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=1 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/Inputter.hh
11 /// @brief An inputter, a class that returns a poseSP
12 /// @author Ken Jung
13 
14 #ifndef INCLUDED_protocols_inputter_Inputter_hh
15 #define INCLUDED_protocols_inputter_Inputter_hh
16 
17 // Unit Headers
19 
20 // Project headers
21 #include <core/pose/Pose.fwd.hh>
22 
23 #include <utility/lua/LuaObject.hh>
24 
25 #include <string>
26 
27 namespace protocols {
28 namespace inputter {
29 
30 #ifdef USELUA
31 void lregister_Inputter( lua_State * lstate );
32 #endif
33 
34 class Inputter {
35 
36  public:
37  Inputter();
38  virtual ~Inputter();
39 
40  // throw away n-1 poses and return the nth one
41  // necessary to prevent duplication of input across different masters
42  // of course, default is 1 for non-mpi scenarios
43  virtual core::pose::PoseSP get_nth_pose( int n=1 ) = 0;
44  virtual bool has_nth_pose( int n=1 ) = 0;
45 
46 
47  // this says whether any poses have been returned from here or not
48  // ie whether or not the masterrank offset has been set
49  // this is required because if inputter is split across masters
50  // 1) get_nth_pose( my_master_rank )
51  // 2) get_nth_pose( num_masters) for every pose after that
52  // so need to know when 1) has been done
53  bool offset() {
54  return offset_;
55  }
56 
57 #ifdef USELUA
58  // need to pass in a map of the previous inputters, as inputters will call inputters
59  // not a huge fan of this, but implementing it correctly and more extensibly will be a lot more work
60  // and fpd doesn't think there will be much customizing requested in inputters
61  virtual void parse_def( utility::lua::LuaObject const & def,
62  utility::lua::LuaObject const & tasks,
63  utility::lua::LuaObject & inputters ) = 0;
64  virtual void lregister( lua_State * lstate )=0;
65 #endif
66 
67  // factory functions
68  virtual InputterSP create() = 0;
69  static std::string name() {
70  return "UNDEFINED NAME";
71  }
72 
73 
74  protected:
75  bool offset_;
76 
77 }; // end Inputter base class
78 
79 } // inputter
80 } // protocols
81 
82 
83 #endif //INCLUDED_protocols_inputter_Inputter_HH