Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InnerJob.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/jd2/Job.cc
11 /// @brief August 2008 job distributor as planned at RosettaCon08 - Job classes
12 /// @author Steven Lewis smlewi@gmail.com
13 
14 ///Unit headers
16 
17 ///Project headers
18 
19 // AUTO-REMOVED #include <protocols/jd2/JobDistributor.hh>
20 // AUTO-REMOVED #include <protocols/jd2/JobInputter.hh>
21 
22 #include <core/pose/Pose.hh>
23 #include <core/pose/util.hh>
24 ///Utility headers
25 #include <basic/Tracer.hh>
26 // AUTO-REMOVED #include <utility/exit.hh>
27 
28 ///C++ headers
29 #include <string>
30 
31 #include <utility/vector1.hh>
32 
33 static basic::Tracer TR("protocols.jd2.InnerJob");
34 
35 namespace protocols {
36 namespace jd2 {
37 
38 /////////////////////////////InnerJob/////////////////////////////
39 InnerJob::InnerJob( std::string const & input_tag, core::Size nstruct_max ) :
40  input_tag_(input_tag),
41  nstruct_max_(nstruct_max),
42  pose_(NULL),
43  bad_( false )
44 {
45  //commented these out... somehow they don't respond to -mute
46  //TR.Trace << "Using InnerJob (base class) for JobDistributor" << std::endl;
47 }
48 
49 InnerJob::InnerJob( core::pose::PoseCOP pose, std::string const & input_tag, core::Size nstruct_max ) :
50  input_tag_(input_tag),
51  nstruct_max_(nstruct_max),
52  pose_( pose ),
53  bad_( false )
54 {
55  //TR.Trace << "Using InnerJob (base class) for JobDistributor" << std::endl;
56 }
57 
59 
60 std::string const & InnerJob::input_tag() const { return input_tag_; }
61 
63 
65 
67 
68 ///@details Only compare the pointer value of the pose the inner
69 ///job is referencing.
70 bool
72  InnerJob const & a,
73  InnerJob const & b
74 ) {
75  return
76  !(a.input_tag_.compare(b.input_tag_)) &&
77  a.nstruct_max_ == b.nstruct_max_ &&
78  a.pose_() == b.pose_() &&
79  a.bad_ == b.bad_;
80 }
81 
82 
83 bool
85  InnerJob const & a,
86  InnerJob const & b
87 ) {
88  return !(a == b);
89 }
90 
91 
92 void
94  std::ostream & out
95 ) const {
96  out
97  << "input_tag:" << input_tag_ << std::endl
98  << "nstruct max: " << nstruct_max_ << std::endl
99  << "bad: " << (bad_ ? "true" : "false" ) << std::endl
100  << "Pose:";
101  if( pose_() ){
102  out << std::endl << *pose_ << std::endl;
103  } else {
104  out << " NULL" << std::endl;
105  }
106 }
107 
108 std::ostream &
110  std::ostream & out,
111  const InnerJob & inner_job
112 ) {
113  inner_job.show(out);
114  return out;
115 }
116 
117 
118 } // jd2
119 } // protocols