Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LengthEvent.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/LengthEvent.hh
17 /// @brief signal for a change in length of residues in a Conformation
18 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
19 
20 #ifndef INCLUDED_core_conformation_signals_LengthEvent_hh
21 #define INCLUDED_core_conformation_signals_LengthEvent_hh
22 
23 // type headers
24 #include <core/types.hh>
25 
26 // unit headers
28 
29 // package headers
32 
33 // utility headers
34 #include <utility/pointer/access_ptr.hh>
35 
36 
37 namespace core {
38 namespace conformation {
39 namespace signals {
40 
41 
42 /// @brief signals a change in length of residues in a Conformation
43 /// @remarks When accessing residue information, take care as to which
44 /// data member you choose. For almost all situations the ResidueCAP
45 /// 'residue' should be used instead of the Conformation. See remarks
46 /// below.
47 struct LengthEvent : public GeneralEvent {
48 
49 
50  // typedefs
51  typedef core::Size Size;
53 
54 
55  /// @brief the type of length change
56  enum Tag {
57  EMPTY, // empty event, e.g. for default constructor
58  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  length_change( 0 ),
72  residue()
73  {}
74 
75 
76  /// @brief constructor
77  /// @param t type of length change
78  /// @param pos residue position
79  inline
81  Conformation const * conf,
82  Tag const t,
83  Size const & pos,
84  int const & len_chg,
85  Residue const * res
86  ) :
87  Super( conf ),
88  tag( t ),
89  position( pos ),
90  length_change( len_chg ),
91  residue( res )
92  {}
93 
94 
95  /// @brief copy constructor
96  inline
97  LengthEvent( LengthEvent const & rval ) :
98  Super( rval ),
99  tag( rval.tag ),
100  position( rval.position ),
102  residue( rval.residue )
103  {}
104 
105 
106  /// @brief default destructor
107  inline
108  virtual
110 
111 
112  /// @brief copy assignment
113  inline
114  LengthEvent &
115  operator =( LengthEvent const & rval ) {
116  if ( this != &rval ) {
117  Super::operator =( rval );
118  tag = rval.tag;
119  position = rval.position;
121  residue = rval.residue;
122  }
123  return *this;
124  }
125 
126 
127  /// @brief tag indicating type of length change
129 
130  /// @brief residue position where the event happened
132 
133  /// @brief overall length change of the conformation
135 
136  /// @brief direct access to residue
137  /// @remarks Almost always want to use this to access the residue instead of
138  /// the conformation. Calling Conformation::residue() can cause an internal
139  /// update/re-sync inside Pose, which may have consequences if you're depending
140  /// upon multiple residue operations to be setup (such as bond angle/length
141  /// changes) prior to an internal update.
143 
144 
145 };
146 
147 
148 } // namespace signals
149 } // namespace conformation
150 } // namespace core
151 
152 
153 #endif /* INCLUDED_core_conformation_signals_LengthEvent_HH */