Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IdentityEvent.hh
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 // (C) 199x-2009 University of Washington
10 // (C) 199x-2009 University of California Santa Cruz
11 // (C) 199x-2009 University of California San Francisco
12 // (C) 199x-2009 Johns Hopkins University
13 // (C) 199x-2009 University of North Carolina, Chapel Hill
14 // (C) 199x-2009 Vanderbilt University
15 
16 /// @file core/conformation/signals/IdentityEvent.hh
17 /// @brief signal a residue identity change in a Conformation (e.g. residue identity change)
18 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
19 
20 #ifndef INCLUDED_core_conformation_signals_IdentityEvent_hh
21 #define INCLUDED_core_conformation_signals_IdentityEvent_hh
22 
23 
24 // type headers
25 #include <core/types.hh>
26 
27 // unit headers
29 
30 // package headers
34 
35 // utility headers
36 #include <utility/pointer/access_ptr.hh>
37 
38 
39 namespace core {
40 namespace conformation {
41 namespace signals {
42 
43 
44 /// @brief signals a change in residue identity in a Conformation
45 /// @remarks When accessing residue information, take care as to which
46 /// data member you choose. For almost all situations the ResidueCAP
47 /// 'residue' should be used instead of the Conformation. See remarks
48 /// below.
49 struct IdentityEvent : public GeneralEvent {
50 
51 
52  // typedefs
53  typedef core::Size Size;
55 
56 
57  /// @brief the type of length change
58  enum Tag {
59  EMPTY, // empty event, e.g. for default constructor
60  INVALIDATE, // for safety, e.g. if during copy assignment something radical occurs
62  };
63 
64 
65  /// @brief default constructor
66  inline
68  Super(),
69  tag( EMPTY ),
70  position( 0 ),
71  residue()
72  {}
73 
74 
75  /// @brief constructor
76  /// @param pos residue position
77  inline
79  Conformation const * conf,
80  Tag const t,
81  Size const & pos,
82  Residue const * res
83  ) :
84  Super( conf ),
85  tag( t ),
86  position( pos ),
87  residue( res )
88  {}
89 
90 
91  /// @brief copy constructor
92  inline
93  IdentityEvent( IdentityEvent const & rval ) :
94  Super( rval ),
95  tag( rval.tag ),
96  position( rval.position ),
97  residue( rval.residue )
98  {}
99 
100 
101  /// @brief default destructor
102  inline
103  virtual
105 
106 
107  /// @brief copy assignment
108  inline
109  IdentityEvent &
110  operator =( IdentityEvent const & rval ) {
111  if ( this != &rval ) {
112  Super::operator =( rval );
113  tag = rval.tag;
114  position = rval.position;
115  residue = rval.residue;
116  }
117  return *this;
118  }
119 
120 
121  /// @brief tag indicating type of identity change
123 
124  /// @brief residue position
126 
127  /// @brief direct access to residue
128  /// @remarks Almost always want to use this to access the residue instead of
129  /// the conformation. Calling Conformation::residue() can cause an internal
130  /// update/re-sync inside Pose, which may have consequences if you're depending
131  /// upon multiple residue operations to be setup (such as bond angle/length
132  /// changes) prior to an internal update.
134 
135 
136 };
137 
138 
139 } // namespace signals
140 } // namespace conformation
141 } // namespace core
142 
143 
144 #endif /* INCLUDED_core_conformation_signals_IdentityEvent_HH */