Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VallFragmentScore.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/fragment/picking_old/vall/scores/VallFragmentScore.hh
11 /// @brief the base Vall FragmentScore struct
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 #ifndef INCLUDED_core_fragment_picking_old_vall_scores_VallFragmentScore_hh
15 #define INCLUDED_core_fragment_picking_old_vall_scores_VallFragmentScore_hh
16 
17 // unit headers
19 
20 // type headers
21 #include <core/types.hh>
22 
23 // package headers
25 
26 // C++ headers
27 #include <ostream>
28 #include <sstream>
29 
30 #include <utility/vector1.hh>
31 
32 
33 
34 
35 namespace core {
36 namespace fragment {
37 namespace picking_old {
38 namespace vall {
39 namespace scores {
40 
41 
42 /// @brief the base Vall FragmentScore struct
44 
45 
46 public: // typedefs
47 
48 
49  typedef core::Real Real;
50 
51 
52 public: // concept typedefs
53 
54 
55  /// @brief typedef for Bookmark concept
57 
58 
59 public: // concept translation typedefs
60 
61 
63 
64 
65 public: // friends
66 
67 
68  /// @brief friend declaration for stream operator << using virtual friend idiom
69  friend std::ostream & operator <<( std::ostream & o, VallFragmentScore const & s );
70 
71 
72 public: // construct/destruct
73 
74 
75  /// @brief default constructor
76  inline
78  score( 0.0 )
79  {}
80 
81 
82  /// @brief copy constructor
83  inline
85  extent_begin( rval.extent_begin ),
86  extent_end( rval.extent_end ),
87  score( rval.score )
88  {}
89 
90 
91  /// @brief default destructor
92  inline
93  virtual
95 
96 
97 public: // assignment
98 
99 
100  /// @brief copy assignment
101  inline
103  if ( this != &rval ) {
104  extent_begin = rval.extent_begin;
105  extent_end = rval.extent_end;
106  score = rval.score;
107  }
108  return *this;
109  }
110 
111 
112 public: // comparator
113 
114 
115  /// @brief '<' comparison
116  inline
117  bool operator <( VallFragmentScore const & rval ) const {
118  return score < rval.score;
119  }
120 
121 
122 public: // status
123 
124 
125  /// @brief return string describing contents or status
126  /// @remarks overriding this will automatically give useable
127  /// stream output due to friend operator << in base class
128  virtual
130  std::ostringstream s;
131  s << "score = " << score;
132  return s.str();
133  }
134 
135 
136 public: // convenience
137 
138 
139  /// @brief compute distance (effectively the length of the extent)
140  /// from begin -> end
141  inline
142  Size distance() const {
144  }
145 
146 
147 public: // data
148 
149 
150  /// @brief points to the beginning of the fragment
152 
153 
154  /// @brief points just beyond the end of the fragment
156 
157 
158  /// @brief the cumulative score
160 
161 
162 };
163 
164 
165 /// @brief stream output <<
166 /// @remarks uses virtual friend idiom, calls to_string()
167 inline
168 std::ostream & operator <<( std::ostream & o, VallFragmentScore const & s ) {
169  o << s.to_string();
170  return o;
171 }
172 
173 
174 } // scores
175 } // vall
176 } // picking_old
177 } // fragment
178 } // core
179 
180 
181 #endif /* INCLUDED_core_fragment_picking_old_vall_scores_VallFragmentScore_HH */