Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cacheable_observers.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 
10 /// @file core/pose/datacache/cacheable_observers.hh
11 /// @brief file that has class definitions for a bunch of general CacheableObserver implementations
12 ///
13 /// @author Florian Richter (floric@u.washington.edu)
14 
15 #ifndef INCLUDED_core_pose_datacache_cacheable_observers_hh
16 #define INCLUDED_core_pose_datacache_cacheable_observers_hh
17 
18 // unit headers
21 
22 // project headers
24 //#include <core/pose/Pose.fwd.hh>
25 
26 // AUTO-REMOVED #include <ObjexxFCL/FArray1D.hh>
27 
28 // utility headers
29 #include <utility/signals/Link.hh>
30 
31 #include <utility/vector1.hh>
32 #include <ObjexxFCL/FArray1D.fwd.hh>
33 
34 
35 
36 namespace core {
37 namespace pose {
38 namespace datacache {
39 
40 
41 /// @brief a cacheable observer that keeps track of what length events occured
43 
44 
45 public: // typedefs
46 
47 
48  typedef utility::signals::Link Link;
49 
50 
51 public: // construct/destruct
52 
53 
54  /// @brief default constructor
56 
57 
58  /// @brief copy constructor
59  /// @warning Subject being observed (represented by Link/pointer) is not copied!
61 
62 
63  /// @brief default destructor
64  /// @remarks detaches during destruction
65  //virtual
67 
68 
69 public: // assignment
70 
71 
72  /// @brief copy assignment
73  /// @warning Subject being observed (represented by Link/pointer) is not copied!
75 
76 
77 public: // virtual constructors
78 
79 
80  /// @brief clone this object
81  /// @warning Subject (represented by Link/pointer) is not copied!
83 
84 
85  /// @brief create a new instance of this object
87 
88 
89 public: // interface
90 
91 
92  /// @brief is this observer attached to a Pose/Conformation?
93  bool is_attached() const {
94  return length_event_link_.valid(); }
95 
96  void
98  length_events_.clear(); }
99 
101  events() const;
102 
103 
104 protected: // virtual observer interface
105 
106 
107  /// @brief attach to Pose/Conformation
108  virtual
109  void attach_impl( pose::Pose & pose );
110 
111 
112  /// @brief detach from Pose/Conformation
113  virtual
114  void detach_impl();
115 
116  void
118 
119  //data
120 private:
121 
122  void
124 
126 
128 
129 };
130 
131 
132 /// @brief observer that tracks the fate of a one or more segments (i.e. pose
133 /// residues) of interest.
134 /// note: the convention should be that a segment.second marks the end of the segment
135 /// but is not part of it, i.e. the last position of a segment is segment.second - 1
136 /// reason: some peculiar stuff regarding the meaning of length events
138 
139 public: // typedefs
141  typedef utility::signals::Link Link;
142  typedef core::Size Size;
143  typedef std::pair< Size, Size > Segment;
144 
145 public: // construct/destruct, assignment, virtual constructors
146 
148 
150 
152 
154 
155  /// @brief clone this object
156  /// @warning Subject (represented by Link/pointer) is not copied!
158 
159  /// @brief create a new instance of this object
161 
162 public: //interface
163 
164  /// @brief is this observer attached to a Pose/Conformation?
165  bool is_attached() const {
166  return length_event_link_.valid(); }
167 
169  segments() const {
170  return segments_;
171  }
172 
173  void
174  clear();
175 
176  void
177  add_segment(
178  Size begin,
179  Size end
180  );
181 
182  /// @brief utility function that sets all elements found in the
183  /// SpecialSegmentsObserver in the pose to value
184  static
185  void
187  ObjexxFCL::FArray1D_bool & array,
188  core::pose::Pose const & pose,
189  bool const value
190  );
191 
192 protected: // virtual observer interface
193 
194  void
196 
197  /// @brief attach to Pose/Conformation
198  virtual
199  void attach_impl( pose::Pose & pose );
200 
201 
202  /// @brief detach from Pose/Conformation
203  virtual
204  void detach_impl();
205 
206 private: //data
207 
209 
211 
212 }; //SpecialSegmentsObserver
213 
214 } // namespace datacache
215 } // namespace pose
216 } // namespace core
217 
218 
219 #endif /* INCLUDED_core_pose_datacache_CacheableObserver_HH */