Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InvrotTreeNodeBase.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file protocols/toolbox/match_enzdes_util/InvrotTreeNodeBase.cc
12 /// @brief Forward declaration for inverse rotamer tree node base
13 /// @author Florian Richter, flosopher@gmail.com, mar 2012
14 
15 /// unit headers
17 
18 //project headers
20 
21 //utility headers
22 #include <utility/exit.hh>
23 
24 
25 namespace protocols {
26 namespace toolbox {
27 namespace match_enzdes_util {
28 
29 
31  Size num_residue_lists )
32 {
33  invrots_.clear();
34  invrots_.resize( num_residue_lists );
36 }
37 
39  : ReferenceCount(), invrots_(other.invrots_), owner_nodes_and_locations_(other.owner_nodes_and_locations_)
40 {}
41 
43 
46  return new InvrotCollector( *this );
47 }
48 
49 void
51  Size listnum,
52  std::list<core::conformation::ResidueCOP> const & invrots,
53  InvrotTreeNodeBaseCOP tree_node,
54  Size location_in_node
55 )
56 {
57  runtime_assert( listnum < invrots_.size() );
58  //if( owner_nodes_and_locations_.find( tree_node ) != owner_nodes_and_locations_.end() ) utility_exit_with_message("Trying to add stuff for a node that has already been added.");
59 
60  //if( invrots_[listnum].size() != 0) utility_exit_with_message("Trying to overwrite rotamers in invrot collector");
61  invrots_[listnum] = invrots;
62  if( owner_nodes_and_locations_.find( tree_node ) != owner_nodes_and_locations_.end() ) owner_nodes_and_locations_.erase( tree_node );
63  owner_nodes_and_locations_.insert( std::pair< InvrotTreeNodeBaseCOP, Size >( tree_node, location_in_node ) );
64 }
65 
66 
67 
69  InvrotTreeNodeBaseCAP parent_node )
70  : ReferenceCount(), parent_node_(parent_node ), location_in_parent_node_(1)
71 {}
72 
74 
75 }
76 }
77 }