Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResId.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
11 /// @brief
12 /// @author Sarel Fleishman (sarelf@uw.edu)
13 
14 // Unit Headers
15 #include <core/types.hh>
16 #include <protocols/moves/ResId.hh>
17 #include <utility/pointer/ReferenceCount.fwd.hh>
18 // AUTO-REMOVED #include <protocols/filters/Filter.hh>
19 // AUTO-REMOVED #include <protocols/moves/Mover.hh>
20 // AUTO-REMOVED #include <protocols/protein_interface_design/DockDesign.hh>
21 // AUTO-REMOVED #include <boost/foreach.hpp>
22 
24 #include <utility/pointer/ReferenceCount.hh>
25 
26 #define foreach BOOST_FOREACH
27 
28 namespace protocols {
29 namespace moves {
30 
32  modifiable( true );
33 }
34 
36 
38  set_resid( r );
39  modifiable( true );
40 }
41 
44  return( resid_ );
45 }
46 
47 core::Size &
49  return( resid_ );
50 }
51 
52 bool
54  return( modifiable_ );
55 }
56 
57 void
58 ResId::modifiable( bool const u ) {
59  modifiable_ = u;
60 }
61 
62 void
64  resid_ = r;
65 }
66 
67 /// @details a recursive function that sets the resid of obj to the resid parameter.
68 /// If the type of obj is a CompoundFilter or a DockDesignMover then each of the
69 /// members of these containers are probed to see whether they are ResId types.
70 /// Recursion ensures that any nesting structure would be supported.
71 /// Non-ResId objects will pass through this function without being changed.
72 void
73 modify_ResId_based_object( utility::pointer::ReferenceCountOP const obj, core::Size const resid ){
74  using namespace protocols::filters;
75 
76  ResId * resid1 = dynamic_cast< ResId * >( obj() );
77  bool const is_this_a_resid( resid1 );
78  if( is_this_a_resid ){
79  if( resid1->modifiable() )
80  resid1->set_resid( resid );
81  }
82 }
83 
84 } // moves
85 } // protocols