Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SilentFileOutputter.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/outputter/SilentFileOutputter.cc
11 /// @brief An outputter can take a PipeMapSP, a PipeSP, or a PoseSP and write it to a pdb
12 /// @author Ken Jung
13 
14 // Unit Headers
18 
19 // tracer
20 #include <basic/Tracer.hh>
21 
22 namespace protocols {
23 namespace outputter {
24 
25 static basic::Tracer TR("protocols.outputter.SilentFileOutputter");
26 
27 #ifdef USELUA
28 void lregister_SilentFileOutputter( lua_State * lstate ) {
29  lregister_FormatStringOutputter( lstate );
30 
31  luabind::module(lstate, "protocols")
32  [
33  luabind::namespace_( "outputter")
34  [
35  luabind::class_<SilentFileOutputter, FormatStringOutputter>("SilentFileOutputter")
36  .def("score_only", (void (SilentFileOutputter::*) (bool) ) &SilentFileOutputter::score_only)
37  .def("tag_format_string", (void (SilentFileOutputter::*) (std::string) ) &SilentFileOutputter::tag_format_string)
38  ]
39  ];
40 }
41 #endif
42 
46  return OutputterSP( new SilentFileOutputter () );
47 }
48 
50  std::string outfilename;
51  std::string tag;
55  // who knew ternary requires 2nd and 3rd to be the same type
56  if( binary_ ) {
58  } else {
60  }
61  tmp->fill_struct( p, tag );
62  sfd_.write_silent_struct( *tmp, outfilename, score_only_ );
63 }
64 
65 #ifdef USELUA
66 void SilentFileOutputter::parse_def( utility::lua::LuaObject const & def,
67  utility::lua::LuaObject const & tasks ) {
68  format_string_ = def["format_string"] ? def["format_string"].to<std::string>() : "%filebasename_%filemultiplier.silent";
69  score_only_= def["score_only"] ? def["score_only"].to<bool>() : false;
70  binary_ = def["binary"] ? def["binary"].to<bool>() : true;
71  tag_format_string_ = def["tag_format_string"] ? def["tag_format_string"].to<std::string>() : "%filebasename_%filemultiplier";
72 }
73 
74 void SilentFileOutputter::lregister( lua_State * lstate ) {
75  lregister_SilentFileOutputter(lstate);
76 }
77 #endif
78 
79 } // outputter
80 } // protocols