Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FileJobOutputter.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=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/FileJobOutputter.hh
11 /// @brief header file for FileJobOutputter class, part of August 2008 job distributor as planned at RosettaCon08
12 /// @author Steven Lewis smlewi@gmail.com
13 
14 
15 #ifndef INCLUDED_protocols_jd2_FileJobOutputter_hh
16 #define INCLUDED_protocols_jd2_FileJobOutputter_hh
17 
18 //unit headers
21 #include <protocols/jd2/Job.fwd.hh>
22 
23 //project headers
24 #include <core/pose/Pose.fwd.hh>
25 
26 //utility headers
27 #include <utility/file/FileName.hh>
28 
29 //C++ headers
30 #include <string>
31 
32 #include <utility/vector1.hh>
33 
34 
35 namespace protocols {
36 namespace jd2 {
37 
38 ///@details this is a middle-layer implementation of JobOutputter for file-based output. It handles scorefile output, as scorefiles are common to file-outputting methods.
40 {
41 public:
42 
44 
46 
47  virtual ~FileJobOutputter();
48 
49  //////////////////////////////creating output functions/////////////////////////////////////////
50 
51  ///@brief this function takes a string and writes it to disk (separately from Tracer output).
52  virtual
53  void file( JobCOP job, std::string const & data );
54 
55  ///@brief this function outputs the final result of a job.
56  virtual
57  void final_pose( JobCOP job, core::pose::Pose const & pose ) = 0;
58 
59  ///@brief this function is intended for saving mid-protocol poses; for example the final centroid structure in a combined centroid/fullatom protocol.
60  virtual
61  void other_pose( JobCOP job, core::pose::Pose const & pose, std::string const & tag, int copy_count = -1, bool score_only = false ) = 0;
62 
63  /////////////////////////////////state of output functions/////////////////////////////////
64 
65  ///@brief this function is not used for output, but it belongs here since it needs to check the same output locations as the class normally writes to. This class checks wherever output goes to see if the job's expected output already exists (on disk or whatever). This is the most basic form of checkpointing. The base implementation looks for a pdb with the job's name already in existence.
66  virtual
67  bool job_has_completed( JobCOP job ) = 0;
68 
69  ///@brief this is the master function for determining the unique output identifier for a job
70  virtual
71  std::string output_name( JobCOP job ) = 0;
72 
74  return scorefile_name_;
75  }
76 
77  bool
78  write_scorefile() const {
79  return write_scorefile_; }
80 
81  //////////////////////////////////////scorefile functions/////////////////////////////////////
82 protected:
83  ///@brief this function will handle the scorefile. If you need to make it virtual do so. Latter two arguments are for redirecting the output to a different scorefile for "other_pose"s. Also adds StringReal job info to the score file.
84  virtual
85  void scorefile( JobCOP job, core::pose::Pose const & pose, std::string tag = "", std::string scorefile = "" );
86 
87  ///@brief this function will handle the scorefile for arbitrary poses.
88  //void other_scorefile( std::string const & tag, core::pose::Pose const & pose, std::string const & o_scorefile );
89 
90 private:
93 
94 }; // FileJobOutputter
95 
96 } // namespace jd2
97 } // namespace protocols
98 
99 #endif //INCLUDED_protocols_jd2_FileJobOutputter_HH