Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResConnID.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
12 /// @brief
13 /// @author Andrew Leaver-Fay
14 
15 
16 // Unit Headers
18 
19 namespace core {
20 namespace chemical {
21 
22 ResConnID::ResConnID() : res_id_( 0 ), conn_id_( 0 ) {}
23 
24 ResConnID::ResConnID( ResConnID const & rhs ) : res_id_( rhs.res_id_ ), conn_id_( rhs.conn_id_ ) {}
25 
26 ResConnID::ResConnID( Size resid, Size connid ) : res_id_( resid ), conn_id_( connid ) {}
27 
29 {
30  res_id_ = rhs.res_id_;
31  conn_id_ = rhs.conn_id_;
32  return *this;
33 }
34 
35 bool operator < ( ResConnID const & lhs, ResConnID const & rhs )
36 {
37  return ( lhs.res_id_ == rhs.res_id_ ? lhs.conn_id_ < rhs.conn_id_ : lhs.res_id_ < rhs.res_id_ );
38 }
39 
40 
41 bool operator == ( ResConnID const & lhs, ResConnID const & rhs )
42 {
43  return ( lhs.res_id_ == rhs.res_id_ && lhs.conn_id_ == rhs.conn_id_ );
44 }
45 
46 bool operator != ( ResConnID const & lhs, ResConnID const & rhs )
47 {
48  return !( lhs == rhs );
49 }
50 
51 
52 Size
54 {
55  return res_id_;
56 }
57 
58 void
60 {
61  res_id_ = setting;
62 }
63 
65 {
66  return conn_id_;
67 }
68 
69 void ResConnID::connid( Size setting )
70 {
71  conn_id_ = setting;
72 }
73 
75 {
76  return res_id_ == 0 || conn_id_ == 0;
77 }
78 
80 {
81  res_id_ = conn_id_ = 0;
82 }
83 
84 }
85 }