Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExpiryFilter.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/ExpiryFilter.cc
11 /// @brief
12 /// @author Sarel Fleishman
13 
14 
15 //Unit Headers
18 #include <utility/tag/Tag.hh>
19 //Project Headers
20 #include <basic/Tracer.hh>
21 #include <time.h>
22 namespace protocols{
23 namespace simple_filters {
24 
25 using namespace core;
26 using namespace core::scoring;
27 
28 static basic::Tracer TR( "protocols.simple_filters.ExpiryFilter" );
29 
32 
34 ExpiryFilterCreator::keyname() const { return "Expiry"; }
35 
36 //default ctor
38 protocols::filters::Filter( "Expiry" ),
39 seconds_( 0 )
40 {
41  start_time_ = time( NULL );
42 }
43 
45 
46 void
48 {
49  seconds( tag->getOption< core::Size >( "seconds" ) );
50 }
51 
52 bool
53 ExpiryFilter::apply( core::pose::Pose const & pose ) const {
54  return( compute( pose ) <= seconds() );
55 }
56 
57 void
58 ExpiryFilter::report( std::ostream & out, core::pose::Pose const & pose ) const {
59  out<<"Time from start "<< compute( pose )<<" seconds"<<std::endl;
60 }
61 
64  return( compute( pose ) );
65 }
66 
69  core::pose::Pose const & /*pose*/
70 ) const {
71  return( time( NULL ) - start_time() );
72 }
73 
76  return seconds_;
77 }
78 
79 void
81  seconds_ = s;
82 }
83 
86  return start_time_;
87 }
88 
89 }
90 }