Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ReportFilter.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/simple_filters/ReportFilter.cc
11 /// @brief
12 /// @author Sarel Fleishman
13 
14 
15 //Unit Headers
20 #include <utility/tag/Tag.hh>
21 //Project Headers
22 #include <basic/Tracer.hh>
25 #include <protocols/jd2/Job.hh>
27 namespace protocols{
28 namespace simple_filters {
29 
30 using namespace core;
31 using namespace core::scoring;
32 
33 static basic::Tracer TR( "protocols.simple_filters.ReportFilter" );
34 
37 
39 ReportFilterCreator::keyname() const { return "Report"; }
40 
41 //default ctor
43 protocols::filters::Filter( "Report" ),
44 report_string_( NULL ),
45 filter_( NULL ),
46 report_filter_name_( "" )
47 {}
48 
50 
51 void
53 {
54  report_filter_name_ = tag->getOption< std::string >( "name" );
55  if( tag->hasOption( "report_string" ) )
56  report_string_ = data.get< protocols::moves::DataMapObj< std::string > * >( "report_string", tag->getOption< std::string >( "report_string" ) );
57  if( tag->hasOption( "filter" ) )
58  filter( protocols::rosetta_scripts::parse_filter( tag->getOption< std::string >( "filter" ), filters ) );
59 }
60 
61 bool
62 ReportFilter::apply( core::pose::Pose const & pose ) const {
63  return compute( pose );
64 }
65 
66 void
67 ReportFilter::report( std::ostream & out, core::pose::Pose const & /*pose*/ ) const {
68  using namespace protocols::jd2;
69  out<<"filter: "<<report_filter_name_;
71  std::string job_name (JobDistributor::get_instance()->job_outputter()->output_name( job2 ) );
72  if( report_string_->obj.length() > 0 )
73  out<<"job name: "<<job_name<<" report_string: "<<report_string_->obj<<std::endl;
74  if( filter_() != NULL )
75  out<<"job name: "<<job_name<<" reporting filter value: ";
76 }
77 
79 ReportFilter::report_sm( core::pose::Pose const & /*pose*/ ) const {
80  return( 0.0 );
81 }
82 
85  core::pose::Pose const &
86 ) const {
87  return( 0.0 );
88 }
89 
91 {
92  report_string_->obj = f;
93 }
94 
96 {
97  return report_string_->obj;
98 }
99 
100 }
101 }